Class WithObjectMapper.WithObjectMapperBuilder
java.lang.Object
fr.ght1pc9kc.testy.core.extensions.WithObjectMapper.WithObjectMapperBuilder
- Enclosing class:
WithObjectMapper
Allow to build a more complex ObjectMapper with
Module and Mixin
Usage :
@RegisterExtension
WithObjectMapper wMapper = WithObjectMapper.builder()
.dontFindAndRegisterModules()
.addModule(new ParameterNamesModule())
.addModule(new JSR310Module())
.addMixin(Dummy.class, DummyMixin.class)
.build();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRegister Mixin to theObjectMapperaddModule(com.fasterxml.jackson.databind.Module module) Register specificModuleto ObjectMapperaddModules(Collection<com.fasterxml.jackson.databind.Module> modules) Register multipleModules at the same timebuild()Build the Object Mapper junit extensionAvoid looking for Modules in classpath and register there
-
Constructor Details
-
WithObjectMapperBuilder
public WithObjectMapperBuilder()
-
-
Method Details
-
dontFindAndRegisterModules
Avoid looking for Modules in classpath and register there- Returns:
- the builder
-
addModule
public WithObjectMapper.WithObjectMapperBuilder addModule(com.fasterxml.jackson.databind.Module module) Register specificModuleto ObjectMapper- Parameters:
module- The Module to register- Returns:
- the builder
-
addModules
public WithObjectMapper.WithObjectMapperBuilder addModules(Collection<com.fasterxml.jackson.databind.Module> modules) Register multipleModules 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 classe- Returns:
- the builder
-
build
Build the Object Mapper junit extension- Returns:
- The extension
-