diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 342908b2ac3338cddbf74f805983c9dbeb7deb6a..3840a1f6b9ad80cfa7559d07be554668f604cdac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,12 +39,10 @@ include: file: "cloud-providers/gc-global.yml" - project: "osdu/platform/ci-cd-pipelines" - file: "cloud-providers/aws-global.yml" + file: "cloud-providers/ibm.yml" - - project: "osdu/platform/ci-cd-pipelines" - file: "cloud-providers/aws-maven.yml" + # aws + - local: "devops/aws/pipeline/override-stages.yml" - - project: "osdu/platform/ci-cd-pipelines" - file: "cloud-providers/ibm.yml" + - local: "devops/gc/pipeline/override-stages.yml" - - local: "devops/gc/pipeline/override-stages.yml" \ No newline at end of file diff --git a/NOTICE b/NOTICE index 34b18655d3fd82b8aa1598474aa77c791e96c306..b1deb65eb3d0ab0da6a889ec666f7a9652025b31 100644 --- a/NOTICE +++ b/NOTICE @@ -60,8 +60,10 @@ The following software have components provided under the terms of this license: - Apache Geronimo JMS Spec 2.0 (from http://geronimo.apache.org/maven/${siteId}/${version}) - Apache Groovy (from http://groovy-lang.org, http://groovy.codehaus.org/, https://groovy-lang.org) - Apache HTTP transport v2 for the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-apache-v2) -- Apache HttpClient (from http://hc.apache.org/httpcomponents-client, http://hc.apache.org/httpcomponents-client-ga) +- Apache HttpClient (from http://hc.apache.org/httpcomponents-client, http://hc.apache.org/httpcomponents-client-ga, https://repo1.maven.org/maven2/org/apache/httpcomponents/client5/httpclient5) - Apache HttpClient Cache (from http://hc.apache.org/httpcomponents-client, http://hc.apache.org/httpcomponents-client-ga) +- Apache HttpComponents Core HTTP/1.1 (from https://repo1.maven.org/maven2/org/apache/httpcomponents/core5/httpcore5) +- Apache HttpComponents Core HTTP/2 (from https://repo1.maven.org/maven2/org/apache/httpcomponents/core5/httpcore5-h2) - Apache HttpCore (from http://hc.apache.org/httpcomponents-core-ga, http://hc.apache.org/httpcomponents-core-ga/, http://hc.apache.org/httpcomponents-core/) - Apache Log4j API (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api) - Apache Log4j Core (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core) @@ -156,7 +158,6 @@ The following software have components provided under the terms of this license: - Kotlin Stdlib Common (from https://kotlinlang.org/) - Kotlin Stdlib Jdk7 (from <https://kotlinlang.org/>, https://kotlinlang.org/) - Kotlin Stdlib Jdk8 (from <https://kotlinlang.org/>, https://kotlinlang.org/) -- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Lucene Core (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-core) - Metrics Core (from https://repo1.maven.org/maven2/io/dropwizard/metrics/metrics-core) - Microsoft Application Insights Java Agent (from https://github.com/Microsoft/ApplicationInsights-Java) @@ -329,6 +330,7 @@ The following software have components provided under the terms of this license: - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - Jodd BeanUtil (from http://jodd.org) - Jodd Core (from http://jodd.org) +- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Stax2 API (from http://github.com/FasterXML/stax2-api) ======================================================================== @@ -339,6 +341,7 @@ The following software have components provided under the terms of this license: - API Common (from https://github.com/googleapis, https://github.com/googleapis/api-common-java, https://repo1.maven.org/maven2/com/google/api/api-common) - ASM Core (from http://asm.ow2.io/, http://asm.ow2.org/) - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) +- FindBugs-jsr305 (from http://findbugs.sourceforge.net/) - GAX (Google Api eXtensions) for Java (Core) (from https://github.com/googleapis, https://github.com/googleapis/gax-java, https://repo1.maven.org/maven2/com/google/api/gax) - GAX (Google Api eXtensions) for Java (gRPC) (from <https://repo1.maven.org/maven2/com/google/api/gax-grpc>, https://repo1.maven.org/maven2/com/google/api/gax-grpc) - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client) @@ -445,6 +448,13 @@ The following software have components provided under the terms of this license: - JUnit (from http://junit.org) +======================================================================== +EDL-1.0 +======================================================================== +The following software have components provided under the terms of this license: + +- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) + ======================================================================== EPL-1.0 ======================================================================== @@ -457,10 +467,8 @@ The following software have components provided under the terms of this license: - JUnit Jupiter Params (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Platform Commons (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Platform Engine API (from http://junit.org/junit5/, https://junit.org/junit5/) -- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) - Jakarta Bean Validation API (from https://beanvalidation.org) -- Jakarta Servlet (from https://projects.eclipse.org/projects/ee4j.servlet) - Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) - Java Servlet 4.0 API @@ -529,7 +537,6 @@ GPL-3.0-only The following software have components provided under the terms of this license: - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) -- Jakarta Servlet (from https://projects.eclipse.org/projects/ee4j.servlet) - Java Servlet 4.0 API ======================================================================== @@ -687,13 +694,6 @@ The following software have components provided under the terms of this license: - Reflections (from http://code.google.com/p/reflections/, http://github.com/ronmamo/reflections) -======================================================================== -X11 -======================================================================== -The following software have components provided under the terms of this license: - -- Guava: Google Core Libraries for Java (from http://code.google.com/p/guava-libraries, https://github.com/google/guava, https://repo1.maven.org/maven2/com/google/guava/guava) - ======================================================================== cc-pd ======================================================================== @@ -717,7 +717,6 @@ The following software have components provided under the terms of this license: - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - JBoss Logging 3 (from http://www.jboss.org) - JSON in Java (from https://github.com/douglascrockford/JSON-java) -- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java) - Undertow Core (from <https://repo1.maven.org/maven2/io/undertow/undertow-core>, https://repo1.maven.org/maven2/io/undertow/undertow-core) - Undertow Servlet (from <https://repo1.maven.org/maven2/io/undertow/undertow-servlet>, https://repo1.maven.org/maven2/io/undertow/undertow-servlet) @@ -731,4 +730,3 @@ unknown The following software have components provided under the terms of this license: - JUnit Jupiter (Aggregator) (from https://junit.org/junit5/) -- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) diff --git a/devops/aws/pipeline/override-stages.yml b/devops/aws/pipeline/override-stages.yml new file mode 100644 index 0000000000000000000000000000000000000000..16fb9baf7e4788cbf4a6ad3f0d0cad54986633b0 --- /dev/null +++ b/devops/aws/pipeline/override-stages.yml @@ -0,0 +1,20 @@ +include: + - project: "osdu/platform/ci-cd-pipelines" + file: "cloud-providers/aws-global.yml" + - project: "osdu/platform/ci-cd-pipelines" + file: "cloud-providers/aws-global-variables.yml" + - project: "osdu/platform/ci-cd-pipelines" + file: "cloud-providers/aws-global.yml" + - project: "osdu/platform/ci-cd-pipelines" + file: "cloud-providers/aws-maven.yml" + +aws-test-java: + script: + - export KUBECONFIG=/tmp/kubeconfig-${RANDOM}.yaml + - echo "ROLE $EKS_CLUSTER_MGMT_ROLE" + - echo "CLUSTER $EKS_CLUSTER_NAME" + - aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER_NAME --role-arn $EKS_CLUSTER_MGMT_ROLE + - chmod 600 $KUBECONFIG + + - $MAVEN_BUILD $INTEGRATION_TEST_DIR maven-aws-integration-test-output.log ${AWS_MAVEN_TEST_COMMAND_OVERRIDE:-test} --update-snapshots -DdisableXmlReport=true + diff --git a/notification-core/pom.xml b/notification-core/pom.xml index 771aeb97e359b10b5258f90a947bf710d9821758..593971887ecc6a037e6529607a597bbb6834ce16 100644 --- a/notification-core/pom.xml +++ b/notification-core/pom.xml @@ -19,7 +19,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-core</name> <description>Core module for the notification service</description> <packaging>jar</packaging> @@ -27,7 +27,7 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> @@ -42,6 +42,7 @@ <google-oauth-client.version>1.33.3</google-oauth-client.version> <google-api-client.version>1.33.2</google-api-client.version> <xnio-api.version>3.8.8.Final</xnio-api.version> + <guava.version>32.1.2-jre</guava.version> </properties> <dependencyManagement> @@ -81,7 +82,7 @@ <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> - <version>27.0-jre</version> + <version>${guava.version}</version> </dependency> <dependency> <groupId>javax.xml.bind</groupId> diff --git a/pom.xml b/pom.xml index 422105a73b5907e1bca399b5c91ed40625108c3e..d1682921a4031491d771d18f36fb42c2b88d7b24 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <description>Root Notification Service project</description> <properties> diff --git a/provider/notification-aws/pom.xml b/provider/notification-aws/pom.xml index 52c3947c3440551c1923397f70a032906452f2da..66898238af4ca7fb177c81e8d0f03e2206a7fffb 100644 --- a/provider/notification-aws/pom.xml +++ b/provider/notification-aws/pom.xml @@ -19,7 +19,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-aws</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-aws</name> <description>AWS implementation for Notification service</description> <packaging>jar</packaging> @@ -27,7 +27,7 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> @@ -76,7 +76,7 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> - <version>0.21.0</version> + <version>0.23.0</version> </dependency> <dependency> <groupId>commons-io</groupId> @@ -95,7 +95,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> </dependency> <dependency> diff --git a/provider/notification-azure/pom.xml b/provider/notification-azure/pom.xml index 9335f0c0f979b2bc47bdf6374d3e68887da1f034..8818fc21d221b7d55f94020c63e6535ca22489dd 100644 --- a/provider/notification-azure/pom.xml +++ b/provider/notification-azure/pom.xml @@ -18,7 +18,7 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>notification-azure</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-azure</name> <description>Azure implementation for Notification service</description> <packaging>jar</packaging> @@ -26,7 +26,7 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> @@ -35,7 +35,7 @@ <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> <jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version> - <osdu.notification-core.version>0.23.0-SNAPSHOT</osdu.notification-core.version> + <osdu.notification-core.version>0.24.0-SNAPSHOT</osdu.notification-core.version> <springframework.version>4.3.0.RELEASE</springframework.version> <reactor.netty.version>0.11.0.RELEASE</reactor.netty.version> <reactor.core.version>3.3.0.RELEASE</reactor.core.version> diff --git a/provider/notification-gc/pom.xml b/provider/notification-gc/pom.xml index c6c251f455c5bb463801b1b705ed02d9af55506a..a5366bf93c6e7976d27c729c5f25bf12c86ffb38 100644 --- a/provider/notification-gc/pom.xml +++ b/provider/notification-gc/pom.xml @@ -17,7 +17,7 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>notification-gc</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-gc</name> <description>Google Cloud implementation for Notification service</description> <packaging>jar</packaging> @@ -25,7 +25,7 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> @@ -63,7 +63,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <exclusions> <exclusion> <groupId>com.google.apis</groupId> diff --git a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/config/ExternalSubscriptionsManager.java b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/config/ExternalSubscriptionsManager.java index 1755d01a60f1dbd66274026c8babcdd2b6f895cc..4b4cdc9e074b85c4a32606ea79c2f900126c3ddc 100644 --- a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/config/ExternalSubscriptionsManager.java +++ b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/config/ExternalSubscriptionsManager.java @@ -50,12 +50,17 @@ public class ExternalSubscriptionsManager { List<Subscription> cachedInfos = Optional.ofNullable(getExternalSubscriptions(dataPartitionId)) .orElseThrow(() -> new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Server error", "OQM | Subscription info cache was not initialized")) .getSubscriptions(); - List<Subscription> filteredCachedInfos = filterSubscriptionInfosByTopic(cachedInfos, subscriptionId, serviceTopic); - if (filteredCachedInfos.isEmpty()) { - return sendGetSubscriptionRequest(dataPartitionId, subscriptionId, serviceTopic, cachedInfos); + return getFilteredSubscription(cachedInfos, dataPartitionId, subscriptionId, serviceTopic); + } + + private Subscription getFilteredSubscription(List<Subscription> subscriptions, String dataPartitionId, + String subscriptionId, String serviceTopic) { + List<Subscription> filteredInfos = filterSubscriptionInfosByTopic(subscriptions, subscriptionId, serviceTopic); + if (filteredInfos.isEmpty()) { + return sendGetSubscriptionRequest(dataPartitionId, subscriptionId, serviceTopic, subscriptions); } else { - log.debug("Register client cache | `{}` subscriptions info found. The first was taken.", filteredCachedInfos.size()); - return filteredCachedInfos.get(0); + log.debug("Register client cache | `{}` subscriptions info found. The first was taken.", filteredInfos.size()); + return filteredInfos.get(0); } } @@ -72,7 +77,7 @@ public class ExternalSubscriptionsManager { private void reloadSubscriptionInfoCache(String dataPartitionId) { List<Subscription> subscriptionInfos = subscriptionHandler.getAllSubscriptionInfos(dataPartitionId); List<Subscription> enrichedSubscriptionInfos = subscriptionInfos.stream() - .map(subscription -> getSubscription(dataPartitionId, subscription.getNotificationId(), subscription.getTopic())) + .map(subscription -> getFilteredSubscription(subscriptionInfos, dataPartitionId, subscription.getNotificationId(), subscription.getTopic())) .collect(Collectors.toList()); subscriptionInfoCache.put(dataPartitionId, ExternalSubscriptions.builder().subscriptions(enrichedSubscriptionInfos).build()); log.debug("Subscription info cache PRELOADED for tenant: {}. Size is: {}.", dataPartitionId, enrichedSubscriptionInfos.size()); @@ -102,4 +107,4 @@ public class ExternalSubscriptionsManager { .filter(info -> serviceTopic.equals(info.getTopic()) && subscriptionId.equals(info.getNotificationId())) .collect(Collectors.toList()); } -} +} \ No newline at end of file diff --git a/provider/notification-ibm/pom.xml b/provider/notification-ibm/pom.xml index e8d9b2f14d625f255eb79ca3e651f111dbf4c75d..26a206db4debe314c095e0464f1cab07013b65b8 100644 --- a/provider/notification-ibm/pom.xml +++ b/provider/notification-ibm/pom.xml @@ -16,7 +16,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-ibm</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-ibm</name> <description>IBM implementation for Notification service</description> <packaging>jar</packaging> @@ -24,7 +24,7 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> @@ -114,7 +114,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <exclusions> <exclusion> <groupId>io.netty</groupId> diff --git a/testing/notification-test-aws/pom.xml b/testing/notification-test-aws/pom.xml index 3b2ee94cdbae2adc5c665d3508b5081d312058c2..f04e39bce291b3be52e6d612494343cbcb695896 100644 --- a/testing/notification-test-aws/pom.xml +++ b/testing/notification-test-aws/pom.xml @@ -21,13 +21,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-test-aws</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-test-aws</name> <description>AWS Integration tests for Notification Service</description> <packaging>jar</packaging> @@ -44,7 +44,7 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> - <version>0.21.0</version> + <version>0.23.0</version> </dependency> <dependency> <groupId>com.amazonaws</groupId> @@ -54,12 +54,12 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-common</artifactId> - <version>0.21.0</version> + <version>0.22.0-rc4</version> </dependency> <dependency> diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/LegalTagUtils.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/LegalTagUtils.java index 0860938624cb9568baf43ab8e6b3f010502d6c5a..43fc4e536ecb1349b78dad6af60039221b2417a2 100644 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/LegalTagUtils.java +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/LegalTagUtils.java @@ -34,9 +34,6 @@ public class LegalTagUtils { protected static String getLegalUrl() { String legalUrl = System.getProperty("LEGAL_URL", System.getenv("LEGAL_URL")); - if (legalUrl == null || legalUrl.contains("-null")) { - legalUrl = "https://os-legal-dot-opendes.appspot.com/api/legal/v1/"; - } return legalUrl; } diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/RecordUtils.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/RecordUtils.java index adef2dece6f330791b0903c877a2d1a1c9f793ef..4c7516521b60be54f03de9e533b9912c397c3a84 100644 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/RecordUtils.java +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/RecordUtils.java @@ -77,16 +77,7 @@ public class RecordUtils { } public static String getAclSuffix(boolean isTestPartition) { - String environment = getEnvironment(); - //build.gradle currently throws exception if a variable is set to empty or not set at all - //workaround by setting it to an "empty" string to construct the url - if (!environment.isEmpty()) - environment = "." + environment; - - return String.format("%s%s.%s", TenantUtils.getTenantName(isTestPartition), environment, domain); + return String.format("%s.%s", TenantUtils.getTenantName(isTestPartition), domain); } - public static String getEnvironment() { - return System.getProperty("DEPLOY_ENV", System.getenv("DEPLOY_ENV")); - } } diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/StorageTestUtils.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/StorageTestUtils.java index befe028631c6ef0054f7308ea5773902e668b1b6..fd7a216d0a7b19ea6265eab24b2610e9b8b5895c 100644 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/StorageTestUtils.java +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/StorageTestUtils.java @@ -54,9 +54,6 @@ public class StorageTestUtils { public static String getApiPath(String api) throws Exception { String baseUrl = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")); - if (baseUrl == null || baseUrl.contains("-null")) { - baseUrl = "https://localhost:8443/api/storage/v2/"; - } URL mergedURL = new URL(baseUrl + api); System.out.println(mergedURL.toString()); return mergedURL.toString(); diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/TestNotificationsEndpoint.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/TestNotificationsEndpoint.java index 751f96afb64b1823a23d50653a041fec3565f67d..e5b9b32ce21bdb80172070c230776c5f2a645fb6 100644 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/TestNotificationsEndpoint.java +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/TestNotificationsEndpoint.java @@ -123,12 +123,14 @@ public class TestNotificationsEndpoint extends TestBase { //Run Bash File to fetch logs from register endpoint and verify that notification was received String bashFileToExecute = "src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh " + correlationId; + Process process = Runtime.getRuntime().exec(bashFileToExecute); process.waitFor(); + int exitValue = process.exitValue(); assertEquals(exitValue, 0); } catch (Exception e) { - System.out.println("Error while verifying notification service. Error = " + e.getMessage() + " Stack Trace = " + Arrays.toString(e.getStackTrace())); + throw e; } finally { awssubscriptionService.delete(subscriptionId_TestPartition); } diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh old mode 100644 new mode 100755 index 6832babe4761f27a9da3d986bc1194f32af61979..bacda8d64af7d7f2aa14789f7e97b372158ad0b0 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh @@ -1,8 +1,9 @@ -register_pod=$(kubectl get pods --all-namespaces -o=jsonpath='{range .items..metadata}{.name}{"\n"}{end}' | fgrep os-register-) -register_logs=$(kubectl logs $register_pod -n osdu-instance-$OSDU_INSTANCE_NAME-core --since=2m) +CORE_K8S_NAMESPACE="$AWS_SERVICE_NAMESPACE-core" +register_pod=$(kubectl get pods -n $CORE_K8S_NAMESPACE | grep "Running" | grep "os-register" | awk '{ print $1 }') +register_logs=$(kubectl logs $register_pod -n $CORE_K8S_NAMESPACE --since=2m) if echo $register_logs | grep $1; then - return 0 + exit 0 else - return 1 -fi \ No newline at end of file + exit 1 +fi diff --git a/testing/notification-test-azure/pom.xml b/testing/notification-test-azure/pom.xml index 7d49aae010d6260e15ef0710c1da803fb05393c0..b08ad2176c543589f5fd36919bfbbc67b6ef3c70 100644 --- a/testing/notification-test-azure/pom.xml +++ b/testing/notification-test-azure/pom.xml @@ -21,13 +21,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-test-azure</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-test-azure</name> <description>Integration tests Azure for notification</description> <packaging>jar</packaging> @@ -42,7 +42,7 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> </dependency> <dependency> diff --git a/testing/notification-test-baremetal/pom.xml b/testing/notification-test-baremetal/pom.xml index ace0cf2d9173666f37747b0fe54e698d40f60309..2f89c8c9f75e65c24bde6e091eb3a9effde164db 100644 --- a/testing/notification-test-baremetal/pom.xml +++ b/testing/notification-test-baremetal/pom.xml @@ -21,12 +21,12 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <artifactId>notification-test-baremetal</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-test-baremetal</name> <description>Integration tests Baremetal for notification</description> <packaging>jar</packaging> @@ -41,7 +41,7 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> diff --git a/testing/notification-test-core/pom.xml b/testing/notification-test-core/pom.xml index 30aac87840e2170cc4905f26c2657c2b42e7077b..62c2ae63420167e7d8a7f34e14958f7fd9c73f37 100644 --- a/testing/notification-test-core/pom.xml +++ b/testing/notification-test-core/pom.xml @@ -21,13 +21,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-test-core</name> <description>Integration tests core for notification</description> <packaging>jar</packaging> diff --git a/testing/notification-test-gc/pom.xml b/testing/notification-test-gc/pom.xml index 1d498b77b3fe8a142d5f55818a20f2b99f3b987d..659d6c8d5148b7548c6a669680b539bd30fa3bb5 100644 --- a/testing/notification-test-gc/pom.xml +++ b/testing/notification-test-gc/pom.xml @@ -21,12 +21,12 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <artifactId>notification-test-gc</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-test-gc</name> <description>Integration tests Google Cloud for notification</description> <packaging>jar</packaging> @@ -41,7 +41,7 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> diff --git a/testing/notification-test-ibm/pom.xml b/testing/notification-test-ibm/pom.xml index f5b842d322f029f750270eacaee381f3292a1d8f..f0333f48b8ef57e3691348880eccb0b8f9db43b8 100644 --- a/testing/notification-test-ibm/pom.xml +++ b/testing/notification-test-ibm/pom.xml @@ -18,13 +18,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-test-ibm</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <name>notification-test-ibm</name> <description>Integration tests IBM for notification</description> <packaging>jar</packaging> @@ -45,7 +45,7 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> diff --git a/testing/pom.xml b/testing/pom.xml index 74d71775e7704f020ada032a62c0c6a39622d685..a766e7e3898cef072c26736d00fe0e9807afac1d 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -18,7 +18,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.23.0-SNAPSHOT</version> + <version>0.24.0-SNAPSHOT</version> <description>Root Notification Service project</description> <packaging>pom</packaging>