diff options
author | Vitaly Takmazov | 2018-09-04 13:52:10 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-09-04 13:52:10 +0300 |
commit | a63800dd6c5f8551b7126be6d3557e90888f0703 (patch) | |
tree | d037c0498f3e2f38f6147f20717c27f68353bea5 /juick-server/src/test/java/com/juick/server/tests/ServerTests.java | |
parent | 2f1b853bc35f14ac61038b556d21e1d0190fee8a (diff) |
outbox as OrderedCollection
Diffstat (limited to 'juick-server/src/test/java/com/juick/server/tests/ServerTests.java')
-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 63ba4b3e..a94acc82 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"))); } } |