diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java index 3c225c783..3f8ba0fe9 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java @@ -71,11 +71,8 @@ void keyByteSerialization2() { @Test void keyByteValidation() { byte[] invalidKeyECDSA = new byte[33]; - assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> PublicKey.fromBytes(invalidKeyECDSA)); - - assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> PublicKey.fromBytesECDSA(invalidKeyECDSA)); + assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyECDSA)); + assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(invalidKeyECDSA)); byte[] invalidCompressedKey = new byte[]{ 0x00, diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java index 0c8d0c724..ee3a53530 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java @@ -52,11 +52,8 @@ void verifyTransaction() { @Test void keyByteValidation() { byte[] invalidKeyED25519 = new byte[32]; - assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> PublicKey.fromBytes(invalidKeyED25519)); - - assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> PublicKey.fromBytesED25519(invalidKeyED25519)); + assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyED25519)); + assertDoesNotThrow(() -> PublicKey.fromBytesED25519(invalidKeyED25519)); byte[] invalidKey = new byte[]{ 0x00,