GoSnippetExecutor extends AbstractSnippetExecutor<GoSnippetExecutorOptions> { protected String determinePackageName(final CodeSnippet codeSnippet) { String packageName = codeSnippet.getProperties().get(PACKAGE_NAME_PROPERTY); if (packageName == null || packageName.isEmpty()) packageName = "slideshowfx"; return packageName; } GoSnippetExecutor(); @Override Parent getUI(final CodeSnippet codeSnippet); @Override Node getConfigurationUI(); @Override void saveNewOptions(); @Override ObservableList<String> execute(final CodeSnippet codeSnippet);  }
@Test public void noPackageName() { final CodeSnippet snippet = new CodeSnippet(); assertEquals("slideshowfx", snippetExecutor.determinePackageName(snippet)); }
@Test public void emptyPackageName() { final CodeSnippet snippet = new CodeSnippet(); snippet.getProperties().put(PACKAGE_NAME_PROPERTY, ""); assertEquals("slideshowfx", snippetExecutor.determinePackageName(snippet)); }
@Test public void givenPackageName() { final CodeSnippet snippet = new CodeSnippet(); snippet.getProperties().put(PACKAGE_NAME_PROPERTY, "sfx"); assertEquals("sfx", snippetExecutor.determinePackageName(snippet)); }