@Test public void check_If_Correct_Title_Is_Used() { MavenProjectVersionsSymbol mavenVersionSymbol = new MavenProjectVersionsSymbol(); String receivedValue = mavenVersionSymbol.toTarget(null, null); assertThat(receivedValue).contains("<h3>Maven Version Checker</h3>"); }
@Override public String toTarget(Translator translator, Symbol symbol) { HtmlWriter writer = new HtmlWriter(); writer.startTag("div"); writer.putAttribute("id", "mavenVersions"); writer.startTag("h3"); writer.putText("Maven Version Checker"); writer.endTag(); try { ProjectDependencyInfo projectDependencyInfo = new ProjectDependencyInfo(); writer.putText(getVersionTableHtmlAsString(projectDependencyInfo.getDependencyInfo())); } catch (FileNotFoundException e) { writer.startTag("h4"); writer.putText("POM not found!"); writer.endTag(); } writer.endTag(); return writer.toHtml(); }
MavenProjectVersionsSymbol extends SymbolType implements Rule, Translation { @Override public String toTarget(Translator translator, Symbol symbol) { HtmlWriter writer = new HtmlWriter(); writer.startTag("div"); writer.putAttribute("id", "mavenVersions"); writer.startTag("h3"); writer.putText("Maven Version Checker"); writer.endTag(); try { ProjectDependencyInfo projectDependencyInfo = new ProjectDependencyInfo(); writer.putText(getVersionTableHtmlAsString(projectDependencyInfo.getDependencyInfo())); } catch (FileNotFoundException e) { writer.startTag("h4"); writer.putText("POM not found!"); writer.endTag(); } writer.endTag(); return writer.toHtml(); } }
MavenProjectVersionsSymbol extends SymbolType implements Rule, Translation { @Override public String toTarget(Translator translator, Symbol symbol) { HtmlWriter writer = new HtmlWriter(); writer.startTag("div"); writer.putAttribute("id", "mavenVersions"); writer.startTag("h3"); writer.putText("Maven Version Checker"); writer.endTag(); try { ProjectDependencyInfo projectDependencyInfo = new ProjectDependencyInfo(); writer.putText(getVersionTableHtmlAsString(projectDependencyInfo.getDependencyInfo())); } catch (FileNotFoundException e) { writer.startTag("h4"); writer.putText("POM not found!"); writer.endTag(); } writer.endTag(); return writer.toHtml(); } MavenProjectVersionsSymbol(); }
MavenProjectVersionsSymbol extends SymbolType implements Rule, Translation { @Override public String toTarget(Translator translator, Symbol symbol) { HtmlWriter writer = new HtmlWriter(); writer.startTag("div"); writer.putAttribute("id", "mavenVersions"); writer.startTag("h3"); writer.putText("Maven Version Checker"); writer.endTag(); try { ProjectDependencyInfo projectDependencyInfo = new ProjectDependencyInfo(); writer.putText(getVersionTableHtmlAsString(projectDependencyInfo.getDependencyInfo())); } catch (FileNotFoundException e) { writer.startTag("h4"); writer.putText("POM not found!"); writer.endTag(); } writer.endTag(); return writer.toHtml(); } MavenProjectVersionsSymbol(); @Override Maybe<Symbol> parse(Symbol current, Parser parser); @Override String toTarget(Translator translator, Symbol symbol); static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList); }
MavenProjectVersionsSymbol extends SymbolType implements Rule, Translation { @Override public String toTarget(Translator translator, Symbol symbol) { HtmlWriter writer = new HtmlWriter(); writer.startTag("div"); writer.putAttribute("id", "mavenVersions"); writer.startTag("h3"); writer.putText("Maven Version Checker"); writer.endTag(); try { ProjectDependencyInfo projectDependencyInfo = new ProjectDependencyInfo(); writer.putText(getVersionTableHtmlAsString(projectDependencyInfo.getDependencyInfo())); } catch (FileNotFoundException e) { writer.startTag("h4"); writer.putText("POM not found!"); writer.endTag(); } writer.endTag(); return writer.toHtml(); } MavenProjectVersionsSymbol(); @Override Maybe<Symbol> parse(Symbol current, Parser parser); @Override String toTarget(Translator translator, Symbol symbol); static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList);  }