Altering the way of instantiating

1. Altering instantiating

BeanArbitraryIntrospector

Preconditions

  1. No args constructor
  2. Setter

FieldReflectionArbitraryIntrospector

Preconditions

  1. No args constructor

BuilderArbitraryIntrospector

Preconditions

  1. Builder

ConstructorPropertiesIntrospector

Preconditions

Should satisfy one of below preconditions

  • record type
  • lombok @Value, enabled lombok.anyConstructor.addConstructorProperties=true option
  • any constructors with @ConstructorProperties

FactoryMethodArbitraryIntrospector

Preconditions

  • static factory method

PrimaryConstructorArbitraryIntrospector

Preconditions

  1. Kotlin class
  2. Primary constructor.

JacksonArbitraryIntrospector

Preconditions

  1. Adding fixture-monkey-jackson dependency
  2. serializable / deserializable by Jackson

2. Altering objectIntrospector option

FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    .objectIntrospector(selectedIntrospector)
    .build();