diff --git a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/CommonWebTests.java b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/CommonWebTests.java index fe7ba0a35..65cfabe1d 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/CommonWebTests.java +++ b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/CommonWebTests.java @@ -102,7 +102,7 @@ public abstract class CommonWebTests extends AbstractWebIntegrationTests { public void servesHalWhenRequested() throws Exception { mvc.perform(get("/")). // - andExpect(content().contentType(MediaTypes.HAL_JSON)). // + andExpect(content().contentTypeCompatibleWith(MediaTypes.HAL_JSON)). // andExpect(jsonPath("$._links", notNullValue())); } @@ -211,7 +211,7 @@ public abstract class CommonWebTests extends AbstractWebIntegrationTests { accept(ALPS_MEDIA_TYPE)) .// andExpect(status().isOk()).// - andExpect(content().contentType(ALPS_MEDIA_TYPE)); + andExpect(content().contentTypeCompatibleWith(ALPS_MEDIA_TYPE)); } /** diff --git a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/TestMvcClient.java b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/TestMvcClient.java index 99e60b7e8..f5da14dd4 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/TestMvcClient.java +++ b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/TestMvcClient.java @@ -99,7 +99,7 @@ public class TestMvcClient { public MockHttpServletResponse request(String href, MediaType contentType) throws Exception { return mvc.perform(get(href).accept(contentType)). // andExpect(status().isOk()). // - andExpect(content().contentType(contentType)). // + andExpect(content().contentTypeCompatibleWith(contentType)). // andReturn().getResponse(); } @@ -191,6 +191,7 @@ public class TestMvcClient { /** * Follow URL supplied as a string with a specific Accept header. + * * @param href * @param accept * @return diff --git a/spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/jpa/ProfileIntegrationTests.java b/spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/jpa/ProfileIntegrationTests.java index 3a1f33d7e..087da79f0 100644 --- a/spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/jpa/ProfileIntegrationTests.java +++ b/spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/jpa/ProfileIntegrationTests.java @@ -32,7 +32,6 @@ import org.springframework.data.rest.webmvc.RestMediaTypes; import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; import org.springframework.hateoas.Link; import org.springframework.hateoas.LinkDiscoverers; -import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.web.WebAppConfiguration; @@ -115,10 +114,10 @@ public class ProfileIntegrationTests extends AbstractControllerIntegrationTests Link profileLink = client.discoverUnique(peopleLink, ProfileResourceProcessor.PROFILE_REL); client.follow(profileLink, RestMediaTypes.ALPS_JSON).andExpect(status().is2xxSuccessful()) - .andExpect(header().string(HttpHeaders.CONTENT_TYPE, RestMediaTypes.ALPS_JSON_VALUE)); + .andExpect(content().contentTypeCompatibleWith(RestMediaTypes.ALPS_JSON)); client.follow(profileLink, RestMediaTypes.SCHEMA_JSON).andExpect(status().is2xxSuccessful()) - .andExpect(header().string(HttpHeaders.CONTENT_TYPE, RestMediaTypes.SCHEMA_JSON_VALUE)); + .andExpect(content().contentTypeCompatibleWith(RestMediaTypes.SCHEMA_JSON)); } }