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.

For reference, the PR is located here: 
https://github.com/jenkinsci/datadog-plugin/pull/156

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/2415979d-575e-4033-8b37-fd6686bce140n%40googlegroups.com.

Reply via email to