GoloSnippetExecutor extends AbstractSnippetExecutor<GoloSnippetExecutorOptions> { protected String determineModuleName(final CodeSnippet codeSnippet) { String moduleName = codeSnippet.getProperties().get(MODULE_NAME_PROPERTY); if (moduleName == null || moduleName.isEmpty()) moduleName = "slideshowfx.Snippet"; return moduleName; } GoloSnippetExecutor(); @Override Parent getUI(final CodeSnippet codeSnippet); @Override Node getConfigurationUI(); @Override void saveNewOptions(); @Override ObservableList<String> execute(final CodeSnippet codeSnippet);  }
@Test public void noModuleName() { final CodeSnippet snippet = new CodeSnippet(); assertEquals("slideshowfx.Snippet", snippetExecutor.determineModuleName(snippet)); }
@Test public void emptyModuleName() { final CodeSnippet snippet = new CodeSnippet(); snippet.getProperties().put(MODULE_NAME_PROPERTY, ""); assertEquals("slideshowfx.Snippet", snippetExecutor.determineModuleName(snippet)); }
@Test public void givenModuleName() { final CodeSnippet snippet = new CodeSnippet(); snippet.getProperties().put(MODULE_NAME_PROPERTY, "sfx.Golo"); assertEquals("sfx.Golo", snippetExecutor.determineModuleName(snippet)); }