diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 7 | ||||
-rw-r--r-- | src/test/resources/flag.json | 2 |
2 files changed, 7 insertions, 2 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 diff --git a/src/test/resources/flag.json b/src/test/resources/flag.json index c3363f01..9598d9d9 100644 --- a/src/test/resources/flag.json +++ b/src/test/resources/flag.json @@ -1 +1 @@ -{"@context":"https://www.w3.org/ns/activitystreams","id":"https://localhost/32ac2d3e-c75c-46c1-b0a7-d9fac0986b9a","type":"Flag","actor":"https://example.com/actor","content":"","object":["https://juick.com/u/rtfmpls","https://juick.com/n/2998271-0"]}
\ No newline at end of file +{"@context":"https://www.w3.org/ns/activitystreams","id":"https://mastodon.social/bece4612-4dc7-4efd-871f-e388c393f239","type":"Flag","actor":"https://mastodon.social/actor","content":"","object":["https://juick.com/u/Monstreek","https://juick.com/n/3053193-14","https://juick.com/n/3053193-10"]}
\ No newline at end of file |