Class WithJsonMapper.WithJsonMapperBuilder
java.lang.Object
fr.ght1pc9kc.testy.core.extensions.WithJsonMapper.WithJsonMapperBuilder
- Enclosing class:
WithJsonMapper
Allow to build a more complex ObjectMapper with
Module and Mixin
Usage :
@RegisterExtension
WithJsonMapper wMapper = WithJsonMapper.builder()
.dontFindAndRegisterModules()
.addMixin(Dummy.class, DummyMixin.class)
.build();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRegister Mixin to theObjectMapperaddModule(tools.jackson.databind.JacksonModule module) Register specificModuleto ObjectMapperaddModules(Collection<tools.jackson.databind.JacksonModule> modules) Register multipleJacksonModules at the same timebuild()Build the Object Mapper junit extensionAvoid looking for Modules in classpath and register there
-
Constructor Details
-
WithJsonMapperBuilder
public WithJsonMapperBuilder()
-
-
Method Details
-
dontFindAndRegisterModules
Avoid looking for Modules in classpath and register there- Returns:
- the builder
-
addModule
Register specificModuleto ObjectMapper- Parameters:
module- The Module to register- Returns:
- the builder
-
addModules
public WithJsonMapper.WithJsonMapperBuilder addModules(Collection<tools.jackson.databind.JacksonModule> modules) Register multipleJacksonModules at the same time- Parameters:
modules- The collection of Modules to register- Returns:
- the builder
-
addMixin
Register Mixin to theObjectMapper- Parameters:
entityClass- The entity classmixinClass- The Mixin class- Returns:
- the builder
-
build
Build the Object Mapper junit extension- Returns:
- The extension
-