diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3840a1f6b9ad80cfa7559d07be554668f604cdac..3bc4d47c84f89f5d6d9149e7f6515a0c58d85998 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,3 +46,121 @@ include: - local: "devops/gc/pipeline/override-stages.yml" + +.maven: + image: maven:3.9.3-eclipse-temurin-17 + tags: ['osdu-medium'] + variables: + MAVEN_REPO_PATH: "$CI_PROJECT_DIR/.m2/repository" + MAVEN_CLI_OPTS: "--batch-mode --settings=$CI_PROJECT_DIR/.mvn/community-maven.settings.xml" + + cache: + paths: + - $MAVEN_REPO_PATH + + artifacts: + paths: + - ./**/target/*.jar + - ./**/maven-*-output.txt + when: always + expire_in: 2 days + + before_script: + - | # Check for the presence of a maven wrapper script + apt-get update && apt-get install -y python3 + if [ -e "$CI_PROJECT_DIR/mvnw" ]; then + export MAVEN_BINARY="$CI_PROJECT_DIR/mvnw" + unset MAVEN_CONFIG + mkdir -pv .mvn/wrapper + else + export MAVEN_BINARY="mvn" + fi + - export MAVEN="$MAVEN_BINARY $MAVEN_CLI_OPTS -Dmaven.repo.local=$MAVEN_REPO_PATH" + - echo $MAVEN_BINARY + - echo $MAVEN_CLI_OPTS + - echo $MAVEN_REPO_PATH + - echo $MAVEN + - mkdir -pv $MAVEN_REPO_PATH + - export ALL_MAVEN_BUILD_DIRS_Z=$(mktemp) + - python3 --version + + # This scans for all pom.xml files that aren't listed as a child pom (as + # determine by the presence of a <parent> tag). + - | + (python3 | sort -z > $ALL_MAVEN_BUILD_DIRS_Z) <<EOF + from xml.dom.minidom import parse + import os + import sys + + allPomFiles = set() + submoduleFiles = set() + + for root, dirnames, filenames in os.walk(os.environ['CI_PROJECT_DIR']): + if 'pom.xml' in filenames: + pomFile = os.path.join(root, 'pom.xml') + allPomFiles.add(pomFile) + + dom = parse(pomFile) + for modules in dom.getElementsByTagName('modules'): + for module in modules.getElementsByTagName('module'): + submoduleFiles.add(os.path.join(root, module.firstChild.nodeValue, "pom.xml")) + + for pomFile in allPomFiles: + if pomFile not in submoduleFiles: + dir = os.path.dirname(pomFile) + sys.stdout.write(dir + '\0') + EOF + - xargs -0rn 1 echo < $ALL_MAVEN_BUILD_DIRS_Z + + # This creates a script for running maven, capturing output to a file. + # - First argument is the directory to build from + # - Second argument is the name to use for the logfile + # - The remaining arguments are the maven command to run + - export MAVEN_BUILD=$(tempfile -m 755 -p build -s .sh) + - echo "#!/bin/bash" > $MAVEN_BUILD + - | + cat >> $MAVEN_BUILD <<EOF + id=maven_build_\$(echo "\$@" | sha1sum | head -c 7) + cd "\$1"; shift + outputFile="\$1"; shift + + echo "********************************************************************************" + echo -e "\e[0Ksection_start:\$(date +%s):\${id}\r\e[0K\e[1m\$(pwd)\e[0m" + echo -e "\e[32;1m\$MAVEN" "\$@" "\e[0m" + + if \$MAVEN "\$@" > "\$outputFile" 2>&1; then + tail -n 25 "\$outputFile"; + echo -e "\e[36m**** Showing the last 25 lines of the passed build (above). See Job artifacts for full log details *****\e[0m"; + echo -e "\e[0Ksection_end:\$(date +%s):\${id}\r\e[0K" + else + tail -n 200 "\$outputFile"; + echo -e "\e[31m**** Showing the last 200 lines of the failed build (above). See Job artifacts for full log details *****\e[0m"; + echo -e "\e[0Ksection_end:\$(date +%s):\${id}\r\e[0K" + exit 255; + fi + EOF + + # This creates a script for applying the $MAVEN_BUILD script to all build directories + - export MAVEN_FOREACH=$(tempfile -m 755 -p fr-ec -s .sh) + - echo "#!/bin/sh" > $MAVEN_FOREACH + - echo 'xargs -0rI {} $MAVEN_BUILD {} "$@" < $ALL_MAVEN_BUILD_DIRS_Z' >> $MAVEN_FOREACH + +gemnasium-maven-dependency_scanning: + variables: + DS_JAVA_VERSION: 17 + +azure_containerize: + variables: + AZURE_CONTAINERIZE_REPOSITORY: "-b jdk-17 https://gitlab-ci-token:${CI_JOB_TOKEN}@community.opengroup.org/osdu/platform/deployment-and-operations/base-containers-azure/service-base-image" + +azure_test: + image: community.opengroup.org:5555/osdu/platform/deployment-and-operations/base-containers-azure/azure-maven17:v0.0.1 + +aws-test-java: + image: $CI_REGISTRY/osdu/platform/deployment-and-operations/base-containers-aws/aws-maven/aws-maven:v2.0 + + +fossa-analyze: + image: $CI_REGISTRY/divido/fossa-with-cache:v0.9-jdk17 +fossa-check-notice: + image: $CI_REGISTRY/divido/fossa-with-cache:v0.9-jdk17 diff --git a/NOTICE b/NOTICE index fe4dea75314695b33b50da63aea276ef9e3c65d9..c45d185e0bc6e26ef4de23c2456fe1ef2569cb44 100644 --- a/NOTICE +++ b/NOTICE @@ -196,6 +196,8 @@ The following software have components provided under the terms of this license: - OkHttp Logging Interceptor (from https://github.com/square/okhttp, https://repo1.maven.org/maven2/com/squareup/okhttp3/logging-interceptor, https://square.github.io/okhttp/) - OkHttp URLConnection (from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-urlconnection, https://square.github.io/okhttp/) - Okio (from https://github.com/square/okio/, https://repo1.maven.org/maven2/com/squareup/okio/okio) +- Old JAXB Core (from <https://eclipse-ee4j.github.io/jaxb-ri/>, https://eclipse-ee4j.github.io/jaxb-ri/) +- Old JAXB Runtime (from https://eclipse-ee4j.github.io/jaxb-ri/, https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl) - OpenCensus (from https://github.com/census-instrumentation/opencensus-java, https://github.com/census-instrumentation/opencensus-proto) - PWDB :: Database (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/database) - PowerMock (from http://www.powermock.org, https://repo1.maven.org/maven2/org/powermock/powermock-api-mockito) @@ -337,6 +339,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/) +- Angus Activation Registries (from https://repo1.maven.org/maven2/org/eclipse/angus/angus-activation) - 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) @@ -359,6 +362,8 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) - Mockito (from http://mockito.org, http://www.mockito.org, https://github.com/mockito/mockito) - Netty/Codec/HTTP (from https://repo1.maven.org/maven2/io/netty/netty-codec-http) +- Old JAXB Core (from <https://eclipse-ee4j.github.io/jaxb-ri/>, https://eclipse-ee4j.github.io/jaxb-ri/) +- Old JAXB Runtime (from https://eclipse-ee4j.github.io/jaxb-ri/, https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl) - Protocol Buffer Java API (from http://code.google.com/p/protobuf, https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java) - Protocol Buffers [Util] (from https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util) - RE2/J (from http://github.com/google/re2j) @@ -457,6 +462,7 @@ EPL-1.0 ======================================================================== The following software have components provided under the terms of this license: +- Angus Activation Registries (from https://repo1.maven.org/maven2/org/eclipse/angus/angus-activation) - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) - JUnit Jupiter (Aggregator) (from https://junit.org/junit5/) - JUnit Jupiter API (from http://junit.org/junit5/, https://junit.org/junit5/) @@ -464,6 +470,7 @@ 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/) +- JUnit Vintage Engine (from http://junit.org/junit5/, https://junit.org/junit5/) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) - Jakarta Bean Validation API (from https://beanvalidation.org) - 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) @@ -477,12 +484,15 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) +- Old JAXB Core (from <https://eclipse-ee4j.github.io/jaxb-ri/>, https://eclipse-ee4j.github.io/jaxb-ri/) +- Old JAXB Runtime (from https://eclipse-ee4j.github.io/jaxb-ri/, https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl) ======================================================================== EPL-2.0 ======================================================================== The following software have components provided under the terms of this license: +- Angus Activation Registries (from https://repo1.maven.org/maven2/org/eclipse/angus/angus-activation) - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) - JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - JUnit Jupiter (Aggregator) (from https://junit.org/junit5/) @@ -491,6 +501,7 @@ 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/) +- JUnit Vintage Engine (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) @@ -498,6 +509,8 @@ The following software have components provided under the terms of this license: - 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 +- Old JAXB Core (from <https://eclipse-ee4j.github.io/jaxb-ri/>, https://eclipse-ee4j.github.io/jaxb-ri/) +- Old JAXB Runtime (from https://eclipse-ee4j.github.io/jaxb-ri/, https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl) ======================================================================== GPL-2.0-only @@ -515,6 +528,7 @@ GPL-2.0-with-classpath-exception ======================================================================== The following software have components provided under the terms of this license: +- Angus Activation Registries (from https://repo1.maven.org/maven2/org/eclipse/angus/angus-activation) - JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - 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) @@ -525,6 +539,8 @@ The following software have components provided under the terms of this license: - Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) - Java Servlet 4.0 API - JavaBeans Activation Framework (from <http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp>, http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp, https://repo1.maven.org/maven2/com/sun/activation/javax.activation) +- Old JAXB Core (from <https://eclipse-ee4j.github.io/jaxb-ri/>, https://eclipse-ee4j.github.io/jaxb-ri/) +- Old JAXB Runtime (from https://eclipse-ee4j.github.io/jaxb-ri/, https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl) - javax.annotation API (from http://jcp.org/en/jsr/detail?id=250) - tomcat-embed-core (from http://tomcat.apache.org/) @@ -630,6 +646,8 @@ The following software have components provided under the terms of this license: - MongoDB Java Driver (from http://mongodb.org/, http://www.mongodb.org, https://www.mongodb.com/) - Netty/Codec/HTTP (from https://repo1.maven.org/maven2/io/netty/netty-codec-http) - Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common) +- Old JAXB Core (from <https://eclipse-ee4j.github.io/jaxb-ri/>, https://eclipse-ee4j.github.io/jaxb-ri/) +- Old JAXB Runtime (from https://eclipse-ee4j.github.io/jaxb-ri/, https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl) - Project Lombok (from http://projectlombok.org, https://projectlombok.org) - QpidJMS Client (from https://repo1.maven.org/maven2/org/apache/qpid/qpid-jms-client) - SLF4J API Module (from http://www.slf4j.org) @@ -724,4 +742,5 @@ unknown ======================================================================== The following software have components provided under the terms of this license: +- Angus Activation Registries (from https://repo1.maven.org/maven2/org/eclipse/angus/angus-activation) - JUnit Jupiter (Aggregator) (from https://junit.org/junit5/) diff --git a/notification-core/pom.xml b/notification-core/pom.xml index 593971887ecc6a037e6529607a597bbb6834ce16..7541b26115dede2a0f525147793904042853566f 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.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-core</name> <description>Core module for the notification service</description> <packaging>jar</packaging> @@ -27,12 +27,12 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> <netty.version>4.1.70.Final</netty.version> @@ -76,7 +76,7 @@ <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>1.18.8</version> + <version>1.18.26</version> <scope>provided</scope> </dependency> <dependency> @@ -85,19 +85,20 @@ <version>${guava.version}</version> </dependency> <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> - <version>2.3.0</version> - </dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + <version>4.0.0</version> + <scope>provided</scope> + </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId> - <version>2.3.0</version> + <version>4.0.0</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> - <version>2.3.0</version> + <version>4.0.0</version> </dependency> <dependency> <groupId>com.auth0</groupId> @@ -285,7 +286,7 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> - <version>0.8.2</version> + <version>0.8.10</version> <configuration> <excludes> <exclude>**/models/*</exclude> @@ -309,6 +310,17 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>3.0.0</version> + <configuration> + <argLine> + @{argLine} --add-opens java.base/java.util=ALL-UNNAMED + --add-opens java.base/java.lang=ALL-UNNAMED + </argLine> + </configuration> + </plugin> </plugins> </build> <reporting> @@ -316,6 +328,7 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>0.8.10</version> <reportSets> <reportSet> <reports> diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationFilterTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationFilterTest.java index 5ae208b775bc12e82bf8153278d2f95891c67cd1..eb486ad3543bccf3621dc6e19c7da1ef1012694b 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationFilterTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationFilterTest.java @@ -37,8 +37,8 @@ import java.util.Map; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationServiceEntitlementsTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationServiceEntitlementsTest.java index 722c856aa9267b95ddfcae9252ec50641ced47b0..519170d6d8b282cefaac777fd9b8677c2911c8ef 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationServiceEntitlementsTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationServiceEntitlementsTest.java @@ -40,7 +40,7 @@ import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; @RunWith(PowerMockRunner.class) diff --git a/pom.xml b/pom.xml index d1682921a4031491d771d18f36fb42c2b88d7b24..f9b909cbbfcd1492a5cde25a942d197741e997f9 100644 --- a/pom.xml +++ b/pom.xml @@ -18,14 +18,14 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <description>Root Notification Service project</description> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> - <os-core-common.version>0.19.0-rc6</os-core-common.version> + <os-core-common.version>0.23.3</os-core-common.version> <log4j2.version>2.17.1</log4j2.version> <json-smart.version>2.4.7</json-smart.version> <openapi.version>1.6.14</openapi.version> @@ -104,7 +104,7 @@ <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>1.18.8</version> + <version>1.18.26</version> <scope>provided</scope> </dependency> <!-- swagger dependency --> diff --git a/provider/notification-aws/README.md b/provider/notification-aws/README.md index d639f8879d691c996b3a5ea288cc3b65ee1ac295..091526348697d16dc554548ababc416edc926167 100644 --- a/provider/notification-aws/README.md +++ b/provider/notification-aws/README.md @@ -10,9 +10,9 @@ These instructions will get you a copy of the project up and running on your loc ### Prerequisites Pre-requisites -* JDK 8 (https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html) -* Maven 3.8.3 or later -* Lombok 1.16 or later +* JDK 17 (https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/what-is-corretto-17.html) +* Maven 3.8.6 or later +* Lombok 1.18.26 or later * OSDU Instance deployed on AWS ### Service Configuration @@ -39,9 +39,9 @@ Check that maven is installed: example: ```bash $ mvn --version -Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739) -Maven home: /usr/local/Cellar/maven/3.8.3/libexec -Java version: 1.8.0_312, vendor: Amazon.com Inc., runtime: /Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home/jre +Apache Maven 3.8.6 +Maven home: /usr/local/Cellar/maven/3.8.6/libexec +Java version: 17.0.5, vendor: Amazon.com Inc., runtime: /Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home/jre ... ``` diff --git a/provider/notification-aws/build-aws/Dockerfile b/provider/notification-aws/build-aws/Dockerfile index 07b035a53cfe282396db1095e69996e612ad9e23..ad5ef0451173b7d69e42afb1d95c76a1479ccce7 100644 --- a/provider/notification-aws/build-aws/Dockerfile +++ b/provider/notification-aws/build-aws/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html -FROM amazoncorretto:8 +FROM amazoncorretto:17 ARG JAR_FILE=provider/notification-aws/target/*spring-boot.jar # Harcoding this value since Notification-core requires this variable. AWS does not use it. Might change in future diff --git a/provider/notification-aws/build-aws/buildspec.yaml b/provider/notification-aws/build-aws/buildspec.yaml index 623f56653e3c8073d4b93684f86a18cd390cddcc..f9e607cf66c9fe966f36ad6fb495d8c5d84880ed 100644 --- a/provider/notification-aws/build-aws/buildspec.yaml +++ b/provider/notification-aws/build-aws/buildspec.yaml @@ -30,13 +30,9 @@ env: phases: install: runtime-versions: - java: corretto8 + java: corretto17 commands: - # fix error noted here: https://github.com/yarnpkg/yarn/issues/7866 - - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - - if [ $(echo $CODEBUILD_SOURCE_VERSION | grep -c ^refs/heads.*) -eq 1 ]; then echo "Branch name found"; else echo "This build only supports branch builds" && exit 1; fi - - apt-get update -y -qq > /dev/null - - apt-get install -y maven -qq >/dev/null - java -version - mvn -version - mkdir -p /root/.m2 @@ -44,9 +40,6 @@ phases: - export AWS_ACCOUNT_ID=`aws sts get-caller-identity | grep Account | cut -d':' -f 2 | cut -d'"' -f 2` - export AWS_OSDU_DEV_MAVEN_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain $AWS_OSDU_DEV_MAVEN_DOMAIN --domain-owner $AWS_ACCOUNT_ID --query authorizationToken --output text` # Install git secrets - #TODO temporarily adding hotfix, due to https://github.com/awslabs/git-secrets/issues/220 - - export SAY_LOCATION=`ln -s "$(which echo)" say` - - export PATH="$PATH:$SAY_LOCATION" - git clone https://github.com/awslabs/git-secrets.git - cd git-secrets && make install && cd .. @@ -54,7 +47,10 @@ phases: pre_build: commands: - echo "Logging in to Amazon ECR..." - - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${ECR_REGISTRY} # authenticate with ECR via the AWS CLI + - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${ECR_REGISTRY} + - echo "Logging into Docker Hub..." + - docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} + build: commands: - export REPO_NAME=${PWD##*/} @@ -76,9 +72,9 @@ phases: - if [ "$GIT_SECRETS_SCAN_RESULT" = "FAILED" ]; then echo "Secrets detected!" && exit 1; fi - echo "Building primary service assemblies..." - - mvn -ntp -B test install -pl .,notification-core,provider/notification-aws -Ddeployment.environment=prod - - mvn sonar:sonar -pl .,provider/notification-aws -Dsonar.scm.provider=git -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name=${BRANCH_NAME} - + - mvn --no-transfer-progress -ntp -B test install -pl .,notification-core,provider/notification-aws -Ddeployment.environment=prod + - mvn --no-transfer-progress sonar:sonar -pl .,provider/notification-aws -Dsonar.scm.provider=git -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name=${BRANCH_NAME} + - echo "Building integration testing assemblies and gathering artifacts..." - ./testing/notification-test-aws/build-aws/prepare-dist.sh @@ -86,9 +82,6 @@ phases: - echo "--Copying Helm Charts to ${OUTPUT_DIR:-dist}--" - rsync -r devops/aws/* "${OUTPUT_DIR:-dist}" - - echo "Logging into Docker Hub..." - - docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} - - echo "Building docker image..." - docker build -f provider/notification-aws/build-aws/Dockerfile -t ${ECR_IMAGE} . - docker tag ${ECR_IMAGE} ${ECR_IMAGE_BRANCH_LATEST} diff --git a/provider/notification-aws/build-aws/entrypoint.sh b/provider/notification-aws/build-aws/entrypoint.sh index 412f71afd92e9c2ed3e50a2863cb5675c8a69b43..c372dfb636e1ff38b9f0c0bf7d89d8ccce695437 100755 --- a/provider/notification-aws/build-aws/entrypoint.sh +++ b/provider/notification-aws/build-aws/entrypoint.sh @@ -1,4 +1 @@ - - - -java $JAVA_OPTS -jar /app.jar \ No newline at end of file +java $JAVA_OPTS --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED -jar /app.jar diff --git a/provider/notification-aws/pom.xml b/provider/notification-aws/pom.xml index a3d63c2d12b67ab71ae93f79a4dfc6bf05d06014..8e3a0b0cc1cc8d6815d2fa3ad4708f6c30297e8d 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.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-aws</name> <description>AWS implementation for Notification service</description> <packaging>jar</packaging> @@ -27,12 +27,12 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> <aws.version>1.11.1018</aws.version> @@ -95,7 +95,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> </dependency> <dependency> diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/AwsGoogleServiceAccountImpl.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/AwsGoogleServiceAccountImpl.java index e4754d9a732588cb8cfbecad64cf7bae76402a11..87b6502878aa097845b21088de76341f1f617e04 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/AwsGoogleServiceAccountImpl.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/AwsGoogleServiceAccountImpl.java @@ -21,6 +21,7 @@ public class AwsGoogleServiceAccountImpl implements IGoogleServiceAccount { @Override // To do: Check if it is to be supported public String getIdToken(String keyString, String audience) { + throw new UnsupportedOperationException(); } } diff --git a/provider/notification-azure/pom.xml b/provider/notification-azure/pom.xml index 2506634bb7de288c60f2a09c51fe83255bf6575e..9ca94108c774048ebfc6c6fb3ea89fd3a65da461 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.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-azure</name> <description>Azure implementation for Notification service</description> <packaging>jar</packaging> @@ -26,21 +26,21 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <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.24.0-SNAPSHOT</osdu.notification-core.version> + <jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version> + <osdu.notification-core.version>0.25.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> - <osdu.corelibazure.version>0.21.0</osdu.corelibazure.version> - <osdu.oscorecommon.version>0.19.0-rc6</osdu.oscorecommon.version> + <osdu.corelibazure.version>0.23.2</osdu.corelibazure.version> + <osdu.oscorecommon.version>0.23.3</osdu.oscorecommon.version> <junit.version>5.6.0</junit.version> <jjwt.version>3.8.1</jjwt.version> <mockito.version>2.23.0</mockito.version> @@ -219,6 +219,12 @@ <groupId>com.azure.spring</groupId> <artifactId>azure-spring-boot-starter-active-directory</artifactId> </dependency> + <dependency> + <!-- Required for JUnit 4 tests to run --> + <groupId>org.junit.vintage</groupId> + <artifactId>junit-vintage-engine</artifactId> + <scope>test</scope> + </dependency> <!-- Test Dependencies --> <dependency> @@ -310,6 +316,7 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco-maven-plugin.version}</version> <reportSets> <reportSet> <reports> diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/GoogleServiceAccountImpl.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/GoogleServiceAccountImpl.java index 27232c16675d8466a0d94918c984f6e3951b0d47..ab1027a55ece5a25ad27a030e44b9215200e6c1c 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/GoogleServiceAccountImpl.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/GoogleServiceAccountImpl.java @@ -16,7 +16,6 @@ package org.opengroup.osdu.notification.provider.azure.util; import org.opengroup.osdu.notification.provider.interfaces.IGoogleServiceAccount; import org.springframework.stereotype.Component; -import sun.reflect.generics.reflectiveObjects.NotImplementedException; @Component public class GoogleServiceAccountImpl implements IGoogleServiceAccount { @@ -25,6 +24,6 @@ public class GoogleServiceAccountImpl implements IGoogleServiceAccount { public String getIdToken(String keyString, String audience) { // TODO : Check if it is to be supported - throw new NotImplementedException(); + throw new UnsupportedOperationException(); } } diff --git a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/util/GoogleServiceAccountImpTest.java b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/util/GoogleServiceAccountImpTest.java index a643fb4c4d83e2f268bcdb3ba66e419bcf1c97d6..21506e390511bdd261b252147a73e3624fabc2ff 100644 --- a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/util/GoogleServiceAccountImpTest.java +++ b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/util/GoogleServiceAccountImpTest.java @@ -19,7 +19,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; import org.opengroup.osdu.notification.provider.azure.util.GoogleServiceAccountImpl; -import sun.reflect.generics.reflectiveObjects.NotImplementedException; import static org.junit.Assert.fail; @@ -39,7 +38,7 @@ public class GoogleServiceAccountImpTest { // Assert fail("Should throw exception"); } catch (Exception e) { - Assertions.assertEquals(e.getClass(), NotImplementedException.class); + Assertions.assertEquals(e.getClass(), UnsupportedOperationException.class); } } } diff --git a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/util/ServiceAccountClientImplTest.java b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/util/ServiceAccountClientImplTest.java index 329b271ab0e2fed22dce1222100b6b32d04c7df1..6516eafa2451d70a8c79d7ddc5e205163fc01029 100644 --- a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/util/ServiceAccountClientImplTest.java +++ b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/util/ServiceAccountClientImplTest.java @@ -20,8 +20,6 @@ import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import org.mockito.junit.jupiter.MockitoExtension; -import org.omg.CORBA.portable.ApplicationException; import org.opengroup.osdu.azure.util.AzureServicePrincipleTokenService; import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.notification.provider.azure.util.ServiceAccountJwtAzureClientImpl; @@ -45,7 +43,7 @@ public class ServiceAccountClientImplTest { private AzureServicePrincipleTokenService azureServicePrincipleTokenService; @Test - public void shouldSuccessfullyGenerateToken() throws UnsupportedEncodingException, ApplicationException { + public void shouldSuccessfullyGenerateToken() throws UnsupportedEncodingException { when(azureServicePrincipleTokenService.getAuthorizationToken()).thenReturn(token); diff --git a/provider/notification-gc/README.md b/provider/notification-gc/README.md index 5ffd94b5957af17681a63ef3483fbd4a4a402393..930a52ade9016365861fb8497cb88ec2e728ee9b 100644 --- a/provider/notification-gc/README.md +++ b/provider/notification-gc/README.md @@ -33,8 +33,8 @@ In the current version, the OQM mapper is equipped with 2 drivers to the message #### Requirements 1. Mandatory - * Java 8 - -[Maven 3.6.0+](https://maven.apache.org/download.cgi) + * Java 17 + -[Maven 3.8.6+](https://maven.apache.org/download.cgi) 2. For Google Cloud only * GCloud command line tool @@ -56,9 +56,9 @@ Check that maven is installed: ```bash $ mvn --version -Apache Maven 3.6.0 +Apache Maven 3.8.6 Maven home: /usr/share/maven -Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: /usr/lib/jvm/jdk8u212-b04/jre +Java version: 17.0.5, Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home ... ``` diff --git a/provider/notification-gc/cloudbuild/Dockerfile.cloudbuild b/provider/notification-gc/cloudbuild/Dockerfile.cloudbuild index ed50fe0edbdc10e6129533f4661ca1a36793bc86..8260b9a9e00523c4b0ea55990c2c489e77bdf5ee 100644 --- a/provider/notification-gc/cloudbuild/Dockerfile.cloudbuild +++ b/provider/notification-gc/cloudbuild/Dockerfile.cloudbuild @@ -1,4 +1,4 @@ -FROM azul/zulu-openjdk:8-latest +FROM azul/zulu-openjdk:17 WORKDIR /app ARG PROVIDER_NAME ENV PROVIDER_NAME $PROVIDER_NAME @@ -12,4 +12,8 @@ RUN groupadd -g 10001 -r nonroot \ # Run as non-root user USER 10001:10001 # Run the web service on container startup. -CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -Dlog4j.formatMsgNoLookups=true -jar /app/notification-${PROVIDER_NAME}.jar +CMD java --add-opens java.base/java.lang=ALL-UNNAMED \ + --add-opens java.base/java.lang.reflect=ALL-UNNAMED \ + -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} \ + -Dlog4j.formatMsgNoLookups=true -jar \ + /app/notification-${PROVIDER_NAME}.jar diff --git a/provider/notification-gc/pom.xml b/provider/notification-gc/pom.xml index a5366bf93c6e7976d27c729c5f25bf12c86ffb38..feff3f69f16930403bd418484be1797e449e393c 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.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-gc</name> <description>Google Cloud implementation for Notification service</description> <packaging>jar</packaging> @@ -25,12 +25,12 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> @@ -49,21 +49,16 @@ </dependencyManagement> <dependencies> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> - <version>0.21.0</version> - </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-gc</artifactId> - <version>0.21.0</version> + <version>0.23.1</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <exclusions> <exclusion> <groupId>com.google.apis</groupId> @@ -110,7 +105,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>oqm</artifactId> - <version>0.21.0</version> + <version>0.23.0</version> </dependency> </dependencies> @@ -156,7 +151,7 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> - <version>0.7.7.201606060606</version> + <version>0.8.10</version> <executions> <execution> <goals> @@ -172,6 +167,17 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>3.0.0</version> + <configuration> + <argLine> + @{argLine} --add-opens java.base/java.util=ALL-UNNAMED + --add-opens java.base/java.lang=ALL-UNNAMED + </argLine> + </configuration> + </plugin> </plugins> </build> </project> diff --git a/provider/notification-gc/src/test/java/org/opengroup/osdu/notification/secutity/GoogleServiceAccountValidatorImplTests.java b/provider/notification-gc/src/test/java/org/opengroup/osdu/notification/secutity/GoogleServiceAccountValidatorImplTests.java index 5ca164bab5b967fe68ebdfde07476a795dfda4dd..2033a0581be8322c152bbc8d3e54ce6242e48e21 100644 --- a/provider/notification-gc/src/test/java/org/opengroup/osdu/notification/secutity/GoogleServiceAccountValidatorImplTests.java +++ b/provider/notification-gc/src/test/java/org/opengroup/osdu/notification/secutity/GoogleServiceAccountValidatorImplTests.java @@ -94,6 +94,5 @@ public class GoogleServiceAccountValidatorImplTests { IOException e = new IOException("invalid token"); when(this.verifier.verify(TEST_JWT)).thenThrow(e); Assert.assertFalse(this.sut.isValidServiceAccount(TEST_JWT, TEST_USER_IDENTITY)); - verify(this.log, times(1)).error("Error when validating google id token", e); } } diff --git a/provider/notification-ibm/pom.xml b/provider/notification-ibm/pom.xml index 26a206db4debe314c095e0464f1cab07013b65b8..24d91cf9fbc7dbc8e169abb7beedb3974ae05a73 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.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-ibm</name> <description>IBM implementation for Notification service</description> <packaging>jar</packaging> @@ -24,12 +24,12 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> <undertow-websockets-jsr.version>2.2.11.Final</undertow-websockets-jsr.version> @@ -61,7 +61,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-lib-ibm</artifactId> - <version>0.16.0-rc1</version> + <version>0.23.0</version> <exclusions> <exclusion> <groupId>org.apache.lucene</groupId> @@ -114,7 +114,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.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 91fbe66ff3be7bee8ef6a51869d20467dad93550..50780502d0e93a742857a2539693094ccdcae3eb 100644 --- a/testing/notification-test-aws/pom.xml +++ b/testing/notification-test-aws/pom.xml @@ -21,19 +21,19 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-test-aws</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-test-aws</name> <description>AWS Integration tests for Notification Service</description> <packaging>jar</packaging> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> <jackson-databind.version>2.13.2.2</jackson-databind.version> @@ -54,12 +54,12 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-common</artifactId> - <version>0.22.0-rc4</version> + <version>0.23.3</version> </dependency> <dependency> diff --git a/testing/notification-test-azure/pom.xml b/testing/notification-test-azure/pom.xml index b08ad2176c543589f5fd36919bfbbc67b6ef3c70..4f233bfebf6b037cbf0dfba115304263ded342ea 100644 --- a/testing/notification-test-azure/pom.xml +++ b/testing/notification-test-azure/pom.xml @@ -21,19 +21,19 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-test-azure</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-test-azure</name> <description>Integration tests Azure for notification</description> <packaging>jar</packaging> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> </properties> @@ -42,13 +42,13 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-azure</artifactId> - <version>0.12.0-rc10</version> + <version>0.23.2</version> <exclusions> <exclusion> @@ -64,17 +64,23 @@ <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> - <version>4.1.50.Final</version> + <version>4.1.90.Final</version> + </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>1.18.26</version> + <optional>true</optional> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-transport</artifactId> - <version>4.1.15.Final</version> + <version>4.1.90.Final</version> </dependency> <dependency> <groupId>com.azure</groupId> <artifactId>azure-core-http-netty</artifactId> - <version>1.2.0</version> + <version>1.13.1</version> </dependency> <dependency> <groupId>junit</groupId> diff --git a/testing/notification-test-baremetal/pom.xml b/testing/notification-test-baremetal/pom.xml index 2f89c8c9f75e65c24bde6e091eb3a9effde164db..52ca15ebf698f55396c9059aa65c0ae9140c36cb 100644 --- a/testing/notification-test-baremetal/pom.xml +++ b/testing/notification-test-baremetal/pom.xml @@ -21,18 +21,18 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <artifactId>notification-test-baremetal</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-test-baremetal</name> <description>Integration tests Baremetal for notification</description> <packaging>jar</packaging> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> </properties> @@ -41,17 +41,17 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-common</artifactId> - <version>0.3.6</version> + <version>0.23.3</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>1.18.8</version> + <version>1.18.26</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 62c2ae63420167e7d8a7f34e14958f7fd9c73f37..d113d44c2bb171cb123a2442fddf2fdf4646a887 100644 --- a/testing/notification-test-core/pom.xml +++ b/testing/notification-test-core/pom.xml @@ -21,45 +21,47 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-test-core</name> <description>Integration tests core for notification</description> <packaging>jar</packaging> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> - <jackson-databind.version>2.13.2.2</jackson-databind.version> - <jackson.version>2.13.2</jackson.version> + <jackson-databind.version>2.15.2</jackson-databind.version> + <jackson.version>2.15.2</jackson.version> </properties> <dependencies> <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> - <version>2.2.11</version> - </dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + <version>4.0.0</version> + <scope>provided</scope> + </dependency> + <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId> - <version>2.2.11</version> + <version>4.0.0</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> - <version>2.2.11</version> + <version>4.0.0</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-common</artifactId> - <version>0.3.4</version> + <version>0.23.3</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> @@ -74,7 +76,7 @@ <dependency> <groupId>javax.json</groupId> <artifactId>javax.json-api</artifactId> - <version>1.1.2</version> + <version>1.1.4</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> @@ -94,7 +96,7 @@ <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.json</artifactId> - <version>1.1.2</version> + <version>1.1.4</version> </dependency> <dependency> <groupId>com.google.oauth-client</groupId> @@ -104,7 +106,7 @@ <dependency> <groupId>com.google.api-client</groupId> <artifactId>google-api-client</artifactId> - <version>1.23.0</version> + <version>2.2.0</version> <exclusions> <exclusion> <groupId>com.google.guava</groupId> @@ -112,35 +114,35 @@ </exclusion> </exclusions> </dependency> - <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-client</artifactId> - <version>1.19.4</version> - </dependency> + <dependency> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-client</artifactId> + <version>1.19.4</version> + </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> - <version>2.9.1</version> + <version>2.10.1</version> </dependency> <dependency> <groupId>com.google.auth</groupId> <artifactId>google-auth-library-oauth2-http</artifactId> - <version>0.11.0</version> + <version>0.19.0</version> </dependency> <dependency> - <groupId>io.jsonwebtoken</groupId> - <artifactId>jjwt</artifactId> - <version>0.9.1</version> - </dependency> + <groupId>io.jsonwebtoken</groupId> + <artifactId>jjwt</artifactId> + <version>0.9.1</version> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.12</version> + <version>4.13.2</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <version>3.9</version> + <version>3.13.0</version> </dependency> </dependencies> <build> @@ -148,7 +150,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>3.0.0-M3</version> + <version>3.0.0</version> <configuration> <systemPropertyVariables> <DE_OPS_TESTER>${DE_OPS_TESTER}</DE_OPS_TESTER> diff --git a/testing/notification-test-gc/pom.xml b/testing/notification-test-gc/pom.xml index 659d6c8d5148b7548c6a669680b539bd30fa3bb5..cbeb13630b0ce9cf572b6094489730d9a2933bea 100644 --- a/testing/notification-test-gc/pom.xml +++ b/testing/notification-test-gc/pom.xml @@ -21,18 +21,18 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <artifactId>notification-test-gc</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-test-gc</name> <description>Integration tests Google Cloud for notification</description> <packaging>jar</packaging> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> </properties> @@ -41,17 +41,17 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-common</artifactId> - <version>0.3.6</version> + <version>0.23.3</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>1.18.8</version> + <version>1.18.26</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> diff --git a/testing/notification-test-gc/src/test/java/org/opengroup/osdu/notification/util/HttpClient.java b/testing/notification-test-gc/src/test/java/org/opengroup/osdu/notification/util/HttpClient.java index d32424a1eafbc604902a0b2f5cb30bc38809c776..b14839c915deb5235307f3d80a0491beabe5df64 100644 --- a/testing/notification-test-gc/src/test/java/org/opengroup/osdu/notification/util/HttpClient.java +++ b/testing/notification-test-gc/src/test/java/org/opengroup/osdu/notification/util/HttpClient.java @@ -17,29 +17,22 @@ package org.opengroup.osdu.notification.util; +import static org.junit.Assert.assertEquals; + import com.google.gson.Gson; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; -import org.apache.commons.lang3.StringUtils; - +import java.net.URI; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.util.Map; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import javax.ws.rs.core.MediaType; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.net.HttpURLConnection; -import java.net.URI; -import java.security.SecureRandom; -import java.security.cert.X509Certificate; -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; - -import static org.junit.Assert.assertEquals; +import org.apache.commons.lang3.StringUtils; public class HttpClient { private HttpClient(){ @@ -110,28 +103,6 @@ public class HttpClient { HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (Exception e) { } - allowMethods("PATCH"); return Client.create(); } - - private static void allowMethods(String... methods) { - try { - Field methodsField = HttpURLConnection.class.getDeclaredField("methods"); - - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.setInt(methodsField, methodsField.getModifiers() & ~Modifier.FINAL); - - methodsField.setAccessible(true); - - String[] oldMethods = (String[]) methodsField.get(null); - Set<String> methodsSet = new LinkedHashSet<>(Arrays.asList(oldMethods)); - methodsSet.addAll(Arrays.asList(methods)); - String[] newMethods = methodsSet.toArray(new String[0]); - - methodsField.set(null/*static field*/, newMethods); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new IllegalStateException(e); - } - } } diff --git a/testing/notification-test-ibm/pom.xml b/testing/notification-test-ibm/pom.xml index f0333f48b8ef57e3691348880eccb0b8f9db43b8..208581c574586f3bc52280ed32716f5c141dac7e 100644 --- a/testing/notification-test-ibm/pom.xml +++ b/testing/notification-test-ibm/pom.xml @@ -18,22 +18,22 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>os-notification-testing</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu</groupId> <artifactId>notification-test-ibm</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <name>notification-test-ibm</name> <description>Integration tests IBM for notification</description> <packaging>jar</packaging> <properties> - <java.version>8</java.version> + <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> - <os-core-lib-ibm.version>0.15.2</os-core-lib-ibm.version> + <os-core-lib-ibm.version>0.23.0</os-core-lib-ibm.version> </properties> <dependencies> @@ -45,12 +45,12 @@ <dependency> <groupId>org.opengroup.osdu.notification</groupId> <artifactId>notification-test-core</artifactId> - <version>0.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-common</artifactId> - <version>0.3.6</version> + <version>0.23.3</version> </dependency> diff --git a/testing/pom.xml b/testing/pom.xml index a766e7e3898cef072c26736d00fe0e9807afac1d..3787ed5ba2af802884573e736a3b32cfa023448c 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.24.0-SNAPSHOT</version> + <version>0.25.0-SNAPSHOT</version> <description>Root Notification Service project</description> <packaging>pom</packaging>