Testing Problem
The current implementation of ArbitraryConfiguratorBase makes it super easy to configure a single arbitrary type using multiple annotation types but not vice versa where you might want to configure multiple arbitraries with a single annotation. i.e.
Suppose I have two arbitraries: Arbitrary<Foo> and Arbitrary<Bar> as I have a single annotation rule that can be applied to both. Unfortunately, due to erasure, there's no way to define two configure methods in base to satisfy its current contract:
class FooBarConfigurator extends ArbitraryConfiguratorBase {
Arbitrary<Foo> configure(Arbitrary<Foo> arb, SomeAnnotation ann) { return arb; }
Arbitrary<Bar> configure(Arbitrary<Bar> arb, SomeAnnotation ann) { return arb; } // no good since signatures collide
}
Suggested Solution
I would be keen to explore if jqwik could expand its search for potential config method signatures to include methods with random postfixes. i.e. say this would still be picked up by base as valid:
class FooBarConfigurator extends ArbitraryConfiguratorBase {
Arbitrary<Foo> configureFoo(Arbitrary<Foo> arb, SomeAnnotation ann) { return arb; }
Arbitrary<Bar> configureBar(Arbitrary<Bar> arb, SomeAnnotation ann) { return arb; }
}
Testing Problem
The current implementation of
ArbitraryConfiguratorBasemakes it super easy to configure a single arbitrary type using multiple annotation types but not vice versa where you might want to configure multiple arbitraries with a single annotation. i.e.Suppose I have two arbitraries:
Arbitrary<Foo>andArbitrary<Bar>as I have a single annotation rule that can be applied to both. Unfortunately, due to erasure, there's no way to define two configure methods in base to satisfy its current contract:Suggested Solution
I would be keen to explore if jqwik could expand its search for potential config method signatures to include methods with random postfixes. i.e. say this would still be picked up by base as valid: