@Test(timeout=30000)
public void testLoadNewTemplateFile() throws Exception {

    CountDownLatch loadTemplate = new CountDownLatch(1);        
    configureTemplateManager(loadTemplate, null);
    
    String expected = "<html><body>Hello John</body></html>";
    
    Map<String, Object> parameters = new HashMap<>();
    parameters.put("Name", "John");
    
    String rendered = templateManager.render("basic-email", parameters);
    assertEquals(expected, rendered);
    
    String advancedTemplate = "<html><body>Hello ${Name}, welcome!</body></html>";
    String expectedAdvanced = "<html><body>Hello John, welcome!</body></html>";
    
    Thread.sleep(3000);
    
    Files.write(new File(templateDir, "advanced-email.html").toPath(), advancedTemplate.getBytes());
    
    loadTemplate.await();
    
    rendered = templateManager.render("advanced-email", parameters);
    assertEquals(expectedAdvanced, rendered);
}