diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 0971f6b1..87617cea 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -32,6 +32,7 @@ import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.startsWith; +import static org.hamcrest.collection.IsEmptyCollection.empty; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -2511,7 +2512,8 @@ public class ServerTests { @Test public void invalidMediaTypeTest() throws Exception { - mockMvc.perform(get("/api/messages").header("Accept", "application/xml")).andExpect(status().isBadRequest()) + mockMvc.perform(get("/api/messages") + .header("Accept", "application/xml")).andExpect(status().isBadRequest()) .andExpect(content().string("Invalid media type")); } @@ -2521,4 +2523,14 @@ public class ServerTests { String contextString = jsonMapper.writeValueAsString(context); assertThat(contextString, is("{\"id\":\"http://juick.com/u/ermine\"}")); } + + @Test + public void emptyListForEmptyChatsList() throws Exception { + jdbcTemplate.execute("DELETE FROM pm"); + mockMvc.perform( + get("/api/groups_pms").with(httpBasic(ugnichName, ugnichPassword))) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.pms", empty())); + + } } |