PluginJarProcessor { void loadPlugins() throws IOException { removeAllPlugins(); final File pluginsRoot = new File(pluginsDir); if (pluginsRoot.exists()) { Collection<File> deployedPlugins = FileUtils.listFiles(pluginsRoot, new String[]{"jar"}, false); deployedPlugins.forEach(p -> loadPlugins(Paths.get(p.getAbsolutePath()), false)); } } @Inject  PluginJarProcessor(@Any Instance<PluginProcessor> pluginProcessors,
                              final Event<PluginReloadedEvent> pluginsReloadedEvent); void init(final String pluginsDir,
                     final String pluginsDeploymentDir); void reload(); void loadPlugins(Path path,
                            boolean notifyClients);  }
@Test public void loadPlugins() throws Exception { Path path = mock(Path.class); when(path.toFile()).thenReturn(mock(File.class)); when(htmlPluginProcessor.shouldProcess("dora.html")).thenReturn(true); pluginJarProcessor.loadPlugins(path, true); verify(htmlPluginProcessor, times(1)).process(eq("dora.html"), any(), eq(true)); }