Skip to content
Snippets Groups Projects
Commit ca9c3c77 authored by Rucha Deshpande's avatar Rucha Deshpande
Browse files

Generate SubscriptionId for int test

parent 0f863d3b
No related branches found
No related tags found
1 merge request!27Feat/aws impl3
Pipeline #12536 passed
......@@ -16,6 +16,10 @@
package org.opengroup.osdu.register.util;
import com.google.common.base.Strings;
import java.util.Base64;
public class Config {
public String HostUrl;
public String securePushUrl;
......@@ -33,12 +37,16 @@ public class Config {
if (env.equalsIgnoreCase("LOCAL")) {
config.HostUrl = System.getProperty("REGISTER_BASE_URL", System.getenv("REGISTER_BASE_URL"));
config.securePushUrl = "https://localhost:8080/";
config.securePushUrl= getEnvironmentVariableOrDefaultValue("REGISTER_LOCAL_PUSH_URL","https://localhost:8080/");
config.subscriptionId = System.getProperty("TEST_SUBSCRIPTION_ID", System.getenv("TEST_SUBSCRIPTION_ID"));
config.subscriptionId = Base64.getEncoder().encodeToString(("records-changed"+ config.securePushUrl).getBytes());
config.PushUrl = config.HostUrl;
} else if (env.equalsIgnoreCase("DEV")) {
String custom_push_url = System.getProperty("REGISTER_CUSTOM_PUSH_URL1", System.getenv("REGISTER_CUSTOM_PUSH_URL1"));
config.subscriptionId = getEnvironmentVariableOrDefaultValue("SUBSCRIPTION_ID",
"cmVjb3Jkcy1jaGFuZ2VkaHR0cHM6Ly9vcy1yZWdpc3Rlci1kb3Qtb3BlbmRlcy5hcHBzcG90LmNvbS9hcGkvcmVnaXN0ZXIvdjEvdGVzdC9jaGFsbGVuZ2UvMQ==");
genSubscriptionId(custom_push_url));
config.HostUrl = System.getProperty("REGISTER_BASE_URL", System.getenv("REGISTER_BASE_URL"));
config.securePushUrl = config.HostUrl;
config.PushUrl = config.HostUrl;
......@@ -61,4 +69,9 @@ public class Config {
private static String getEnvironmentVariable(String propertyKey) {
return System.getProperty(propertyKey, System.getenv(propertyKey));
}
private static String genSubscriptionId(String custom_push_url)
{
return Base64.getEncoder().encodeToString(("records-changed"+ custom_push_url).getBytes());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment