ColorMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String color = macroContext.getParameters(); return "<span style=\"color: " + StringEscapeUtils.escapeHtml4(color) + ";\">" + macroContext.getBody() + "</span>"; }  @Override String getHtml(IMacroContext macroContext); @Override String cleanupHtml(String html);  }
@Test public void getHtml() { when(context.getParameters()).thenReturn("#880000"); when(context.getBody()).thenReturn("body"); assertEquals("<span style=\"color: #880000;\">body</span>", runnable.getHtml(context)); }