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
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
it should check the first parameter for a match in parameterRequirements if the current parameter is optional, it should check the items in parameterRequirements until it found a match. the next parameter should start to check with the next item in parameterRequirements after the match. when there a no more parameters to check but there are required parameters invalidate. same when there are more parameters available to check but no more required parameters.
unfourtunately the possibility to flag a required parameter as multiple makes this even more complex...
we definitely need unit tests for the validator. :/
Thanks @dodgex for investigating. I agree, we should definitely create a test suite for the validation API. This could be either a unit test with mocking the javax.model classes, or an integration test which we already have for compile-time tests.
i have played a bit with mockito and mocked the stuff to get tests ready for diffrent variations of validations with the ValidatorParameterHelper. i've created a gist with some very basic tests but it should be possible to test every current kind of validation that the helper offers.
i already talked with @WonderCsabo on hangouts about this solution, but he is not yet sure if that is good to do it that way as this code more or less replaces everything (that is used by the validation helper) with custom logic. if he gets some time he wants to create a testcase using compile-time tests.
@dodgex i definitely do not have time for experimenting with the compile time tests. If the other collaborators say your way is good enough, i will happy to accept a PR with your current test logic.
However, we should fix this bug ASAP, with or without tests.
For example the following validation:
allows this method: