use of org.codice.ddf.configuration.status.ConfigurationFileException in project ddf by codice.
the class ConfigurationAdminMigrationTest method testInitProcessesAllFilesEvenIfFirstOneHasAnInvalidType.
@Test
public void testInitProcessesAllFilesEvenIfFirstOneHasAnInvalidType() throws Exception {
setUpTwoConfigFileIterator(configurationDirectoryStream);
when(configurationFileFactory.createConfigurationFile(CONFIG_PATH1)).thenThrow(new ConfigurationFileException(""));
when(configurationFileFactory.createConfigurationFile(CONFIG_PATH2)).thenReturn(configFile2);
ConfigurationAdminMigration configurationAdminMigrator = new ConfigurationAdminMigration(configurationDirectoryStream, PROCESSED_DIRECTORY_PATH, FAILED_DIRECTORY_PATH, configurationFileFactory, configurationFilePoller, configurationAdmin, CONFIGURATION_FILE_EXTENSION);
configurationAdminMigrator.init();
verify(configurationDirectoryStream).iterator();
verify(configurationFileFactory).createConfigurationFile(CONFIG_PATH1);
verify(configFile1, never()).createConfig();
verify(configurationFileFactory).createConfigurationFile(CONFIG_PATH2);
verify(configFile2).createConfig();
verify(configurationDirectoryStream).close();
}
Aggregations