File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/test/java/com/uid2/operator Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,29 @@ void multipleStoresOneStaleTriggers(VertxTestContext testContext) {
271271 }
272272 }
273273
274+ @ Test
275+ void multipleStoresFailSimultaneouslyTriggersShutdown (VertxTestContext testContext ) {
276+ ListAppender <ILoggingEvent > logWatcher = new ListAppender <>();
277+ logWatcher .start ();
278+ ((Logger ) LoggerFactory .getLogger (OperatorShutdownHandler .class )).addAppender (logWatcher );
279+
280+ this .operatorShutdownHandler .handleStoreRefresh ("keyset" );
281+ this .operatorShutdownHandler .handleStoreRefresh ("keysetkey" );
282+ this .operatorShutdownHandler .handleStoreRefresh ("salt" );
283+ this .operatorShutdownHandler .handleStoreRefresh ("auth" );
284+
285+ when (clock .instant ()).thenAnswer (i -> Instant .now ().plus (12 , ChronoUnit .HOURS ).plusSeconds (1 ));
286+
287+ try {
288+ this .operatorShutdownHandler .checkStoreRefreshStaleness ();
289+ } catch (RuntimeException e ) {
290+ verify (shutdownService ).Shutdown (1 );
291+ Assertions .assertTrue (logWatcher .list .stream ().anyMatch (log ->
292+ log .getFormattedMessage ().contains ("has not refreshed successfully" )));
293+ testContext .completeNow ();
294+ }
295+ }
296+
274297 @ Test
275298 void noShutdownWhenStoreNeverInitialized (VertxTestContext testContext ) {
276299
You can’t perform that action at this time.
0 commit comments