diff options
Diffstat (limited to 'src/test/java/com/juick/server')
-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); |