Skip to content

Commit 940a562

Browse files
committed
update tests
1 parent 892dd53 commit 940a562

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/com/uid2/operator/vertx/OperatorShutdownHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void checkStoreRefreshStaleness() {
101101
if (timeSinceLastRefresh.compareTo(storeRefreshStaleTimeout) > 0) {
102102
LOGGER.error("Store '{}' has not refreshed successfully for {} hours ({}). Shutting down operator",
103103
storeName, timeSinceLastRefresh.toHours(), timeSinceLastRefresh);
104-
shutdownService.Shutdown(1);
104+
this.shutdownService.Shutdown(1);
105105
return; // Exit after triggering shutdown for first stale store
106106
}
107107
}

src/test/java/com/uid2/operator/OperatorShutdownHandlerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.slf4j.LoggerFactory;
2020
import software.amazon.awssdk.utils.Pair;
2121

22+
import java.security.Permission;
2223
import java.time.Clock;
2324
import java.time.Duration;
2425
import java.time.Instant;
@@ -61,6 +62,7 @@ void shutdownOnAttestFailure(VertxTestContext testContext) {
6162
this.operatorShutdownHandler.handleAttestResponse(Pair.of(AttestationResponseCode.AttestationFailure, "Unauthorized"));
6263
} catch (RuntimeException e) {
6364
verify(shutdownService).Shutdown(1);
65+
String message = logWatcher.list.get(0).getFormattedMessage();
6466
Assertions.assertEquals("core attestation failed with AttestationFailure, shutting down operator, core response: Unauthorized", logWatcher.list.get(0).getFormattedMessage());
6567
testContext.completeNow();
6668
}
@@ -191,8 +193,7 @@ void storeRefreshFailureDoesNotResetTimestamp(VertxTestContext testContext) {
191193
when(clock.instant()).thenAnswer(i -> Instant.now().plus(2, ChronoUnit.HOURS));
192194

193195
// Simulate multiple refresh failures by NOT calling handleStoreRefresh
194-
// (failures don't invoke the callback anymore)
195-
196+
196197
when(clock.instant()).thenAnswer(i -> Instant.now().plus(13, ChronoUnit.HOURS));
197198

198199
try {

0 commit comments

Comments
 (0)