DefaultPluginManager implements PluginManager { @Override public <T> T getPlugin(String name) { return context.getPlugin(name); } DefaultPluginManager(PluginContext context, AnnotationProcessor annotationProcessor, DependencyResolver dependencyResolver); @Override void register(T plugin); @Override void register(String name, T plugin); @Override T getPlugin(String name); @Override T getPlugin(Class<T> pluginClass); @Override Collection<PluginRef> getAllPlugins(); @Override T removePlugin(String name); @Override T removePlugin(T plugin); @Override Collection<Object> loadPlugins(PluginSource source);  }
@Test public void shouldRetrievePluginFromName() { final TestPlugin test = manager.getPlugin("test"); assertEquals(plugin, test); verify(mockContext).getPlugin(eq("test")); }
@Test public void shouldRetrievePluginFromClass() { final TestPlugin test = manager.getPlugin(TestPlugin.class); assertEquals(this.plugin, test); verify(mockContext).getPlugin(eq(TestPlugin.class)); }