NIFI-15999 Added Mockito as an agent to thereby not have Mockito self-attach to enable the inline-mock-maker. - #95
Conversation
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for proposing this adjustment @dan-s1.
The maven-dependency-plugin configuration copies the mockito-core.jar into a build directory, but the maven-surefire-plugin does not use that reference file, so it is not clear why the copy is necessary.
|
@exceptionfactory Please refer to the Stackoverflow post I referenced in the description. The comment by Saee Saadat (last one in the post) describes that is needed for the IDE to see it. Otherwise when you run the unit tests in the IDE, you will see the Mockito warning. |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks @dan-s1, I recommend adding a couple short comments to highlight the purpose of each plugin configuration.
…-attach to enable the inline-mock-maker.
… in IDE without the warning message.
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for making the adjustments, the latest version looks good!
|
@exceptionfactory Thank you for merging this PR. Should the same fix be done on the NIFI code base? Currently the Mockito warning I believe is not present as it is suppressed with |
If the warning is not present on the primary repository, then the existing ignoredDependencies approach seems sufficient for now. |
|
@exceptionfactory I agree with you for the Maven build that is sufficient, but when running the tests individually in an IDE (e.g. Intellij), the warnings are displayed there. I have been running a bunch of unit tests individually in Intellij and I am seeing the warning when Mockito is used. Is that something we should take care of or not? |
In general, avoiding such warnings is preferable, but it depends on the nature and scope of changes required. |
|
I was thinking along the same lines as the fix made for this PR. Would that make sense? |
Yes, that sounds reasonable |
Summary
NIFI-15999
Added Mockito as an agent to the
nifi-apibuild as described in the following Stackoverflow post and did not use the suggestion Mockito has in their documentation , since the warning is still present when running tests in an IDE (Intellij) without Maven.Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranch