|
|
|
|
@ -187,7 +187,7 @@ class HttpMessageConvertersAutoConfigurationTests {
@@ -187,7 +187,7 @@ class HttpMessageConvertersAutoConfigurationTests {
|
|
|
|
|
@Test |
|
|
|
|
@Deprecated(since = "4.0.0", forRemoval = true) |
|
|
|
|
@SuppressWarnings("removal") |
|
|
|
|
void jackson2ServerAndClientConvertersShouldBeDifferent() { |
|
|
|
|
void jackson2ServerAndClientJsonConvertersShouldBeDifferent() { |
|
|
|
|
this.contextRunner.withUserConfiguration(Jackson2ObjectMapperConfig.class) |
|
|
|
|
.withInitializer(ConditionEvaluationReportLoggingListener.forLogLevel(LogLevel.INFO)) |
|
|
|
|
.run((context) -> { |
|
|
|
|
@ -201,6 +201,23 @@ class HttpMessageConvertersAutoConfigurationTests {
@@ -201,6 +201,23 @@ class HttpMessageConvertersAutoConfigurationTests {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@Deprecated(since = "4.0.0", forRemoval = true) |
|
|
|
|
@SuppressWarnings("removal") |
|
|
|
|
void jackson2ServerAndClientXmlConvertersShouldBeDifferent() { |
|
|
|
|
this.contextRunner.withUserConfiguration(Jackson2ObjectMapperConfig.class) |
|
|
|
|
.withInitializer(ConditionEvaluationReportLoggingListener.forLogLevel(LogLevel.INFO)) |
|
|
|
|
.run((context) -> { |
|
|
|
|
assertThat(context).hasSingleBean( |
|
|
|
|
Jackson2HttpMessageConvertersConfiguration.Jackson2XmlMessageConvertersCustomizer.class); |
|
|
|
|
HttpMessageConverter<?> serverConverter = findConverter(getServerConverters(context), |
|
|
|
|
org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter.class); |
|
|
|
|
HttpMessageConverter<?> clientConverter = findConverter(getClientConverters(context), |
|
|
|
|
org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter.class); |
|
|
|
|
assertThat(serverConverter).isNotEqualTo(clientConverter); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void gsonNotAvailable() { |
|
|
|
|
this.contextRunner.run((context) -> { |
|
|
|
|
@ -579,8 +596,14 @@ class HttpMessageConvertersAutoConfigurationTests {
@@ -579,8 +596,14 @@ class HttpMessageConvertersAutoConfigurationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Configuration(proxyBeanMethods = false) |
|
|
|
|
@SuppressWarnings("removal") |
|
|
|
|
static class Jackson2ObjectMapperConfig { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder objectMapperBuilder() { |
|
|
|
|
return new org.springframework.http.converter.json.Jackson2ObjectMapperBuilder(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
ObjectMapper objectMapper() { |
|
|
|
|
return new ObjectMapper(); |
|
|
|
|
|