Hi all,
I'm trying to write some tests for some changes I made
to the datadog plugin at the request of the maintainer. The tests should
ideally mock the PluginManager that JenkinsRule uses as I'm trying to
test that the code is returning certain numbers based on what plugins
are installed (e.g. active, inactive, updatable plugins etc)..
The problem however is that I am unable toset the plugin manager when trying to mock it. I've tried using new
JenkinsRule().with(mock(PluginManager.class)), but this seemed to cause
issues in the rest of the code, setting the plugin manager in any other
way complains that the plugin manager is already set.
Thanks