diff --git a/notification-acceptance-test/docs/README.md b/notification-acceptance-test/docs/README.md index efb3a21d64252ad2ddb1e98da0668cb0086f429c..b685bab86318b894fac3a938131ad7b50260a0c3 100644 --- a/notification-acceptance-test/docs/README.md +++ b/notification-acceptance-test/docs/README.md @@ -6,7 +6,6 @@ You will need to have the following environment variables defined. |---------------------------------|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|--------| | `CLIENT_TENANT` | eg. `osdu` | Client tenant used for testing | no | - | | `OSDU_TENANT` | eg. `osdu` | OSDU tenant used for testing | no | - | -| `ENVIRONMENT` | eg. `dev` | Environment used for testing. 'Local' for running locally with services url's predefined as http://localhost , 'Dev' & 'Dev_Gke' is configurable environment | no | - | | `GROUP_ID` | eg. `group` | Group ID used for testing. Group id, used in storage record ACL. Full group will be "data.default.viewers@{{data-partition-id}}.{{group_id}}" | no | - | | `TOPIC_ID` | eg. `records-changed` | Topic ID | no | - | | `HMAC_SECRET` | eg. `123456789` | String in hex , must match pattern ^[a-zA-Z0-9]{8,30}+$ & be in register variable SUBSCRIBER_SECRET | yes | - | diff --git a/notification-acceptance-test/src/test/java/org/opengroup/osdu/notification/util/Config.java b/notification-acceptance-test/src/test/java/org/opengroup/osdu/notification/util/Config.java index 29a39b08909ee45cf609a4445f5810801934c632..5c3e0a02670b204b21c6ee0358840c0fe90003f6 100644 --- a/notification-acceptance-test/src/test/java/org/opengroup/osdu/notification/util/Config.java +++ b/notification-acceptance-test/src/test/java/org/opengroup/osdu/notification/util/Config.java @@ -45,36 +45,21 @@ public class Config { config.RetryCount = getEnvironmentVariableOrDefaultValue("RETRY_COUNT", "3"); config.hmacSecretValue = System.getProperty("HMAC_SECRET", System.getenv("HMAC_SECRET")); config.GSATestIsEnabled = Boolean.parseBoolean(getEnvironmentVariableOrDefaultValue("GSA_TEST_ENABLED", "false").trim().toLowerCase()); - if (env.equalsIgnoreCase("LOCAL")) { - //make sure to run register service on a different port. You can also choose to point to Register service that is running in cloud - String registerUrl = "http://localhost:8081/api/register/v1"; - //must have notification and register services running on different ports - config.HostUrl = "http://localhost:8080/"; - config.GSAPushUrl = registerUrl + "/test/gsa-challenge/"; - config.HMACPushUrl = registerUrl + "/test/challenge/"; + String registerUrl = System.getProperty("REGISTER_BASE_URL", System.getenv("REGISTER_BASE_URL")); + config.HostUrl = System.getProperty("NOTIFICATION_BASE_URL", System.getenv("NOTIFICATION_BASE_URL")); + config.GSAPushUrl = registerUrl + "/test/gsa-challenge/"; + //Adding this so CPs can point to custom HMAC push endpoints + config.HMACPushUrl = getEnvironmentVariableOrDefaultValue("REGISTER_CUSTOM_PUSH_URL_HMAC", registerUrl + "/test/challenge/"); + //Adding a new variable NOTIFICATION_REGISTER_BASE_URL since REGISTER_BASE_URL is used by Register integration tests which needs a trailing \ + String regUrl = getEnvironmentVariable("NOTIFICATION_REGISTER_BASE_URL"); + config.StorageServicePath = getEnvironmentVariable("STORAGE_HOST"); + config.LegalServicePath = System.getProperty("LEGAL_URL", System.getenv("LEGAL_URL")); + if (regUrl == null) { config.RegisterServicePath = registerUrl; - config.StorageServicePath = "http://localhost:8085/api/storage/v2/"; - config.LegalServicePath = "http://localhost:8087/api/legal/v1/"; - - } else if (env.equalsIgnoreCase("DEV") || isGke() || env.equalsIgnoreCase("CLOUD")) { - String registerUrl = System.getProperty("REGISTER_BASE_URL", System.getenv("REGISTER_BASE_URL")); - config.HostUrl = System.getProperty("NOTIFICATION_BASE_URL", System.getenv("NOTIFICATION_BASE_URL")); - config.GSAPushUrl = registerUrl + "/test/gsa-challenge/"; - //Adding this so CPs can point to custom HMAC push endpoints - config.HMACPushUrl = getEnvironmentVariableOrDefaultValue("REGISTER_CUSTOM_PUSH_URL_HMAC", registerUrl + "/test/challenge/"); - //Adding a new variable NOTIFICATION_REGISTER_BASE_URL since REGISTER_BASE_URL is used by Register integration tests which needs a trailing \ - String regUrl = getEnvironmentVariable("NOTIFICATION_REGISTER_BASE_URL"); - config.StorageServicePath = getEnvironmentVariable("STORAGE_HOST"); - config.LegalServicePath = System.getProperty("LEGAL_URL", System.getenv("LEGAL_URL")); - if (regUrl == null) { - config.RegisterServicePath = registerUrl; - } else { - config.RegisterServicePath = regUrl + "/api/register/v1"; - } - - } else - throw new RuntimeException("$ENVIRONMENT environment variable not provided"); + } else { + config.RegisterServicePath = regUrl + "/api/register/v1"; + } System.out.println("HostUrl=" + config.HostUrl); System.out.println("config.Topic=" + config.Topic);