TemplateEngine { public freemarker.template.Template getTemplate(final Template template) throws CluecumberPluginException { return templateConfiguration.getTemplate(template.fileName); } @Inject  TemplateEngine(final TemplateConfiguration templateConfiguration); freemarker.template.Template getTemplate(final Template template);  }
@Test public void getTemplateTest() throws CluecumberPluginException { Template returnTemplate = mock(Template.class); when(returnTemplate.getName()).thenReturn("MyTemplate"); when(templateConfiguration.getTemplate(TemplateEngine.Template.SCENARIO_DETAILS.getFileName())).thenReturn(returnTemplate); final Template template = templateEngine.getTemplate(TemplateEngine.Template.SCENARIO_DETAILS); assertThat(template.getName(), is("MyTemplate")); }