diff options
author | Vitaly Takmazov | 2016-05-19 23:24:22 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-05-19 23:24:22 +0300 |
commit | 7fb8cdfb02c24c265a081499c858f3aca1efbb2b (patch) | |
tree | 87f8764cf0baf4d3dc6de7b2d19fda827a16b1cb /src/test/java/com/juick/tests/ApiTests.java | |
parent | ce8cef088e7fa1b31a5aa59bb3111600863bc432 (diff) |
update server api and try to fix anonymous chats
Diffstat (limited to 'src/test/java/com/juick/tests/ApiTests.java')
-rw-r--r-- | src/test/java/com/juick/tests/ApiTests.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/java/com/juick/tests/ApiTests.java b/src/test/java/com/juick/tests/ApiTests.java index 5bd90509..2bae183d 100644 --- a/src/test/java/com/juick/tests/ApiTests.java +++ b/src/test/java/com/juick/tests/ApiTests.java @@ -94,7 +94,7 @@ public class ApiTests { @Test public void messageTests() { int user_id = UserQueries.createUser(jdbc, "me", "secret"); - User user = UserQueries.getUserByUID(jdbc, user_id); + User user = UserQueries.getUserByUID(jdbc, user_id).orElse(new User()); Assert.assertEquals("it should be me", "me", user.getUName()); int mid = MessagesQueries.createMessage(jdbc, user_id, "yo", null, new ArrayList<>()); Message msg = MessagesQueries.getMessage(jdbc, mid); @@ -113,7 +113,7 @@ public class ApiTests { Message msg2 = MessagesQueries.getMessage(jdbc, mid2); org.junit.Assert.assertEquals(1, msg2.Tags.size()); int ugnich_id = UserQueries.createUser(jdbc, "ugnich", "x"); - User ugnich = UserQueries.getUserByUID(jdbc, ugnich_id); + User ugnich = UserQueries.getUserByUID(jdbc, ugnich_id).orElse(new User()); int rid = MessagesQueries.createReply(jdbc, msg2.getMID(), 0, ugnich.getUID(), "bla-bla", null); org.junit.Assert.assertEquals(1, rid); Message msg3 = MessagesQueries.getMessage(jdbc, mid2); |