diff options
author | Vitaly Takmazov | 2018-10-24 15:30:51 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-10-24 15:30:51 +0300 |
commit | 0886b0290dd35b01776856db40e960863f200c68 (patch) | |
tree | 6ff79fcbdd5f9eb56691427cd3c7bd40af6e6a99 /juick-server/src/test | |
parent | 13bf7289cc2dac1897530e6d465bf0a0fef8b3d1 (diff) |
AcitvityPub: render Note using pebble
Diffstat (limited to 'juick-server/src/test')
-rw-r--r-- | juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 18 |
1 files changed, 9 insertions, 9 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 cf189799..8884beef 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 @@ -74,6 +74,7 @@ import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.FileSystemUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -1719,16 +1720,15 @@ public class ServerTests { Note create2 = jsonMapper.readValue(noteStr, Note.class); } @Test - public void activitySerialization() throws JsonProcessingException { - Message msg = new Message(); - msg.setMid(1); - User user = new User(); - user.setName("ugnich"); - msg.setUser(user); - msg.setReplyToUri(URI.create("http://localhost:8080/n/1")); - msg.setTags(Collections.singletonList(new Tag("YO"))); + @Transactional + public void activitySerialization() throws Exception { + Message msg = commandsManager.processCommand(ugnich, "*shit happens", emptyUri).getNewMessage().get(); Note note = activityPubManager.makeNote(msg); String json = jsonMapper.writeValueAsString(Context.build(note)); + Message reply = commandsManager.processCommand(freefd, String.format("#%d HI", msg.getMid()), emptyUri).getNewMessage().get(); + json = jsonMapper.writeValueAsString(Context.build(activityPubManager.makeNote(reply))); + Message msgNoTags = commandsManager.processCommand(ugnich, "people", emptyUri).getNewMessage().get(); + json = jsonMapper.writeValueAsString(Context.build(activityPubManager.makeNote(msgNoTags))); } @Test public void signingSpec() throws IOException { @@ -1765,6 +1765,6 @@ public class ServerTests { int newUserUid = userService.createUser("newuser", "assword"); assertThat(userService.getUserByUID(newUserUid).get().getSeen(), is(nullValue())); messagesService.createMessage(newUserUid, "YO", "", null); - assertThat(userService.getUserByUID(newUserUid).get().getSeen(), greaterThan(now)); + assertThat(userService.getUserByUID(newUserUid).get().getSeen(), greaterThanOrEqualTo(now)); } } |