public static String renderTemplate(String template, Map<String, Object> newContext)
      throws IOException, ClassNotFoundException {
    Map<String, Object> contextMap = getDefaultContextMap();
    contextMap.putAll(newContext);
    String templateRendered = GROOVY_TEMPLATE_ENGINE.createTemplate(template).make(contextMap).toString();
    GROOVY_SHELL.resetLoadedClasses();
    return templateRendered;
  }
@Test
  public void testDefaultRenderTemplate()
      throws IOException, ClassNotFoundException {
    Date today = new Date(Instant.now().toEpochMilli());
    Date yesterday = new Date(Instant.now().minus(1, ChronoUnit.DAYS).toEpochMilli());
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    Assert.assertEquals(GroovyTemplateUtils.renderTemplate("${ today }"), dateFormat.format(today));
    Assert.assertEquals(GroovyTemplateUtils.renderTemplate("${ yesterday }"), dateFormat.format(yesterday));
  }