From 33890b243379eef9ba30708a32376d7009d23b76 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Fri, 29 Nov 2024 12:49:44 +0200 Subject: [PATCH] fix unit tests Signed-off-by: Ivan Ivanov --- .../java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java | 7 ++----- .../com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) 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,