diff options
Diffstat (limited to 'juick-server/src/test')
-rw-r--r-- | juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java index 63ba4b3ee..a94acc82a 100644 --- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java +++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java @@ -1324,7 +1324,7 @@ public class ServerTests { } @Test - public void accountUrlsShouldBeExposedOverWebfinger() throws Exception { + public void accountUrlShouldBeExposedOverWebfinger() throws Exception { mockMvc.perform(get("/.well-known/webfinger?resource=acct:ugnich@localhost")) .andExpect(status().isOk()) .andExpect(jsonPath("$.subject", is("acct:ugnich@localhost"))) @@ -1334,10 +1334,18 @@ public class ServerTests { .andExpect(status().isNotFound()); } @Test - public void userProfilesShouldBeExposedAsActivityStream() throws Exception { + public void userProfileAndBlogShouldBeExposedAsActivityStream() throws Exception { mockMvc.perform(get("/u/ugnich").accept(ActivityObject.CONTENT_TYPE)) .andExpect(status().isOk()) .andExpect(jsonPath("$.@context", is(ActivityObject.CONTEXT_URI))) .andExpect(jsonPath("$.icon", is("http://localhost:8080/i/a/1.png"))); + jdbcTemplate.execute("DELETE FROM messages"); + IntStream.rangeClosed(1, 30).forEach(i -> { + messagesService.createMessage(ugnich.getUid(), String.format("message %d", i), null, null); + }); + mockMvc.perform(get("/u/ugnich/blog").accept(ActivityObject.CONTENT_TYPE)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.first.orderedItems", hasSize(20))) + .andExpect(jsonPath("$.first.next.href", is("http://localhost:8080/u/ugnich/blog?before=11"))); } } |