diff options
author | Vitaly Takmazov | 2020-05-21 12:10:32 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-05-21 12:12:08 +0300 |
commit | b550d376b0f62bbe914da26500524acf5be22494 (patch) | |
tree | 048ac409c6a17f5998433d627668a16c5fd0f9bc /src/test/java | |
parent | deef9ad990c3f5902b1556edbf93dabf223ac175 (diff) |
Show correct signup errors
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 51e17ecc..aad85884 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -381,7 +381,10 @@ public class ServerTests { int mid2 = messagesService.createMessage(user.getUid(), "yo2", null, tagList); Message msg2 = messagesService.getMessage(mid2).get(); assertEquals(1, msg2.getTags().size()); - assertEquals("we already have ugnich", Optional.empty(), userService.createUser("ugnich", "x")); + Exception exc = assertThrows(UsernameTakenException.class, () -> { + userService.createUser("ugnich", "x"); + }); + assertEquals("Username taken", exc.getMessage()); User hugnich = userService.createUser("hugnich", "x").orElseThrow(IllegalStateException::new); int rid = messagesService.createReply(msg2.getMid(), 0, hugnich, "bla-bla", null); assertEquals(1, rid); |