aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-15 22:11:41 +0300
committerGravatar Vitaly Takmazov2018-04-15 22:11:41 +0300
commit312a462685fce047d4712780ae46f2b910f5d057 (patch)
treebdb37547a6a3d8fc1976f3c9435de26b24310482 /juick-server/src/test/java
parentfa9788960e934d9b78e5968eb2c384254218090a (diff)
jdbc: update lastmessage user column
Diffstat (limited to 'juick-server/src/test/java')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java4
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)