Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Nov 29, 2023
1 parent d83b6f5 commit a18e582
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/java/crypto/KeyStoreTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.UUID;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

class KeyStoreTest {

Expand All @@ -27,6 +28,9 @@ void encryptAndDecrypt() throws NoSuchAlgorithmException, InvalidKeySpecExceptio
KeyStore encryptionKeyStore = new KeyStore(publicKeyContent, false);
KeyStore decryptionKeyStore = new KeyStore(privateKeyContent);
this.doEncryptAndDecrypt(encryptionKeyStore, decryptionKeyStore);

assertThrows(IllegalArgumentException.class, () -> decryptionKeyStore.encryptAndEncode("secret"));
assertThrows(IllegalArgumentException.class, () -> encryptionKeyStore.decodeAndDecrypt("secret"));
}

@Test
Expand Down

0 comments on commit a18e582

Please sign in to comment.