From 1e1c22d54c79615c841e7b8149a835b88de7cb97 Mon Sep 17 00:00:00 2001 From: Sreenadh S <32409698+sree96@users.noreply.github.com> Date: Mon, 23 Dec 2024 09:45:48 +0530 Subject: [PATCH] [INJIVEr-587] - test fix Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> --- .../src/test/java/io/inji/verify/utils/SecurityUtilsTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/verify-service/src/test/java/io/inji/verify/utils/SecurityUtilsTest.java b/verify-service/src/test/java/io/inji/verify/utils/SecurityUtilsTest.java index d17d3a1b..68813ec3 100644 --- a/verify-service/src/test/java/io/inji/verify/utils/SecurityUtilsTest.java +++ b/verify-service/src/test/java/io/inji/verify/utils/SecurityUtilsTest.java @@ -4,6 +4,7 @@ import org.junit.jupiter.api.Test; import java.security.interfaces.RSAPublicKey; +import java.util.Base64; public class SecurityUtilsTest { @@ -27,8 +28,9 @@ public void shouldNotReturnNullForValidPublicKey() throws Exception { "Q8tqKn8P0B00vto8bEhadIpj53efNTTMmP6fnLhFEX+xOWVp4lJi8qM4Y0UMbbnx\n"+ "ewIDAQAB\n"+ "-----END PUBLIC KEY-----"; + byte[] encoded = Base64.getEncoder().encode(pemString.getBytes()); - RSAPublicKey publicKey = SecurityUtils.readX509PublicKey(pemString); + RSAPublicKey publicKey = SecurityUtils.readX509PublicKey(new String(encoded)); assertNotNull(publicKey); }