diff options
Diffstat (limited to 'juick-server/src/test/java')
-rw-r--r-- | juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 4 |
1 files changed, 4 insertions, 0 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 1acc0c15..d09a509d 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 @@ -606,6 +606,8 @@ public class ServerTests { assertTrue(yoyoMsg.getNewMessage().isPresent()); assertThat(yoyoMsg.getNewMessage().get().getTags().get(0), is(yo)); int mid = yoyoMsg.getNewMessage().get().getMid(); + Timestamp last = jdbcTemplate.queryForObject("SELECT lastmessage FROM users WHERE id=?", Timestamp.class, user.getUid()); + assertThat(last.toInstant(), equalTo(yoyoMsg.getNewMessage().get().getTimestamp())); assertEquals("should be message", true, commandsManager.processCommand(user, String.format("#%d", mid), emptyUri).getText().startsWith("@me")); int readerUid = userService.createUser("dummyReader", "dummySecret"); @@ -643,6 +645,8 @@ public class ServerTests { URI.create("http://static.juick.com/settings/facebook.png")).getText()); Message reply = messagesService.getReplies(user, mid).stream().filter(m -> m.getRid() == 3).findFirst() .orElse(new Message()); + Timestamp lastreply = jdbcTemplate.queryForObject("SELECT lastmessage FROM users WHERE id=?", Timestamp.class, user.getUid()); + assertThat(lastreply.toInstant(), equalTo(reply.getTimestamp())); assertEquals("should be reply to second comment", 2, reply.getReplyto()); assertEquals("tags should NOT be updated", "It is not your message", commandsManager.processCommand(readerUser, "#" + mid + " *yo *there", emptyUri) |