Features

Fixture monkey supports Jackson with the Fixture Monkey Jackson plugin.

  • Supports the use of JacksonObjectArbitraryIntrospector as the default introspector to create objects using the Jackson object mapper.
  • Supports Jackson Annotations such as, @JsonIgnore, @JsonProperty

Dependencies

Gradle

testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.0.23")

Maven

<dependency>
  <groupId>com.navercorp.fixturemonkey</groupId>
  <artifactId>fixture-monkey-jackson</artifactId>
  <version>1.0.23</version>
  <scope>test</scope>
</dependency>

Plugin

FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    .plugin(new JacksonPlugin())
    .build();
val fixtureMonkey = FixtureMonkey.builder()
    .plugin(JacksonPlugin())
    .build()

Pass the object mapper to the JacksonPlugin constructor if you are using Jackson with a custom object mapper.

ObjectMapper objectMapper = JsonMapper.builder()
    .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
    .build()

FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    .plugin(new JacksonPlugin(objectMapper))
    .build();
val objectMapper = JsonMapper.builder()
    .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
    .build()

val fixtureMonkey = FixtureMonkey.builder()
    .plugin(JacksonPlugin(objectMapper))
    .build()