Browse Source

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

Closes gh-16979
pull/16984/head
Andy Wilkinson 7 years ago
parent
commit
080a2f5c3b
  1. 5
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java
  2. 4
      spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestHateoasIntegrationTests.java
  3. 2
      spring-boot-samples/spring-boot-sample-hateoas/src/test/java/sample/hateoas/SampleHateoasApplicationTests.java

5
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java

@ -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"));
}); });
} }

4
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestHateoasIntegrationTests.java

@ -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

2
spring-boot-samples/spring-boot-sample-hateoas/src/test/java/sample/hateoas/SampleHateoasApplicationTests.java

@ -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"));
} }
} }

Loading…
Cancel
Save