@Test
public void testCreateFileResult() throws Exception {

    ConfigurableApplicationContext context = Mockito.mock(ConfigurableApplicationContext.class);
    ApplicationContextHolder.set(context);
    Mockito.when(context.getBean(SystemInfo.class)).thenReturn(SystemInfo.createForTesting(SystemInfo.STAGE_PRODUCTION));
    final TemplateCache templateCache = new TemplateCache();
    templateCache.xmlTemplateParser = AbstractTemplateParserTest.createTestParser(SystemInfo.STAGE_TESTING);
    final Path functionFile = IO.toPath(FormatterApiIntegrationTest.class.getResource("functions.xsl").toURI());
    final FileResult fileResult = templateCache.createFileResult(functionFile.getParent(), functionFile.getParent(),
        functionFile.getParent(), functionFile.getFileName().toString(), Collections.<String, Object>emptyMap());
    assertNotNull(fileResult);
    assertNotNull(templateCache.canonicalFileNameToText.get(functionFile.toRealPath()));
}