Unit test documentation at https://wiki.jenkins-ci.org/display/JENKINS/Unit+Test says:
----------------------------
@WithPlugin(NameOfPlugin)
Installs the specified plugin before launching Jenkins in the test. For now, this has to be one of the plugins statically available in resources "/plugins/NAME".
----------------------------
It's not clear where the plugin has to be put, what should be the plugin file naming convention, and what should be put into NameOfPlugin parameter.
I suggest the following instead:
----------------------------
@WithPlugin(NameOfPluginFile)
Installs the specified plugin before launching Jenkins in the test. For now, this has to be one of the plugins statically available in resources "/plugins/NameOfPluginFile". Plugin should be packed as JPI or HPI.
Example: to install the plugin "my-plugin" before test, put my-plugin.hpi into plugins resource folder (e.g., src/test/plugins/my-plugin.hpi) and add annotation @WithPlugin("my-plugin.hpi") to your test.
----------------------------