- private static EnvProperties properties() {
- return ImmutableEnvProperties.builder() //
- .consulHost("host") //
- .consulPort(123) //
- .cbsName("cbsName") //
- .appName("appName") //
- .build();
- }
-
- @Test
- public void whenTheConfigurationFits() throws IOException, ServiceException {
-
- appConfigUnderTest = spy(ApplicationConfig.class);
- appConfigUnderTest.systemEnvironment = new Properties();
- // When
- doReturn(getCorrectJson()).when(appConfigUnderTest).createInputStream(any());
- doReturn("fileName").when(appConfigUnderTest).getLocalConfigurationFilePath();
- appConfigUnderTest.initialize();
-
- // Then
- verify(appConfigUnderTest, times(1)).loadConfigurationFromFile();
-
- Iterable<RicConfig> ricConfigs = appConfigUnderTest.getRicConfigs();
- RicConfig ricConfig = ricConfigs.iterator().next();
- assertThat(ricConfigs).isNotNull();
- assertThat(ricConfig).isEqualTo(CORRECT_RIC_CONIFG);
- }
-