@Test public void getHtmlWithErrorType() { when(context.getParameters()).thenReturn("error"); when(context.getBody()).thenReturn("body"); assertEquals("<div class=\"alert alert-error\">body</div>", runnable.getHtml(context)); }
@Override public String getHtml(IMacroContext macroContext) { String body = StringUtils.defaultString(macroContext.getBody()); String type = macroContext.getParameters(); String typeClass = StringUtils.EMPTY; if (StringUtils.isNotBlank(type)) { typeClass = " alert-" + StringEscapeUtils.escapeHtml4(type); } return "<div class=\"alert" + typeClass + "\">" + body + "</div>"; }
AlertMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String body = StringUtils.defaultString(macroContext.getBody()); String type = macroContext.getParameters(); String typeClass = StringUtils.EMPTY; if (StringUtils.isNotBlank(type)) { typeClass = " alert-" + StringEscapeUtils.escapeHtml4(type); } return "<div class=\"alert" + typeClass + "\">" + body + "</div>"; } }
AlertMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String body = StringUtils.defaultString(macroContext.getBody()); String type = macroContext.getParameters(); String typeClass = StringUtils.EMPTY; if (StringUtils.isNotBlank(type)) { typeClass = " alert-" + StringEscapeUtils.escapeHtml4(type); } return "<div class=\"alert" + typeClass + "\">" + body + "</div>"; }  }
AlertMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String body = StringUtils.defaultString(macroContext.getBody()); String type = macroContext.getParameters(); String typeClass = StringUtils.EMPTY; if (StringUtils.isNotBlank(type)) { typeClass = " alert-" + StringEscapeUtils.escapeHtml4(type); } return "<div class=\"alert" + typeClass + "\">" + body + "</div>"; }  @Override String getHtml(IMacroContext macroContext); @Override String cleanupHtml(String html); }
AlertMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String body = StringUtils.defaultString(macroContext.getBody()); String type = macroContext.getParameters(); String typeClass = StringUtils.EMPTY; if (StringUtils.isNotBlank(type)) { typeClass = " alert-" + StringEscapeUtils.escapeHtml4(type); } return "<div class=\"alert" + typeClass + "\">" + body + "</div>"; }  @Override String getHtml(IMacroContext macroContext); @Override String cleanupHtml(String html);  }