Skip to content

NIFI-15999 Added Mockito as an agent to thereby not have Mockito self-attach to enable the inline-mock-maker.#95

Merged
exceptionfactory merged 4 commits into
mainfrom
NIFI-15999
Jul 7, 2026
Merged

NIFI-15999 Added Mockito as an agent to thereby not have Mockito self-attach to enable the inline-mock-maker.#95
exceptionfactory merged 4 commits into
mainfrom
NIFI-15999

Conversation

@dan-s1

@dan-s1 dan-s1 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

NIFI-15999

Added Mockito as an agent to the nifi-api build 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

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

@exceptionfactory exceptionfactory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dan-s1

dan-s1 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@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 exceptionfactory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dan-s1, I recommend adding a couple short comments to highlight the purpose of each plugin configuration.

Comment thread pom.xml Outdated
Comment thread pom.xml
Comment thread pom.xml

@exceptionfactory exceptionfactory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the adjustments, the latest version looks good!

@exceptionfactory exceptionfactory merged commit 0d4d6c6 into main Jul 7, 2026
2 checks passed
@dan-s1

dan-s1 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@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 maven-dependency-plugin ignoredDependencies.

@exceptionfactory

Copy link
Copy Markdown
Contributor

@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 maven-dependency-plugin ignoredDependencies.

If the warning is not present on the primary repository, then the existing ignoredDependencies approach seems sufficient for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants