Added check on tests

This commit is contained in:
Luca Frosini 2024-10-28 15:42:21 +01:00
parent 6fcf847fdf
commit 6602011176
1 changed files with 8 additions and 0 deletions

View File

@ -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<String, String> 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()) {