From 3c415a10bf02d0aabfcad3f50caf6bcaf55eee70 Mon Sep 17 00:00:00 2001
From: Daniel Gerhardt <code@dgerhardt.net>
Date: Thu, 29 Sep 2016 12:20:40 +0200
Subject: [PATCH] Fix tests for Spring Framework 4.3 compatibility

Tests failed because they did not allow a charset parameter in
Content-Type headers.
---
 .../thm/arsnova/controller/StatisticsControllerTest.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/test/java/de/thm/arsnova/controller/StatisticsControllerTest.java b/src/test/java/de/thm/arsnova/controller/StatisticsControllerTest.java
index d2b9f0d97..32fd9dad3 100644
--- a/src/test/java/de/thm/arsnova/controller/StatisticsControllerTest.java
+++ b/src/test/java/de/thm/arsnova/controller/StatisticsControllerTest.java
@@ -64,14 +64,14 @@ public class StatisticsControllerTest {
 	public void testShouldGetCurrentOnlineUsers() throws Exception {
 		mockMvc.perform(get("/statistics/activeusercount").accept(MediaType.TEXT_PLAIN))
 		.andExpect(status().isOk())
-		.andExpect(content().contentType("text/plain"));
+		.andExpect(content().contentTypeCompatibleWith("text/plain"));
 	}
 
 	@Test
 	public void testShouldSendXDeprecatedApiForGetCurrentOnlineUsers() throws Exception {
 		mockMvc.perform(get("/statistics/activeusercount").accept(MediaType.TEXT_PLAIN))
 		.andExpect(status().isOk())
-		.andExpect(content().contentType("text/plain"))
+		.andExpect(content().contentTypeCompatibleWith("text/plain"))
 		.andExpect(header().string(AbstractController.X_DEPRECATED_API,"1"));
 	}
 
@@ -79,7 +79,7 @@ public class StatisticsControllerTest {
 	public void testShouldGetSessionCount() throws Exception {
 		mockMvc.perform(get("/statistics/sessioncount").accept(MediaType.TEXT_PLAIN))
 		.andExpect(status().isOk())
-		.andExpect(content().contentType("text/plain"))
+		.andExpect(content().contentTypeCompatibleWith("text/plain"))
 		.andExpect(content().string("3"));
 	}
 
@@ -87,7 +87,7 @@ public class StatisticsControllerTest {
 	public void testShouldSendXDeprecatedApiForGetSessionCount() throws Exception {
 		mockMvc.perform(get("/statistics/sessioncount").accept(MediaType.TEXT_PLAIN))
 		.andExpect(status().isOk())
-		.andExpect(content().contentType("text/plain"))
+		.andExpect(content().contentTypeCompatibleWith("text/plain"))
 		.andExpect(header().string(AbstractController.X_DEPRECATED_API,"1"));
 	}
 
-- 
GitLab