@Test public void toHtml_ShouldReturnEmpty_WhenUrlIsNull() { final String nullUrl = null; final ImageEmbedding cut = new ImageEmbedding(null, null, nullUrl, null); final String html = cut.toHtml(); assertThat(html).isEmpty(); }
@Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } return "<div style=\"max-width: 100%; max-height: 400px; overflow: auto; box-shadow: 0 0 8px lightgray;\">" + "<img style=\"max-width: 100%;\" src=\"" + StringEscapeUtils.escapeXml10(url.toString()) + "\">" + "</div>"; }
ImageEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } return "<div style=\"max-width: 100%; max-height: 400px; overflow: auto; box-shadow: 0 0 8px lightgray;\">" + "<img style=\"max-width: 100%;\" src=\"" + StringEscapeUtils.escapeXml10(url.toString()) + "\">" + "</div>"; } }
ImageEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } return "<div style=\"max-width: 100%; max-height: 400px; overflow: auto; box-shadow: 0 0 8px lightgray;\">" + "<img style=\"max-width: 100%;\" src=\"" + StringEscapeUtils.escapeXml10(url.toString()) + "\">" + "</div>"; } ImageEmbedding(String kind, String name, String imageUrl, EmbeddingPriority priority); }
ImageEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } return "<div style=\"max-width: 100%; max-height: 400px; overflow: auto; box-shadow: 0 0 8px lightgray;\">" + "<img style=\"max-width: 100%;\" src=\"" + StringEscapeUtils.escapeXml10(url.toString()) + "\">" + "</div>"; } ImageEmbedding(String kind, String name, String imageUrl, EmbeddingPriority priority); @Override String toHtml(); }
ImageEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } return "<div style=\"max-width: 100%; max-height: 400px; overflow: auto; box-shadow: 0 0 8px lightgray;\">" + "<img style=\"max-width: 100%;\" src=\"" + StringEscapeUtils.escapeXml10(url.toString()) + "\">" + "</div>"; } ImageEmbedding(String kind, String name, String imageUrl, EmbeddingPriority priority); @Override String toHtml();  }