@Test public void toHtml_ShouldReturnEmpty_WhenUrlIsNull() { final String nullUrl = null; final VideoEmbedding cut = new VideoEmbedding(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 "" + "<video src=\"" + escapedUrl + "\" width=\"864\" autobuffer controls " + "style=\"max-width: 100%; box-shadow: 0 0 8px lightgray;\">" + "<a href=\"" + escapedUrl + "\">SHOW</a>" + "</video>"; }
VideoEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "" + "<video src=\"" + escapedUrl + "\" width=\"864\" autobuffer controls " + "style=\"max-width: 100%; box-shadow: 0 0 8px lightgray;\">" + "<a href=\"" + escapedUrl + "\">SHOW</a>" + "</video>"; } }
VideoEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "" + "<video src=\"" + escapedUrl + "\" width=\"864\" autobuffer controls " + "style=\"max-width: 100%; box-shadow: 0 0 8px lightgray;\">" + "<a href=\"" + escapedUrl + "\">SHOW</a>" + "</video>"; } VideoEmbedding(String kind, String name, String url, EmbeddingPriority priority); }
VideoEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "" + "<video src=\"" + escapedUrl + "\" width=\"864\" autobuffer controls " + "style=\"max-width: 100%; box-shadow: 0 0 8px lightgray;\">" + "<a href=\"" + escapedUrl + "\">SHOW</a>" + "</video>"; } VideoEmbedding(String kind, String name, String url, EmbeddingPriority priority); @Override String toHtml(); }
VideoEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "" + "<video src=\"" + escapedUrl + "\" width=\"864\" autobuffer controls " + "style=\"max-width: 100%; box-shadow: 0 0 8px lightgray;\">" + "<a href=\"" + escapedUrl + "\">SHOW</a>" + "</video>"; } VideoEmbedding(String kind, String name, String url, EmbeddingPriority priority); @Override String toHtml();  }