@Test public void testSpringInjection() throws Exception { File configFile = super.getFile(ConfigurationFactoryTest.class, "configRequiringSpringInjection.yaml"); final Configuration config = configurationFactory.getConfig(configFile); assertNotNull(config.getDirectory()); assertEquals(1, config.getTemplates().size()); final Template template = config.getTemplate("main"); assertNotNull(template); assertEquals(1, template.getAttributes().size()); final Attribute attribute = template.getAttributes().get("att"); assertTrue(attribute instanceof AttributeWithSpringInjection); ((AttributeWithSpringInjection) attribute).assertInjected(); assertEquals(1, template.getProcessorGraph().getAllProcessors().size()); assertEquals(1, template.getProcessorGraph().getRoots().size()); Processor processor = template.getProcessorGraph().getRoots().get(0).getProcessor(); assertTrue(processor.toString(), processor instanceof ProcessorWithSpringInjection); ((ProcessorWithSpringInjection) processor).assertInjected(); }
@VisibleForTesting public final Configuration getConfig(final File configFile) throws IOException { try (FileInputStream in = new FileInputStream(configFile)) { return getConfig(configFile, in); } }
ConfigurationFactory { @VisibleForTesting public final Configuration getConfig(final File configFile) throws IOException { try (FileInputStream in = new FileInputStream(configFile)) { return getConfig(configFile, in); } } }
ConfigurationFactory { @VisibleForTesting public final Configuration getConfig(final File configFile) throws IOException { try (FileInputStream in = new FileInputStream(configFile)) { return getConfig(configFile, in); } }  }
ConfigurationFactory { @VisibleForTesting public final Configuration getConfig(final File configFile) throws IOException { try (FileInputStream in = new FileInputStream(configFile)) { return getConfig(configFile, in); } }  @PostConstruct final void init(); @VisibleForTesting final Configuration getConfig(final File configFile); final Configuration getConfig(final File configFile, final InputStream configData); final void setDoValidation(final boolean doValidation); }
ConfigurationFactory { @VisibleForTesting public final Configuration getConfig(final File configFile) throws IOException { try (FileInputStream in = new FileInputStream(configFile)) { return getConfig(configFile, in); } }  @PostConstruct final void init(); @VisibleForTesting final Configuration getConfig(final File configFile); final Configuration getConfig(final File configFile, final InputStream configData); final void setDoValidation(final boolean doValidation);  }