From 312a462685fce047d4712780ae46f2b910f5d057 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 15 Apr 2018 22:11:41 +0300 Subject: jdbc: update lastmessage user column --- juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-server') 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) -- cgit v1.2.3