From afadc6521ac2643a389fe11fe6b5863a0e6aa88a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 11 Jul 2016 13:30:37 +0300 Subject: fix protocol and tests --- src/test/java/com/juick/tests/ApiTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/test/java/com/juick') diff --git a/src/test/java/com/juick/tests/ApiTests.java b/src/test/java/com/juick/tests/ApiTests.java index 5f919c76..5c6cddf3 100644 --- a/src/test/java/com/juick/tests/ApiTests.java +++ b/src/test/java/com/juick/tests/ApiTests.java @@ -95,6 +95,7 @@ public class ApiTests { String baseUri = "http://localhost/"; JuickProtocol protocol = new JuickProtocol(jdbc, baseUri); MessageSerializer json = new MessageSerializer(); + assertEquals("juick user should have uid 2", 2, UserQueries.getUIDbyName(jdbc, "juick")); int uid = UserQueries.createUser(jdbc, "me", "secret"); User user = UserQueries.getUserByUID(jdbc, uid).orElse(new User()); String expectedMessage = "New message posted"; @@ -115,8 +116,9 @@ public class ApiTests { SubscriptionsQueries.getUsersSubscribedToComments(jdbc, mid, uid).size()); assertEquals("should be subscribed", "Subscribed", protocol.getReply(readerUser, "S @" + user.getUName()).getDescription()); - /*assertEquals("number of friend users should match", 2, - UserQueries.getUserFriends(jdbc, readerUid).size());*/ + List friends = UserQueries.getUserFriends(jdbc, readerUid); + assertEquals("number of friend users should match", 2, + friends.size()); assertEquals("number of reader users should match", 1, UserQueries.getUserReaders(jdbc, uid).size()); String expectedReply = "Reply posted.\n#" + mid + "/1 " -- cgit v1.2.3