-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
NIFI-11873 Refactored PeerSelectorTest from Groovy to Java. #7634
Conversation
…the Groovy mock objects with Mockito mocks and changed scope of certain variables and methods in PeerSelector from private to package private in order to allow access by PeerSelectorTest.
@exceptionfactory 21/22 of the unit tests pass. There is one test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this refactoring @dan-s1. Unfortunately the Groovy-based test included a number of access violations for calling private methods. It would be much better to avoid the method visibility changes solely for the purpose of maintaining these tests. That may mean some tests need to be removed or rewritten completely. This is one of the more complicated classes, so that may also point to the need for other refactoring, as a first step, I recommend making adjustment to avoid visibility changes. If that presents too much difficulty, it may be better to close and revisit later.
I realize that I recommended changing the visibility of one method when commenting on the Jira, but I did not expect it to be necessary for so many methods. |
I did not realize either. I worked off your original comment thinking it would be okay for the others. Aside from variables I am not sure how I would not reduce the scope of the methods whose scope had to change. I am not sure I understand everything going on in |
Thanks for your work on it, it may be a helpful background for someone else to take it up. If there are any tests that can be migrated without method visibility changes, that would might be a helpful starting point for a new Java-based test class. Then subsequent work could handle refactoring the remaining tests. |
Should I close the ticket or just have the ticket no longer assigned to me? Also should I add you comments regarding the visibility issues to the ticket so others will know what to be aware of? |
The ticket should be kept open, but you can unassign yourself. The pull request comments are automatically mirrored to the Jira issue. |
Thanks again for your work on this pull request @dan-s1. I am closing it for now, but it will be linked in the Jira issue for future reference. |
Refactored PeerSelectorTest from Groovy to Java. Replaced the Groovy mock objects with Mockito mocks and changed scope of certain variables and methods in PeerSelector from private to package private in order to allow access by PeerSelectorTest.
Summary
NIFI-11873
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000
NIFI-00000
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation