diff options
author | Vitaly Takmazov | 2018-11-25 18:50:24 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-11-25 18:50:24 +0300 |
commit | 17fa861b4426018062c509ded6897b8d37a6f59a (patch) | |
tree | 48235e237f10829c842e3bfb2f69b641085b55ae /src/test/java | |
parent | a9909e0faca387dd0bf54bce2341a1769513e59e (diff) |
Signup API
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 0abce093..4b0de65d 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1799,4 +1799,14 @@ public class ServerTests { messagesService.createMessage(newUserUid, "YO", "", null); assertThat(userService.getUserByUID(newUserUid).get().getSeen(), greaterThanOrEqualTo(now)); } + @Test + public void signupTest() throws Exception { + emailService.addVerificationCode(null, "demo@email.com", "123456"); + MvcResult result = mockMvc.perform(post("/api/signup") + .param("username", "testuser") + .param("password", "demopassword") + .param("verificationCode", "123456")).andExpect(status().isOk()).andReturn(); + com.juick.User testuser = jsonMapper.readValue(result.getResponse().getContentAsString(), User.class); + assertThat(testuser.getName(), is("testuser")); + } } |