diff --git a/NOTICE b/NOTICE index 7c659682589d9c71e9f86798d4c8d7ef56580efb..76438017b3ddabc7a0a9c3507f0281a96f10031f 100644 --- a/NOTICE +++ b/NOTICE @@ -70,7 +70,7 @@ The following software have components provided under the terms of this license: - 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 Cache (from http://hc.apache.org/httpcomponents-client, http://hc.apache.org/httpcomponents-client-ga) -- Apache HttpCore (from http://hc.apache.org/httpcomponents-core-ga, http://hc.apache.org/httpcomponents-core-ga/) +- 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) - Apache Log4j JUL Adapter (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-jul) @@ -88,8 +88,8 @@ The following software have components provided under the terms of this license: - Byte Buddy (without dependencies) (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy) - Byte Buddy Java agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent) - ClassMate (from http://github.com/cowtowncoder/java-classmate) -- Cloud Key Management Service (KMS) API v1-rev20221107-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms) -- Cloud Storage JSON API v1-rev20220705-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage) +- Cloud Key Management Service (KMS) API (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms) +- Cloud Storage JSON API (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage) - Collections (from https://repo1.maven.org/maven2/commons-collections/commons-collections) - Commons Digester (from http://commons.apache.org/digester/) - Converter: Jackson (from https://github.com/square/retrofit, https://repo1.maven.org/maven2/com/squareup/retrofit2/converter-jackson) @@ -103,7 +103,7 @@ The following software have components provided under the terms of this license: - Google Cloud Core HTTP (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http, https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-http, https://github.com/googleapis/java-core) - Google Cloud Core gRPC (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-grpc, https://github.com/googleapis/java-core) - Google Cloud Datastore (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-datastore, https://github.com/googleapis/java-datastore) -- Google Cloud IAM Service Account Credentials (from https://github.com/googleapis/google-cloud-java) +- Google Cloud IAM Service Account Credentials (from https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/java-iamcredentials) - Google Cloud Logging (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-logging, https://github.com/googleapis/java-logging) - Google Cloud Pub/Sub (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-pubsub, https://github.com/googleapis/java-pubsub) - Google Cloud Storage (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-storage, https://github.com/googleapis/java-storage) @@ -340,7 +340,7 @@ The following software have components provided under the terms of this license: - springfox-swagger-ui (from https://github.com/springfox/springfox) - springfox-swagger2 (from https://github.com/springfox/springfox) - swagger-annotations (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-annotations, https://repo1.maven.org/maven2/io/swagger/swagger-annotations) -- swagger-core (from https://repo1.maven.org/maven2/io/swagger/swagger-core) +- swagger-core (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core, https://repo1.maven.org/maven2/io/swagger/swagger-core) - swagger-jaxrs (from https://repo1.maven.org/maven2/io/swagger/swagger-jaxrs) - swagger-models (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-models, https://repo1.maven.org/maven2/io/swagger/swagger-models) - tomcat-embed-core (from http://tomcat.apache.org/) @@ -388,7 +388,7 @@ The following software have components provided under the terms of this license: - Jackson module: Afterburner (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-modules-base) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) -- Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket) +- 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) - Lucene Core (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-core) - Microsoft Application Insights Java Agent (from https://github.com/Microsoft/ApplicationInsights-Java) @@ -476,7 +476,7 @@ The following software have components provided under the terms of this license: - Common Annotations 1.2 API - Expression Language 3.0 (from http://el-spec.java.net, http://uel.java.net, https://projects.eclipse.org/projects/ee4j.el) - Jakarta Servlet (from https://javaee.github.io/servlet-spec/, https://projects.eclipse.org/projects/ee4j.servlet) -- Jakarta WebSocket - Server API (from https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) +- 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) - 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 https://repo1.maven.org/maven2/com/sun/activation/javax.activation) @@ -783,6 +783,7 @@ The following software have components provided under the terms of this license: - 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) - PostgreSQL JDBC Driver - RabbitMQ Java Client (from http://www.rabbitmq.com, https://www.rabbitmq.com) - Undertow Core (from https://repo1.maven.org/maven2/io/undertow/undertow-core) diff --git a/notification-core/pom.xml b/notification-core/pom.xml index 23af7ba250cc20cae5200a8ff4d630bc6fef36a1..d26a447f9bd332f8d0ef510444847192892a5d8f 100644 --- a/notification-core/pom.xml +++ b/notification-core/pom.xml @@ -40,7 +40,7 @@ <undertow.version>2.2.19.Final</undertow.version> <woodstox-core.version>5.3.0</woodstox-core.version> <log4j.version>2.17.1</log4j.version> - <os-core-common.version>0.18.0-rc3</os-core-common.version> + <os-core-common.version>0.18.0</os-core-common.version> <google-oauth-client.version>1.33.3</google-oauth-client.version> <google-api-client.version>1.33.2</google-api-client.version> </properties> diff --git a/provider/notification-azure/pom.xml b/provider/notification-azure/pom.xml index 761961439e99c6bfc8aadffa6a514ca4a54b6fac..89f18613b445fd69d85006a8f42655fe703755fe 100644 --- a/provider/notification-azure/pom.xml +++ b/provider/notification-azure/pom.xml @@ -39,7 +39,7 @@ <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.18.0-rc3</osdu.corelibazure.version> + <osdu.corelibazure.version>0.18.0</osdu.corelibazure.version> <osdu.oscorecommon.version>0.14.0</osdu.oscorecommon.version> <junit.version>5.6.0</junit.version> <jjwt.version>3.8.1</jjwt.version> @@ -50,7 +50,7 @@ <oauth2-oidc-sdk.version>6.0</oauth2-oidc-sdk.version> <woodstox-core.version>5.3.0</woodstox-core.version> <spring-webmvc.version>5.3.22</spring-webmvc.version> - <os-core-common.version>0.18.0-rc3</os-core-common.version> + <os-core-common.version>0.18.0</os-core-common.version> <undertow.version>2.2.19.Final</undertow.version> <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> </properties> diff --git a/provider/notification-gcp/pom.xml b/provider/notification-gcp/pom.xml index 2352a2ab83a7953b1b49caa1c47dfffaa4851867..5cb26371af09d3e07dfa64630f738fe59a1756dd 100644 --- a/provider/notification-gcp/pom.xml +++ b/provider/notification-gcp/pom.xml @@ -47,7 +47,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-gcp</artifactId> - <version>0.17.0</version> + <version>0.18.0</version> </dependency> <dependency> diff --git a/testing/notification-test-azure/pom.xml b/testing/notification-test-azure/pom.xml index 4348c8bfcea542c0c6363f1f70f4ea0b4473ef50..6147349d3265ba88381d3a838810f9f8d45aa34a 100644 --- a/testing/notification-test-azure/pom.xml +++ b/testing/notification-test-azure/pom.xml @@ -48,31 +48,33 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-azure</artifactId> - <version>0.0.22</version> + <version>0.12.0-rc10</version> <exclusions> - <exclusion> - <groupId>io.projectreactor</groupId> - <artifactId>reactor-core</artifactId> - </exclusion> + <exclusion> <groupId>com.azure</groupId> <artifactId>azure-storage-blob</artifactId> </exclusion> <exclusion> - <groupId>io.projectreactor.netty</groupId> - <artifactId>reactor-netty</artifactId> + <groupId>com.azure</groupId> + <artifactId>azure-core-http-netty</artifactId> </exclusion> </exclusions> </dependency> <dependency> - <groupId>io.projectreactor</groupId> - <artifactId>reactor-core</artifactId> - <version>3.3.5.RELEASE</version> + <groupId>io.netty</groupId> + <artifactId>netty-all</artifactId> + <version>4.1.50.Final</version> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-transport</artifactId> + <version>4.1.15.Final</version> </dependency> <dependency> - <groupId>io.projectreactor.netty</groupId> - <artifactId>reactor-netty</artifactId> - <version>0.9.7.RELEASE</version> + <groupId>com.azure</groupId> + <artifactId>azure-core-http-netty</artifactId> + <version>1.2.0</version> </dependency> <dependency> <groupId>junit</groupId> diff --git a/testing/notification-test-azure/src/test/java/org/opengroup/osdu/notification/api/TestStorageIntegration.java b/testing/notification-test-azure/src/test/java/org/opengroup/osdu/notification/api/TestStorageIntegration.java index e02bd2b8938abb195046de2c166be14071d85da6..d8f68d234905de02adc35363ee7305bee2a92149 100644 --- a/testing/notification-test-azure/src/test/java/org/opengroup/osdu/notification/api/TestStorageIntegration.java +++ b/testing/notification-test-azure/src/test/java/org/opengroup/osdu/notification/api/TestStorageIntegration.java @@ -32,12 +32,14 @@ import org.opengroup.osdu.notification.util.*; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; +import java.util.logging.Logger; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; public class TestStorageIntegration extends BaseTestTemplate { + Logger logger= Logger.getLogger(""); private String subscriptionId = null; private String notificationId = null; private final String ackSubscriptionId = "AckSubscription"; @@ -86,6 +88,7 @@ public class TestStorageIntegration extends BaseTestTemplate { headers.put(DpsHeaders.AUTHORIZATION, testUtils.getOpsToken()); DpsHeaders dpsHeaders = DpsHeaders.createFromMap(headers); subscriptionService = factory.create(dpsHeaders); + logger.info("dps headers created."); // Create a new subscription Subscription subscription = new Subscription(); @@ -105,6 +108,7 @@ public class TestStorageIntegration extends BaseTestTemplate { System.out.println("Subscription exception inner response : " + e.getHttpResponse()); throw e; } + logger.info("New subscription created"); } private void deleteAckSubscription() throws SubscriptionException { @@ -141,19 +145,26 @@ public class TestStorageIntegration extends BaseTestTemplate { try { // Creates an actual subscription with a test endpoint i.e REGISTER_CUSTOM_PUSH_URL_HMAC this.createResource(); + logger.info("Actual subscription with a test endpoint created successfully"); + // Delay to get the above subscription registered by Notification Service TimeUnit.SECONDS.sleep(60); - + logger.info("Subscription registered by Notification service successfully"); + // Delete the Test Ack subscription if there exists any as a part of cleanup. // The Test Ack Subscription gets created if the the test endpoint of actual subscription // created above receives notification from Notification Service. this.deleteAckSubscription(); // Delete legal tag + logger.info("Cleaning up previous Legal Tag if any. "); LegalTagUtils.delete(LEGAL_TAG, this.testUtils.getAdminToken()); - + + // Create legal tag used in storage record + logger.info("Creating New legal tag"); LegalTagUtils.create(LEGAL_TAG, this.testUtils.getAdminToken()); + // Insert a storage Record.This will send a notification to the event grid/service bus topic // subscriptions.From there it goes to the Notification Service.Finally from there it goes to the // test endpoint i.e REGISTER_CUSTOM_PUSH_URL_HMAC which creates the Test ack Subscription. @@ -172,21 +183,25 @@ public class TestStorageIntegration extends BaseTestTemplate { while (ackSubscription == null && retryCount > 0) { TimeUnit.SECONDS.sleep(timeOut); ackSubscription = subscriptionService.get(ackSubscriptionId); + logger.info("Retry time: "+retryCount+" to get Test Ack subscription."); retryCount--; } Assertions.assertNotNull(ackSubscription, "Unable to retrieve test ack subscription. Elapsed time in minutes : " + (stopWatch.getTime(TimeUnit.MINUTES))); if (ackSubscription != null) { assertEquals("Unexpected Test Ack Subscription.", ackNotificationId, ackSubscription.getNotificationId()); } + logger.info("IT run successful"); stopWatch.stop(); } catch (Exception e) { fail("An exception occurred :" + e); } finally { + logger.info("Executing finally block"); // Delete Actual Subscription this.deleteResource(); // Deletion of Test Ack Subscription this.deleteAckSubscription(); // Delete legal tag + logger.info("Deleting legal tag"); LegalTagUtils.delete(LEGAL_TAG, this.testUtils.getAdminToken()); } diff --git a/testing/notification-test-core/src/main/java/org/opengroup/osdu/notification/util/TestUtils.java b/testing/notification-test-core/src/main/java/org/opengroup/osdu/notification/util/TestUtils.java index 17d5d90b5ded8ad2a87658a3aebde2022ae8b1d0..9e49c7b657d361d3280ae04dfee027ca2f60d45d 100644 --- a/testing/notification-test-core/src/main/java/org/opengroup/osdu/notification/util/TestUtils.java +++ b/testing/notification-test-core/src/main/java/org/opengroup/osdu/notification/util/TestUtils.java @@ -22,6 +22,7 @@ import java.net.URL; import java.security.SecureRandom; import java.security.cert.X509Certificate; import java.util.*; +import java.util.logging.Logger; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; @@ -35,6 +36,7 @@ import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; public abstract class TestUtils { + static Logger logger = Logger.getLogger(""); protected String serviceAccountFile; protected static String opsToken = null; protected static String adminToken = null; @@ -75,47 +77,58 @@ public abstract class TestUtils { public static ClientResponse send(String path, String httpMethod, String token, String requestBody, String query, Map<String, String> headers, boolean enforceHttp) throws Exception { - - Client client = getClient(); - client.setConnectTimeout(50000); - client.setReadTimeout(50000); - client.setFollowRedirects(false); - String url = getApiPath(path + query, enforceHttp); - System.out.println(url); - System.out.println(httpMethod); - System.out.println(requestBody); - System.out.println(headers); - - WebResource webResource = client.resource(url); - final WebResource.Builder builder = webResource.type(MediaType.APPLICATION_JSON) - .header("Authorization", token); - headers.forEach((k, v) -> builder.header(k, v)); - ClientResponse response = builder.method(httpMethod, ClientResponse.class, requestBody); - + ClientResponse response; + try { + Client client = getClient(); + client.setConnectTimeout(300000); + client.setReadTimeout(50000); + client.setFollowRedirects(false); + String url = getApiPath(path + query, enforceHttp); + System.out.println(url); + System.out.println(httpMethod); + System.out.println(requestBody); + System.out.println(headers); + + WebResource webResource = client.resource(url); + final WebResource.Builder builder = webResource.type(MediaType.APPLICATION_JSON) + .header("Authorization", token); + headers.forEach((k, v) -> builder.header(k, v)); + response = builder.method(httpMethod, ClientResponse.class, requestBody); + } catch (Exception e) { + e.printStackTrace(); + throw new AssertionError("Error: Send request error", e); + } + logger.info("waiting on response"); return response; } public static ClientResponse send(String url, String path, String httpMethod, String token, String requestBody, String query, Map<String, String> headers, boolean enforceHttp) throws Exception { - - Client client = getClient(); - client.setConnectTimeout(50000); - client.setReadTimeout(50000); - client.setFollowRedirects(false); - String URL = getApiPath(url, path + query, enforceHttp); - System.out.println(url + path); - System.out.println(httpMethod); - System.out.println(requestBody); - System.out.println(headers); - WebResource webResource = client.resource(URL); - final WebResource.Builder builder = webResource.type(MediaType.APPLICATION_JSON); - if (!token.isEmpty()) { - builder.header("Authorization", token); + ClientResponse response; + try { + Client client = getClient(); + client.setConnectTimeout(300000); + client.setReadTimeout(50000); + client.setFollowRedirects(false); + String URL = getApiPath(url, path + query, enforceHttp); + System.out.println(url + path); + System.out.println(httpMethod); + System.out.println(requestBody); + System.out.println(headers); + WebResource webResource = client.resource(URL); + final WebResource.Builder builder = webResource.type(MediaType.APPLICATION_JSON); + if (!token.isEmpty()) { + logger.info("Token is not empty so adding to request header"); + builder.header("Authorization", token); + } + headers.forEach((k, v) -> builder.header(k, v)); + response = builder.method(httpMethod, ClientResponse.class, requestBody); + } catch (Exception e) { + e.printStackTrace(); + throw new AssertionError("Error: Send request error", e); } - headers.forEach((k, v) -> builder.header(k, v)); - ClientResponse response = builder.method(httpMethod, ClientResponse.class, requestBody); - + logger.info("waiting on response"); return response; } @@ -159,8 +172,9 @@ public abstract class TestUtils { sc.init(null, trustAllCerts, new SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (Exception e) { + logger.info("Exception occurred"); } - + logger.info("Creating client"); return Client.create(); } } \ No newline at end of file