The following test currently fails sometimes, but also succeeds sometimes. That's why it's currently disabled. It seems like the error is because of the Spring scheduling. Please re-enable the test after it twas fixed.
@Disabled("Sometime fails, please FIX")
@Test
void keyRotationTest() throws InterruptedException {
// here the rotationImpl should be initialized and a valid key set
assertNotNull(signingKeyHolder.getCurrentPrivateKey());
assertNotNull(signingKeyHolder.getKid());
String oldKid = signingKeyHolder.getKid();
PrivateKey oldKey = signingKeyHolder.getCurrentPrivateKey();
// we have to wait to let key rotation happen
Thread.sleep(4000);
assertNotEquals(oldKid, signingKeyHolder.getKid());
assertNotEquals(oldKey, signingKeyHolder.getCurrentPrivateKey());
}
The following test currently fails sometimes, but also succeeds sometimes. That's why it's currently disabled. It seems like the error is because of the Spring scheduling. Please re-enable the test after it twas fixed.