diff options
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 " |