From 8e83a22012c2bee323eeeb3ae1384ac488741ebf Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 23 Oct 2018 17:48:25 +0300 Subject: Last seen --- .../src/test/java/com/juick/server/tests/ServerTests.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'juick-server/src/test/java/com') 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 a6750644..58596850 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 @@ -33,7 +33,6 @@ import com.juick.model.PrivateChats; import com.juick.model.TagStats; import com.juick.server.*; import com.juick.server.api.activity.model.Context; -import com.juick.server.api.activity.model.Key; import com.juick.server.api.activity.model.Note; import com.juick.server.api.activity.model.Person; import com.juick.server.api.activity.model.activities.Create; @@ -159,8 +158,6 @@ public class ServerTests { @Inject private ObjectMapper jsonMapper; @Inject - private WebApplicationContext wac; - @Inject private XMPPServer server; @Inject private CommandsManager commandsManager; @@ -1745,4 +1742,12 @@ public class ServerTests { PrivateChats chats = jsonMapper.readValue(result.getResponse().getContentAsString(), PrivateChats.class); assertThat(chats.getUsers().size(), is(1)); } + @Test + public void seenTests() { + Instant now = Instant.now(); + 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)); + } } -- cgit v1.2.3