From 9241901c9367259eebf1128c0693f9bc3f3597a5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 27 Nov 2016 19:57:28 +0300 Subject: juick-api: add hash-based authentication filter --- juick-api/src/test/java/com/juick/api/tests/MessagesTests.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'juick-api/src/test/java/com/juick/api') diff --git a/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java b/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java index 6996adb9..0b16ae7f 100644 --- a/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java +++ b/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java @@ -6,6 +6,7 @@ import com.juick.User; import com.juick.api.configuration.ApiAppConfiguration; import com.juick.api.configuration.ApiMvcConfiguration; import com.juick.api.configuration.ApiSecurityConfig; +import com.juick.api.configuration.JuickHashFilter; import com.juick.configuration.DataConfiguration; import com.juick.service.MessagesService; import com.juick.service.UserService; @@ -118,7 +119,9 @@ public class MessagesTests { .andExpect(jsonPath("$[0].body", is(msgText))); String hash = RandomStringUtils.random(16); when(userService.getHashByUID(1)).thenReturn(hash); - mockMvc.perform(get("/messages") + when(userService.getUserByHash(hash)).thenReturn(user); + when(userService.getUIDbyHash(hash)).thenReturn(1); + mockMvc.perform(get("/home") .param("hash", hash)) .andExpect(status().isOk()); } -- cgit v1.2.3