naver / fixture-monkey

Let Fixture Monkey generate test instances including edge cases automatically
https://naver.github.io/fixture-monkey
Apache License 2.0
560 stars 89 forks source link

How to set custom JavaArbitaryResolver #819

Closed esfomeado closed 10 months ago

esfomeado commented 10 months ago

Describe your question

I'm upgrading my project to version 1.0 of Fixture Monkey. We use a custom JavaArbitaryResolver. Before I could set my custom arbitrary on the FixtureMonkey builder but now that doesn't seem possible. How can I do that? Thanks

Edit: Do I need to use the JavaConstraintGenerator instead?

seongahjo commented 10 months ago

@esfomeado Hello.
JavaArbitraryResolver is still available. It is moved in JqwikPlugin.

If you do not have any custom annotations, JavaConstraintGenerator is an option too. It removes a direct dependency from jqwik.

Thank you.

esfomeado commented 10 months ago

Sorry I think you misunderstood my question.

I'm aware that it moved packages but how do I set it on the FixtureMonkeyBuilder?

Thanks

seongahjo commented 10 months ago

@esfomeado You can set the option as shown below. All options related to jqwik have moved as options of JqwikPlugin.

FixtureMonkey.builder()
    .plugin(
        new JqwikPlugin()
            .javaArbitraryResolver()
    )

Thank you 😁

esfomeado commented 10 months ago

Oh I see. Thanks ❤️