From 2ec9a202b6a4a259a577badf007f1b32bcfb87af Mon Sep 17 00:00:00 2001 From: Fabian Heuberger Date: Wed, 25 Oct 2023 17:15:42 +0200 Subject: [PATCH] XIVY-12667 Added test for KeyPairGenerator --- .../test/util/KeyPairGeneratorTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 threema-connector-test/src_test/threema/connector/test/util/KeyPairGeneratorTest.java diff --git a/threema-connector-test/src_test/threema/connector/test/util/KeyPairGeneratorTest.java b/threema-connector-test/src_test/threema/connector/test/util/KeyPairGeneratorTest.java new file mode 100644 index 0000000..5bb233a --- /dev/null +++ b/threema-connector-test/src_test/threema/connector/test/util/KeyPairGeneratorTest.java @@ -0,0 +1,22 @@ +package threema.connector.test.util; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +import util.KeyPairGenerator; +import util.KeyPairGenerator.KeyPair; + +public class KeyPairGeneratorTest { + + @Test + void generateKeyPair() { + KeyPair keys = KeyPairGenerator.generate(); + assertThat(keys.publicKey()).isNotEmpty(); + assertThat(keys.privateKey()).isNotEmpty(); + + assertThat(keys.publicKey().length()).isEqualTo(64); + assertThat(keys.privateKey().length()).isEqualTo(64); + } + +}