@Test public void toHtml_ShouldReturnEmpty_WhenUrlIsNull() { final String nullUrl = null; final LinkEmbedding cut = new LinkEmbedding(null, null, nullUrl, null); final String html = cut.toHtml(); assertThat(html).isEmpty(); }
@Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "<a href=\"" + escapedUrl + "\">SHOW</a>" + " (Open in a new tab if it is not opening)"; }
LinkEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "<a href=\"" + escapedUrl + "\">SHOW</a>" + " (Open in a new tab if it is not opening)"; } }
LinkEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "<a href=\"" + escapedUrl + "\">SHOW</a>" + " (Open in a new tab if it is not opening)"; } LinkEmbedding(String kind, String name, String url, EmbeddingPriority priority); }
LinkEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "<a href=\"" + escapedUrl + "\">SHOW</a>" + " (Open in a new tab if it is not opening)"; } LinkEmbedding(String kind, String name, String url, EmbeddingPriority priority); @Override String toHtml(); }
LinkEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "<a href=\"" + escapedUrl + "\">SHOW</a>" + " (Open in a new tab if it is not opening)"; } LinkEmbedding(String kind, String name, String url, EmbeddingPriority priority); @Override String toHtml();  }