diff options
author | Vitaly Takmazov | 2016-07-11 13:30:37 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-07-11 13:30:37 +0300 |
commit | afadc6521ac2643a389fe11fe6b5863a0e6aa88a (patch) | |
tree | fc7c504a2af39de1848f47ee6e723c28dff1a4f0 /src/test/java/com/juick | |
parent | d6fb4288688294d2f76325f14410db3091fea0fa (diff) |
fix protocol and tests
Diffstat (limited to 'src/test/java/com/juick')
-rw-r--r-- | src/test/java/com/juick/tests/ApiTests.java | 6 |
1 files changed, 4 insertions, 2 deletions
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<User> 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 " |