Fix TestKeyManager.

Change-Id: I985689f78229d7c54f74cc58284b2688f5d0b97a
This commit is contained in:
Siyao Meng 2021-08-19 22:32:49 -07:00
parent d90c32005c
commit cd0cf9262d
1 changed files with 3 additions and 2 deletions

View File

@ -31,6 +31,7 @@ import org.junit.rules.Timeout;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@ -80,7 +81,7 @@ public class TestKeyManager {
keyManager.newDataEncryptionKey(); keyManager.newDataEncryptionKey();
assertNotEquals( assertNotEquals(
dek, dekAfterExpiration, "KeyManager should generate a new data encryption key"); dek, dekAfterExpiration, "KeyManager should generate a new data encryption key");
assertTrue("KeyManager has an expired DataEncryptionKey!", assertTrue(dekAfterExpiration.expiryDate > fakeTimer.now(),
dekAfterExpiration.expiryDate > fakeTimer.now()); "KeyManager has an expired DataEncryptionKey!");
} }
} }