Describe the bug
thenApply is executed after an Object is built and validated using JavaxValidationPlugin resulting in ValidationFailedException. There is no way to customize the random generated object to match with complex custom constraints that span multiple fields of the Object unless specific individual fields are explicitly defined in builder to ensure Object will match custom constraint.
I have also tried setPostCondition but this is also invoked only after a successful validation.
I expect that setPostCondition, map, customizeProperty, thenApply etc are executed before the sample Object is validated against constraints.
Your environment
- version of Fixture Monkey: 1.1.14
- version of Java/Kotlin: JDK 21
Steps to reproduce
- Configure FM with JavaxValidationPlugin
- Configure FM with maxRetries 3
- Define an object with a custom constraint that depends on 2 or more fields
- Configure FMBuilder for the object with thenApply() to customize the random generated object to match custom constraint.
- Build a sample of the object
Expected behaviour
Tell us what should happen
Expect a valid object on all occurrences
Actual behaviour
ValidationFailedException on some occurrences
Describe the bug
thenApply is executed after an Object is built and validated using JavaxValidationPlugin resulting in ValidationFailedException. There is no way to customize the random generated object to match with complex custom constraints that span multiple fields of the Object unless specific individual fields are explicitly defined in builder to ensure Object will match custom constraint.
I have also tried setPostCondition but this is also invoked only after a successful validation.
I expect that setPostCondition, map, customizeProperty, thenApply etc are executed before the sample Object is validated against constraints.
Your environment
Steps to reproduce
Expected behaviour
Tell us what should happen
Expect a valid object on all occurrences
Actual behaviour
ValidationFailedException on some occurrences