ScalaSnippetExecutor extends AbstractSnippetExecutor<ScalaSnippetExecutorOptions> { protected boolean hasImports(final CodeSnippet codeSnippet) { final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY); return imports != null && !imports.isEmpty(); } ScalaSnippetExecutor(); @Override Parent getUI(final CodeSnippet codeSnippet); @Override Node getConfigurationUI(); @Override void saveNewOptions(); @Override ObservableList<String> execute(final CodeSnippet codeSnippet);  }
@Test public void hasNoImports() { final CodeSnippet snippet = new CodeSnippet(); assertFalse(snippetExecutor.hasImports(snippet)); }
@Test public void hasEmptyImports() { final CodeSnippet snippet = new CodeSnippet(); snippet.getProperties().put(IMPORTS_PROPERTY, ""); assertFalse(snippetExecutor.hasImports(snippet)); }
@Test public void hasImports() { final CodeSnippet snippet = new CodeSnippet(); snippet.getProperties().put(IMPORTS_PROPERTY, "import p._"); assertTrue(snippetExecutor.hasImports(snippet)); }