Skip to content

Commit 080a2f5

Browse files
committed
Align with Framework’s removal of charset attribute from application/json
Closes gh-16979
1 parent 892e517 commit 080a2f5

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ public void cloudfoundryapplicationProducesActuatorMediaType() throws Exception
110110
"vcap.application.cf_api:https://my-cloud-controller.com")
111111
.run((context) -> {
112112
MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
113-
mockMvc.perform(get("/cloudfoundryapplication"))
114-
.andExpect(header().string("Content-Type",
115-
ActuatorMediaType.V2_JSON + ";charset=UTF-8"));
113+
mockMvc.perform(get("/cloudfoundryapplication")).andExpect(
114+
header().string("Content-Type", ActuatorMediaType.V2_JSON));
116115
});
117116
}
118117

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public class WebMvcTestHateoasIntegrationTests {
4444

4545
@Test
4646
public void plainResponse() throws Exception {
47-
this.mockMvc.perform(get("/hateoas/plain")).andExpect(header()
48-
.string(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8"));
47+
this.mockMvc.perform(get("/hateoas/plain"))
48+
.andExpect(header().string(HttpHeaders.CONTENT_TYPE, "application/json"));
4949
}
5050

5151
@Test

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void producesJsonWhenXmlIsPreferred() {
5656
HttpMethod.GET, request, String.class);
5757
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
5858
assertThat(response.getHeaders().getContentType())
59-
.isEqualTo(MediaType.parseMediaType("application/json;charset=UTF-8"));
59+
.isEqualTo(MediaType.parseMediaType("application/json"));
6060
}
6161

6262
}

0 commit comments

Comments
 (0)