From ac6c86ddd482721e7011dcb727e4099b8cdf84b1 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Sun, 11 Dec 2016 00:52:57 +0700 Subject: anonymous user support --- juick-api/src/test/java/com/juick/api/tests/MessagesTests.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'juick-api/src/test/java/com/juick/api/tests/MessagesTests.java') 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 9f74c00d..2a5dba18 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 @@ -36,9 +36,7 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.when; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** @@ -156,7 +154,6 @@ public class MessagesTests { Message msg = getMessage(ugnich, msgText); - when(messagesService.getMyFeed(1, 0)) .thenReturn(Collections.singletonList(1)); when(messagesService.getMessages(Collections.singletonList(1))) @@ -263,6 +260,7 @@ public class MessagesTests { .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$", hasSize(2))); } + @Test public void tags() throws Exception { Tag weather = new Tag("weather"); @@ -284,6 +282,7 @@ public class MessagesTests { .andExpect(jsonPath("$", hasSize(1))) .andExpect(jsonPath("$[0].messages", is(5))); } + @Test public void postWithReferer() throws Exception { mockMvc.perform(post("/post") -- cgit v1.2.3