Skip to main content
Version: v0.6.x

Kotlin

PrimaryConstructorArbitraryIntrospector

1. Altering objectIntrospector option

FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
.plugin(KotlinPlugin())
.build();

JacksonArbitraryIntrospector

Tip

This practice should add extra module because it depends on third-party library Jackson

1. Adding dependency

testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:0.6.12")
<dependency>
<groupId>com.navercorp.fixturemonkey</groupId>
<artifactId>fixture-monkey-jackson</artifactId>
<version>0.6.12</version>
<scope>test</scope>
</dependency>

2. Altering objectIntrospector option

If you have custom ObjectMapper

FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
.plugin(KotlinPlugin())
.plugin(JacksonPlugin(objectMapper))
.build();

If you DON'T have a custom ObjectMapper

FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
.plugin(KotlinPlugin())
.plugin(JacksonPlugin())
.build();