RefreshConfigTask obj = spy(new RefreshConfigTask(appConfig, rics, policies, new Services(), new PolicyTypes(),
new A1ClientFactory(appConfig)));
if (stubConfigFileExists) {
- doReturn(configFileExists).when(obj).configFileExists();
+ doReturn(configFileExists).when(obj).fileExists(any());
}
return obj;
}
refreshTaskUnderTest.start();
ILoggingEvent event = logAppender.list.get(0);
- assertThat(event.getThrowableProxy().getMessage()).isEqualTo("Error");
+ assertThat(event.getLevel()).isEqualTo(ERROR);
assertThat(event.toString().contains("Configuration refresh terminated due to exception")).isTrue();
}
doReturn(Mono.just(props)).when(refreshTaskUnderTest).getEnvironment(any());
doReturn(Mono.just(cbsClient)).when(refreshTaskUnderTest).createCbsClient(props);
- when(cbsClient.updates(any(), any(), any())).thenReturn(Flux.error(new IOException()));
+ when(cbsClient.get(any())).thenReturn(Mono.error(new IOException()));
final ListAppender<ILoggingEvent> logAppender = LoggingUtils.getLogListAppender(RefreshConfigTask.class, WARN);
Flux<Type> task = refreshTaskUnderTest.createRefreshTask();
StepVerifier //
.create(task) //
.expectSubscription() //
- .expectNoEvent(Duration.ofMillis(100)) //
+ .expectNoEvent(Duration.ofMillis(1000)) //
.thenCancel() //
.verify();
JsonObject configAsJson = getJsonRootObject();
String newBaseUrl = "newBaseUrl";
modifyTheRicConfiguration(configAsJson, newBaseUrl);
- when(cbsClient.updates(any(), any(), any())).thenReturn(Flux.just(configAsJson));
+ when(cbsClient.get(any())).thenReturn(Mono.just(configAsJson));
doNothing().when(refreshTaskUnderTest).runRicSynchronization(any(Ric.class));
Flux<Type> task = refreshTaskUnderTest.createRefreshTask();