From 70a50b2252ed313e3aee1a9ee2f33be8a46cb028 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 1 Mar 2018 19:18:03 +0300 Subject: sort discussions by last replay date --- .../src/test/java/com/juick/service/MessageServiceTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-server-jdbc/src/test/java/com') diff --git a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java index bdb9cdcb..4ebfe056 100644 --- a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java +++ b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java @@ -35,6 +35,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.inject.Inject; import java.sql.Timestamp; import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -164,6 +166,8 @@ public class MessageServiceTest extends AbstractJUnit4SpringContextTests { assertEquals(-1, userService.checkPassword(ugnich.getName(), "xy")); subscriptionService.subscribeMessage(msg.getMid(), ugnich.getUid()); assertEquals(1, subscriptionService.getUsersSubscribedToComments(msg.getMid(), user.getUid()).size()); + assertThat(messagesService.getDiscussions(ugnich.getUid(), Instant.now().toEpochMilli()).get(0), + equalTo(msg.getMid())); messagesService.deleteMessage(user_id, mid); messagesService.deleteMessage(user_id, mid2); String htmlTagName = ">_<"; -- cgit v1.2.3