From 17fa861b4426018062c509ded6897b8d37a6f59a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 25 Nov 2018 18:50:24 +0300 Subject: Signup API --- src/test/java/com/juick/server/tests/ServerTests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test') 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")); + } } -- cgit v1.2.3