From 0a5a527d06db07af00483134248ca8b7d229e471 Mon Sep 17 00:00:00 2001 From: Nicolas Ayral Seydoux Date: Fri, 5 Jul 2024 10:48:31 +0200 Subject: [PATCH] Make config value optional --- .../inrupt/client/integration/base/AccessGrantScenarios.java | 5 +++-- .../base/ApplicationRequestMetadataScenarios.java | 5 +++-- .../client/integration/base/AuthenticationScenarios.java | 5 +++-- .../client/integration/base/DomainModulesResource.java | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/integration/base/src/main/java/com/inrupt/client/integration/base/AccessGrantScenarios.java b/integration/base/src/main/java/com/inrupt/client/integration/base/AccessGrantScenarios.java index 3abb9c06cdf..8bd35baf8e2 100644 --- a/integration/base/src/main/java/com/inrupt/client/integration/base/AccessGrantScenarios.java +++ b/integration/base/src/main/java/com/inrupt/client/integration/base/AccessGrantScenarios.java @@ -93,8 +93,9 @@ public class AccessGrantScenarios { .getOptionalValue("inrupt.test.auth-method", String.class) .orElse("client_secret_basic"); - private static final Boolean INRUPT_TEST_ERROR_DESCRIPTION_FEATURE = - config.getValue("inrupt.test.error-description.feature", Boolean.class); + private static final Boolean INRUPT_TEST_ERROR_DESCRIPTION_FEATURE = config + .getOptionalValue("inrupt.test.error-description.feature", Boolean.class) + .orElse(false); protected static String ACCESS_GRANT_PROVIDER; protected static final String GRANT_MODE_READ = "Read"; diff --git a/integration/base/src/main/java/com/inrupt/client/integration/base/ApplicationRequestMetadataScenarios.java b/integration/base/src/main/java/com/inrupt/client/integration/base/ApplicationRequestMetadataScenarios.java index 3e9baaba9c1..1f3f24201ab 100644 --- a/integration/base/src/main/java/com/inrupt/client/integration/base/ApplicationRequestMetadataScenarios.java +++ b/integration/base/src/main/java/com/inrupt/client/integration/base/ApplicationRequestMetadataScenarios.java @@ -84,8 +84,9 @@ public class ApplicationRequestMetadataScenarios { .orElse("client_secret_basic"); private static final String CLIENT_ID = config.getValue("inrupt.test.client-id", String.class); private static final String CLIENT_SECRET = config.getValue("inrupt.test.client-secret", String.class); - private static final Boolean INRUPT_TEST_ERROR_DESCRIPTION_FEATURE = - config.getValue("inrupt.test.error-description.feature", Boolean.class); + private static final Boolean INRUPT_TEST_ERROR_DESCRIPTION_FEATURE = config + .getOptionalValue("inrupt.test.error-description.feature", Boolean.class) + .orElse(false); private static final String FOLDER_SEPARATOR = "/"; diff --git a/integration/base/src/main/java/com/inrupt/client/integration/base/AuthenticationScenarios.java b/integration/base/src/main/java/com/inrupt/client/integration/base/AuthenticationScenarios.java index e4468098f22..cf93055ef08 100644 --- a/integration/base/src/main/java/com/inrupt/client/integration/base/AuthenticationScenarios.java +++ b/integration/base/src/main/java/com/inrupt/client/integration/base/AuthenticationScenarios.java @@ -76,8 +76,9 @@ public class AuthenticationScenarios { .getOptionalValue("inrupt.test.auth-method", String.class) .orElse("client_secret_basic"); - private static final Boolean INRUPT_TEST_ERROR_DESCRIPTION_FEATURE = - config.getValue("inrupt.test.error-description.feature", Boolean.class); + private static final Boolean INRUPT_TEST_ERROR_DESCRIPTION_FEATURE = config + .getOptionalValue("inrupt.test.error-description.feature", Boolean.class) + .orElse(false); private static SolidSyncClient localAuthClient; @BeforeAll diff --git a/integration/base/src/main/java/com/inrupt/client/integration/base/DomainModulesResource.java b/integration/base/src/main/java/com/inrupt/client/integration/base/DomainModulesResource.java index c15ddb4b3aa..0b681ce0145 100644 --- a/integration/base/src/main/java/com/inrupt/client/integration/base/DomainModulesResource.java +++ b/integration/base/src/main/java/com/inrupt/client/integration/base/DomainModulesResource.java @@ -76,8 +76,9 @@ public class DomainModulesResource { private static final String CLIENT_SECRET = config.getValue("inrupt.test.client-secret", String.class); private static final String FOLDER_SEPARATOR = "/"; private static URI publicContainerURI; - private static final Boolean INRUPT_TEST_ERROR_DESCRIPTION_FEATURE = - config.getValue("inrupt.test.error-description.feature", Boolean.class); + private static final Boolean INRUPT_TEST_ERROR_DESCRIPTION_FEATURE = config + .getOptionalValue("inrupt.test.error-description.feature", Boolean.class) + .orElse(false); private static SolidSyncClient localAuthClient;