Align with Framework’s removal of charset attribute from application/json

Closes gh-16979
This commit is contained in:
Andy Wilkinson
2019-05-28 10:58:23 +01:00
parent 892e517c21
commit 080a2f5c3b
3 changed files with 5 additions and 6 deletions

View File

@@ -110,9 +110,8 @@ public class CloudFoundryActuatorAutoConfigurationTests {
"vcap.application.cf_api:https://my-cloud-controller.com") "vcap.application.cf_api:https://my-cloud-controller.com")
.run((context) -> { .run((context) -> {
MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(context).build(); MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
mockMvc.perform(get("/cloudfoundryapplication")) mockMvc.perform(get("/cloudfoundryapplication")).andExpect(
.andExpect(header().string("Content-Type", header().string("Content-Type", ActuatorMediaType.V2_JSON));
ActuatorMediaType.V2_JSON + ";charset=UTF-8"));
}); });
} }

View File

@@ -44,8 +44,8 @@ public class WebMvcTestHateoasIntegrationTests {
@Test @Test
public void plainResponse() throws Exception { public void plainResponse() throws Exception {
this.mockMvc.perform(get("/hateoas/plain")).andExpect(header() this.mockMvc.perform(get("/hateoas/plain"))
.string(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8")); .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "application/json"));
} }
@Test @Test

View File

@@ -56,7 +56,7 @@ class SampleHateoasApplicationTests {
HttpMethod.GET, request, String.class); HttpMethod.GET, request, String.class);
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(response.getHeaders().getContentType()) assertThat(response.getHeaders().getContentType())
.isEqualTo(MediaType.parseMediaType("application/json;charset=UTF-8")); .isEqualTo(MediaType.parseMediaType("application/json"));
} }
} }