From 6602011176d01cbb7a779716e06f21cccf2cb928 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 28 Oct 2024 15:42:21 +0100 Subject: [PATCH] Added check on tests --- .../authorization/utils/manager/SecretManagerTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/org/gcube/common/authorization/utils/manager/SecretManagerTest.java b/src/test/java/org/gcube/common/authorization/utils/manager/SecretManagerTest.java index a069546..414aa3b 100644 --- a/src/test/java/org/gcube/common/authorization/utils/manager/SecretManagerTest.java +++ b/src/test/java/org/gcube/common/authorization/utils/manager/SecretManagerTest.java @@ -66,6 +66,10 @@ public class SecretManagerTest extends ContextTest { String clientId = properties.getProperty(CLIENT_ID_PROPERTY_KEY); String clientSecret = properties.getProperty(root); + if(clientId==null || clientId.compareTo("")==0 || clientSecret==null || clientSecret.compareTo("")==0) { + return; + } + ClientIDManager clientIDManager = new ClientIDManager(clientId, clientSecret); Secret secret = clientIDManager.getSecret(context); Map map = secret.getHTTPAuthorizationHeaders(); @@ -93,6 +97,10 @@ public class SecretManagerTest extends ContextTest { String clientId = properties.getProperty(CLIENT_ID_PROPERTY_KEY); String clientSecret = properties.getProperty(root); + if(clientId==null || clientId.compareTo("")==0 || clientSecret==null || clientSecret.compareTo("")==0) { + return; + } + D4ScienceIAMClient iamClient = D4ScienceIAMClient.newInstance(context); D4ScienceIAMClientAuthn d4ScienceIAMClientAuthn = iamClient.authenticate(clientId, clientSecret, context); if(d4ScienceIAMClientAuthn!=null && d4ScienceIAMClientAuthn.canBeRefreshed()) {