Skip to content

Commit e53d008

Browse files
committed
Merge branch '4.0.x'
Closes gh-49016
2 parents f8f1da6 + 53c1f42 commit e53d008

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

module/spring-boot-http-converter/src/main/java/org/springframework/boot/http/converter/autoconfigure/Jackson2HttpMessageConvertersConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package org.springframework.boot.http.converter.autoconfigure;
1818

1919
import com.fasterxml.jackson.databind.ObjectMapper;
20-
import tools.jackson.dataformat.xml.XmlMapper;
20+
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
2121

2222
import org.springframework.boot.autoconfigure.condition.AnyNestedCondition;
2323
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;

module/spring-boot-http-converter/src/test/java/org/springframework/boot/http/converter/autoconfigure/HttpMessageConvertersAutoConfigurationTests.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void jackson2CustomConverter() {
187187
@Test
188188
@Deprecated(since = "4.0.0", forRemoval = true)
189189
@SuppressWarnings("removal")
190-
void jackson2ServerAndClientConvertersShouldBeDifferent() {
190+
void jackson2ServerAndClientJsonConvertersShouldBeDifferent() {
191191
this.contextRunner.withUserConfiguration(Jackson2ObjectMapperConfig.class)
192192
.withInitializer(ConditionEvaluationReportLoggingListener.forLogLevel(LogLevel.INFO))
193193
.run((context) -> {
@@ -201,6 +201,23 @@ void jackson2ServerAndClientConvertersShouldBeDifferent() {
201201
});
202202
}
203203

204+
@Test
205+
@Deprecated(since = "4.0.0", forRemoval = true)
206+
@SuppressWarnings("removal")
207+
void jackson2ServerAndClientXmlConvertersShouldBeDifferent() {
208+
this.contextRunner.withUserConfiguration(Jackson2ObjectMapperConfig.class)
209+
.withInitializer(ConditionEvaluationReportLoggingListener.forLogLevel(LogLevel.INFO))
210+
.run((context) -> {
211+
assertThat(context).hasSingleBean(
212+
Jackson2HttpMessageConvertersConfiguration.Jackson2XmlMessageConvertersCustomizer.class);
213+
HttpMessageConverter<?> serverConverter = findConverter(getServerConverters(context),
214+
org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter.class);
215+
HttpMessageConverter<?> clientConverter = findConverter(getClientConverters(context),
216+
org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter.class);
217+
assertThat(serverConverter).isNotEqualTo(clientConverter);
218+
});
219+
}
220+
204221
@Test
205222
void gsonNotAvailable() {
206223
this.contextRunner.run((context) -> {
@@ -579,8 +596,14 @@ JacksonJsonHttpMessageConverter customJacksonMessageConverter(JsonMapper jsonMap
579596
}
580597

581598
@Configuration(proxyBeanMethods = false)
599+
@SuppressWarnings("removal")
582600
static class Jackson2ObjectMapperConfig {
583601

602+
@Bean
603+
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder objectMapperBuilder() {
604+
return new org.springframework.http.converter.json.Jackson2ObjectMapperBuilder();
605+
}
606+
584607
@Bean
585608
ObjectMapper objectMapper() {
586609
return new ObjectMapper();

0 commit comments

Comments
 (0)