+ @Test
+ public void whenTheConfigurationFits() throws IOException, ServiceException {
+
+ appConfigUnderTest = spy(ApplicationConfig.class);
+ appConfigUnderTest.systemEnvironment = new Properties();
+ // When
+ doReturn(getCorrectJson()).when(appConfigUnderTest).createInputStream(any());
+ appConfigUnderTest.initialize();
+
+ // Then
+ verify(appConfigUnderTest, times(1)).loadConfigurationFromFile(any());
+
+ Vector<RicConfig> ricConfigs = appConfigUnderTest.getRicConfigs();
+ RicConfig ricConfig = ricConfigs.firstElement();
+ assertThat(ricConfigs).isNotNull();
+ assertThat(ricConfig).isEqualTo(CORRECT_RIC_CONIFG);
+ }
+
+ @Test
+ public void whenFileIsExistsButJsonIsIncorrect() throws IOException, ServiceException {
+
+ appConfigUnderTest = spy(ApplicationConfig.class);
+ appConfigUnderTest.systemEnvironment = new Properties();
+
+ // When
+ doReturn(getIncorrectJson()).when(appConfigUnderTest).createInputStream(any());
+ appConfigUnderTest.loadConfigurationFromFile(any());
+
+ // Then
+ verify(appConfigUnderTest, times(1)).loadConfigurationFromFile(any());
+ Assertions.assertNull(appConfigUnderTest.getRicConfigs());
+ }
+