-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(test): improve QueryValidator
testing strategy
#3731
Comments
This issue is stale because it has been open for 14 days with no activity. |
This issue is stale because it has been open for 14 days with no activity. |
Hello, Can I take this issue? Thanks! |
sure, I assigned it to you |
@ndr-brt Thanks! |
Hello @ndr-brt, Just checking to see whether I am on the right track for the issue. As far as I understood the issue it is needed to create a Mock objects of QueryValidator in the "*Service" classes in order to test whether the methods from the Services classes are reacted as expected when the QueryValidator either fails or succeeds during the validation, this is one thing. The other thing is to, possibly, extract the methods from the Service classes which are testing the actual usage of the QueryValidator in a separated "Integration" test. Please, correct me if I did not get the issue correct. |
@enchobelezirev the
and its behavior is tested in the test service class (e.g. As reported in the issue, the service test should verify the interaction with the Then those validator tests should be moved in a separate place, a good approach could be to have a QueryValidatorFactory that creates instances for different services and some tests that verifies the object created behave in the expected way |
I did it without the Factory because I thought that the way of creation of QueryValidator should not be changed. If you do not like it, I will change it. Thanks for the support! :) |
Feature Request
Currently the
QueryValidator
is tested integrated within the services, that's not a great approach.It would be better to separate the responsibility (test the behavior in the validator test and the interaction in the service test)
Which Areas Would Be Affected?
tests
Why Is the Feature Desired?
avoid unnecessary integration tests
Solution Proposal
If possible, provide a (brief!) solution proposal.
The text was updated successfully, but these errors were encountered: