PluginManager { public void init(final String contextRootDir, final String pluginDir) { try { pluginJarProcessor.init(pluginDir, findPluginDeploymentDir(contextRootDir)); pluginWatcher.start(pluginDir, executor, pluginJarProcessor); } catch (Exception e) { LOG.error("Failed to initialize " + PluginManager.class.getName(), e); throw new RuntimeException(e); } } @Inject  PluginManager(final PluginWatcher pluginWatcher,
                         final PluginJarProcessor pluginJarProcessor); void init(final String contextRootDir,
                     final String pluginDir);  }
@Test public void initPluginLoader() throws Exception { manager.init(contextRootDir, pluginDir); verify(pluginJarProcessor, times(1)).init(eq(pluginDir), eq(pluginDeploymentDir)); }
@Test public void initStartsWatcher() throws Exception { manager.init(contextRootDir, pluginDir); verify(pluginWatcher, times(1)).start(eq(pluginDir), any(ExecutorService.class), eq(pluginJarProcessor)); }