diff options
author | Alexander Alexeev | 2016-12-11 00:52:57 +0700 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-11 18:24:37 +0300 |
commit | ac6c86ddd482721e7011dcb727e4099b8cdf84b1 (patch) | |
tree | 233ff85e261037b0949e4aa5105ca0dbcd22e9c4 /juick-api/src/test | |
parent | 5ff660e5f3e73382781f854a0afc350d2ad6d626 (diff) |
anonymous user support
Diffstat (limited to 'juick-api/src/test')
-rw-r--r-- | juick-api/src/test/java/com/juick/api/tests/MessagesTests.java | 7 |
1 files changed, 3 insertions, 4 deletions
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") |