aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2024-03-13 02:20:33 +0300
committerGravatar Vitaly Takmazov2024-03-13 02:20:33 +0300
commite43b64a9ea8bf80ec62cd59ad4eed19b112f5093 (patch)
treece32df17b96e5e1965d795e15b74b19f0f43d9c5 /src/test/java/com/juick
parent46db0df06eacbc7c7812918683089835e29ae56c (diff)
ActivityPub: handle Flag with multiple objects
TODO: refactor Activity to handle multiple objects
Diffstat (limited to 'src/test/java/com/juick')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index 0724eb4f..b97ae8a3 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -217,6 +217,8 @@ public class ServerTests {
private Resource nojfif;
@Value("classpath:hubzilla_activity.json")
private Resource hubzillaActivity;
+ @Value("classpath:flag.json")
+ private Resource mastodonFlag;
@Value("classpath:hubzilla_follow.json")
private Resource hubzillaFollow;
@Value("classpath:to_as_string.json")
@@ -2275,7 +2277,7 @@ public class ServerTests {
}
@Test
- public void hubzillaAndHonkActorAndFriendicaUpdate() throws Exception {
+ public void hubzillaAndHonkActorAndFriendicaUpdateAndMastodonFlag() throws Exception {
String activity = IOUtils.toString(hubzillaActivity.getInputStream(), StandardCharsets.UTF_8);
Create create = jsonMapper.readValue(activity, Create.class);
String followData = IOUtils.toString(hubzillaFollow.getInputStream(), StandardCharsets.UTF_8);
@@ -2286,6 +2288,9 @@ public class ServerTests {
assertThat(hfollow.getTo().get(0), is("https://juick.com/u/vt"));
String updateString = IOUtils.toString(friendicaUpdate.getInputStream(), StandardCharsets.UTF_8);
Update update = jsonMapper.readValue(updateString, Update.class);
+ String flagString = IOUtils.toString(mastodonFlag.getInputStream(), StandardCharsets.UTF_8);
+ Flag flag = (Flag) jsonMapper.readValue(flagString, Context.class);
+ assertThat(flag.getObject().size(), is(3));
}
@Test