You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding is that the JakartaValidationPlugin reads the settings in the validation annotation and creates a fixture object with values that match the settings.
This is not exact, but the way I understand the above logic to work is as follows.
Create a fixture object
Validate that the field in the fixture object has a value assigned to it that meets the validation annotation conditions
Return the Fixture object if validation succeeds for all fields, otherwise recreate the Fixture object
It seems to be repeating the process of creating an object by first filling the fields with random values and then validating that the object is valid, rather than filling the fields with the validated values from the beginning.
So, I think if we can, it would be better to create the object when all the fields of the object have values that satisfy the conditions.
Of course, since Fixture Monkey uses the logic of the hibernate validator, in some ways I think creating an object and running the validation logic is a natural and much more common implementation.
I'm curious about the design history or opinions of the maintainer on this.
The text was updated successfully, but these errors were encountered:
@doljae
Hello, I think the bug causes the misunderstanding.
Fixture Monkey works as follows.
It seems to be repeating the process of creating an object by first filling the fields with random values and then validating that the object is valid, rather than filling the fields with the validated values from the beginning.
Fixture Monkey has two logical flows to satisfy the validation.
Repeat to generate a value within each property that satisfies the condition constraints given by the validation annotation.
Repeat to generate an instance until validated by the validator(ex, Hibernate Validator).
For better understanding, you can check the classes below.
Describe your question
My understanding is that the
JakartaValidationPlugin
reads the settings in the validation annotation and creates a fixture object with values that match the settings.This is not exact, but the way I understand the above logic to work is as follows.
It seems to be repeating the process of creating an object by first filling the fields with random values and then validating that the object is valid, rather than filling the fields with the validated values from the beginning.
So, I think if we can, it would be better to create the object when all the fields of the object have values that satisfy the conditions.
Of course, since Fixture Monkey uses the logic of the hibernate validator, in some ways I think creating an object and running the validation logic is a natural and much more common implementation.
I'm curious about the design history or opinions of the maintainer on this.
The text was updated successfully, but these errors were encountered: