GWTScriptPluginProcessor implements PluginProcessor { @Override public void process(String pluginName, String pluginDeploymentDir, boolean notifyClients) { final String pluginDisplayName = pluginName.replace(PluginProcessorType.GWT.getExtension(), ""); if (!isRegistered(pluginName)) { final String url = resolveScriptUrl(pluginName, pluginDeploymentDir); add(pluginName, url); if (notifyClients) { pluginAddedEvent.fire(new PluginAddedEvent(pluginDisplayName)); } } else { if (notifyClients) { pluginUpdatedEvent.fire(new PluginUpdatedEvent(pluginDisplayName)); } } } GWTScriptPluginProcessor(); @Inject  GWTScriptPluginProcessor(final ScriptRegistry scriptRegistry,
                                    final Event<PluginAddedEvent> pluginAddedEvent,
                                    final Event<PluginUpdatedEvent> pluginUpdatedEvent); @Override void removeAll(); @Override boolean isRegistered(String pluginName); @Override boolean shouldProcess(String pluginName); @Override void process(String pluginName,
                        String pluginDeploymentDir,
                        boolean notifyClients);  }
@Test public void processTest() { assertFalse(processor.isRegistered("test-app.nocache.js")); processor.process("test-app.nocache.js", pluginDeploymentDir, true); assertTrue(processor.isRegistered("test-app.nocache.js")); verify(scriptRegistry, times(1)).addScript(eq("UF"), anyString()); verify(pluginAddedEvent, times(1)).fire(any()); processor.process("test-app.nocache.js", pluginDeploymentDir, true); verify(pluginUpdatedEvent, times(1)).fire(any()); }