Skip to content

Commit 5844648

Browse files
committed
Upgrade to Servlet 4.0 to align with Spring Framework.
Also, tweak test case to avoid to refer to a field in a Spring class but rather use API to access the value. Changes in Spring Framework 5.3.4 require this as the internal structure of AbstractJackson2HttpMessageConverter changed to support custom ObjectMapper instances per type and media type. Fixes GH-2284.
1 parent b2fe6d3 commit 5844648

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<dependency>
7373
<groupId>javax.servlet</groupId>
7474
<artifactId>javax.servlet-api</artifactId>
75-
<version>3.0.1</version>
75+
<version>4.0.1</version>
7676
<scope>provided</scope>
7777
</dependency>
7878

src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationIntegrationTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.springframework.data.web.XmlBeamHttpMessageConverter;
3333
import org.springframework.http.converter.HttpMessageConverter;
3434
import org.springframework.instrument.classloading.ShadowingClassLoader;
35-
import org.springframework.test.util.ReflectionTestUtils;
3635
import org.springframework.util.ReflectionUtils;
3736
import org.xmlbeam.XBProjector;
3837

@@ -103,7 +102,7 @@ void usesCustomObjectMapper() {
103102
// Converters contains ProjectingJackson2HttpMessageConverter with custom ObjectMapper
104103
assertThat(converters).anySatisfy(converter -> {
105104
assertThat(converter).isInstanceOfSatisfying(ProjectingJackson2HttpMessageConverter.class, __ -> {
106-
assertThat(ReflectionTestUtils.getField(converter, "objectMapper")).isSameAs(SomeConfiguration.MAPPER);
105+
assertThat(__.getObjectMapper()).isSameAs(SomeConfiguration.MAPPER);
107106
});
108107
});
109108

0 commit comments

Comments
 (0)