appConfigUnderTest.systemEnvironment = new Properties();
// When
doReturn(getCorrectJson()).when(appConfigUnderTest).createInputStream(any());
+ doReturn("fileName").when(appConfigUnderTest).getLocalConfigurationFilePath();
appConfigUnderTest.initialize();
// Then
- verify(appConfigUnderTest, times(1)).loadConfigurationFromFile(any());
+ verify(appConfigUnderTest, times(1)).loadConfigurationFromFile();
- Vector<RicConfig> ricConfigs = appConfigUnderTest.getRicConfigs();
- RicConfig ricConfig = ricConfigs.firstElement();
+ Iterable<RicConfig> ricConfigs = appConfigUnderTest.getRicConfigs();
+ RicConfig ricConfig = ricConfigs.iterator().next();
assertThat(ricConfigs).isNotNull();
assertThat(ricConfig).isEqualTo(CORRECT_RIC_CONIFG);
}
// When
doReturn(getIncorrectJson()).when(appConfigUnderTest).createInputStream(any());
- appConfigUnderTest.loadConfigurationFromFile(any());
+ doReturn("fileName").when(appConfigUnderTest).getLocalConfigurationFilePath();
+ appConfigUnderTest.loadConfigurationFromFile();
// Then
- verify(appConfigUnderTest, times(1)).loadConfigurationFromFile(any());
- Assertions.assertNull(appConfigUnderTest.getRicConfigs());
+ verify(appConfigUnderTest, times(1)).loadConfigurationFromFile();
+ Assertions.assertEquals(0, appConfigUnderTest.getRicConfigs().size());
}
@Test