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.
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -72,7 +72,7 @@
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>4.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.springframework.data.web.ProjectingJackson2HttpMessageConverter;
|
||||
import org.springframework.data.web.XmlBeamHttpMessageConverter;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.instrument.classloading.ShadowingClassLoader;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.xmlbeam.XBProjector;
|
||||
|
||||
@@ -103,7 +102,7 @@ class SpringDataWebConfigurationIntegrationTests {
|
||||
// Converters contains ProjectingJackson2HttpMessageConverter with custom ObjectMapper
|
||||
assertThat(converters).anySatisfy(converter -> {
|
||||
assertThat(converter).isInstanceOfSatisfying(ProjectingJackson2HttpMessageConverter.class, __ -> {
|
||||
assertThat(ReflectionTestUtils.getField(converter, "objectMapper")).isSameAs(SomeConfiguration.MAPPER);
|
||||
assertThat(__.getObjectMapper()).isSameAs(SomeConfiguration.MAPPER);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user