Note that this is not the same issues as in Customized ObjectMapper not used in test, which is about importing a programmatically configured ObjectMapper.
I want to have a single source of truth for the configuration of the ObjectMapper, and the logical place to do that is the spring application.yml
via the spring.jackson
properties. I can't figure out how to apply that configuration though. I'm using a simple @ExtendWith(SpringExtension.class)
annotation on my JUnit5 tests.
I've tried @AutoConfigureJsonTesters
, @Import(JacksonAutoConfiguration.class)
and @ContextConfiguration(classes = JacksonAutoConfiguration.class)
, to no avail.