Skip to content
Snippets Groups Projects
Commit 3c415a10 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Fix tests for Spring Framework 4.3 compatibility

Tests failed because they did not allow a charset parameter in
Content-Type headers.
parent 0b0204e9
Branches
Tags
No related merge requests found
...@@ -64,14 +64,14 @@ public class StatisticsControllerTest { ...@@ -64,14 +64,14 @@ public class StatisticsControllerTest {
public void testShouldGetCurrentOnlineUsers() throws Exception { public void testShouldGetCurrentOnlineUsers() throws Exception {
mockMvc.perform(get("/statistics/activeusercount").accept(MediaType.TEXT_PLAIN)) mockMvc.perform(get("/statistics/activeusercount").accept(MediaType.TEXT_PLAIN))
.andExpect(status().isOk()) .andExpect(status().isOk())
.andExpect(content().contentType("text/plain")); .andExpect(content().contentTypeCompatibleWith("text/plain"));
} }
@Test @Test
public void testShouldSendXDeprecatedApiForGetCurrentOnlineUsers() throws Exception { public void testShouldSendXDeprecatedApiForGetCurrentOnlineUsers() throws Exception {
mockMvc.perform(get("/statistics/activeusercount").accept(MediaType.TEXT_PLAIN)) mockMvc.perform(get("/statistics/activeusercount").accept(MediaType.TEXT_PLAIN))
.andExpect(status().isOk()) .andExpect(status().isOk())
.andExpect(content().contentType("text/plain")) .andExpect(content().contentTypeCompatibleWith("text/plain"))
.andExpect(header().string(AbstractController.X_DEPRECATED_API,"1")); .andExpect(header().string(AbstractController.X_DEPRECATED_API,"1"));
} }
...@@ -79,7 +79,7 @@ public class StatisticsControllerTest { ...@@ -79,7 +79,7 @@ public class StatisticsControllerTest {
public void testShouldGetSessionCount() throws Exception { public void testShouldGetSessionCount() throws Exception {
mockMvc.perform(get("/statistics/sessioncount").accept(MediaType.TEXT_PLAIN)) mockMvc.perform(get("/statistics/sessioncount").accept(MediaType.TEXT_PLAIN))
.andExpect(status().isOk()) .andExpect(status().isOk())
.andExpect(content().contentType("text/plain")) .andExpect(content().contentTypeCompatibleWith("text/plain"))
.andExpect(content().string("3")); .andExpect(content().string("3"));
} }
...@@ -87,7 +87,7 @@ public class StatisticsControllerTest { ...@@ -87,7 +87,7 @@ public class StatisticsControllerTest {
public void testShouldSendXDeprecatedApiForGetSessionCount() throws Exception { public void testShouldSendXDeprecatedApiForGetSessionCount() throws Exception {
mockMvc.perform(get("/statistics/sessioncount").accept(MediaType.TEXT_PLAIN)) mockMvc.perform(get("/statistics/sessioncount").accept(MediaType.TEXT_PLAIN))
.andExpect(status().isOk()) .andExpect(status().isOk())
.andExpect(content().contentType("text/plain")) .andExpect(content().contentTypeCompatibleWith("text/plain"))
.andExpect(header().string(AbstractController.X_DEPRECATED_API,"1")); .andExpect(header().string(AbstractController.X_DEPRECATED_API,"1"));
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment