From a63800dd6c5f8551b7126be6d3557e90888f0703 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 4 Sep 2018 13:52:10 +0300 Subject: outbox as OrderedCollection --- .../src/test/java/com/juick/server/tests/ServerTests.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'juick-server/src/test') 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"))); } } -- cgit v1.2.3