Skip to content
Snippets Groups Projects
Commit 2ed13075 authored by Abhay Joshi's avatar Abhay Joshi
Browse files

Merge branch 'master' into master-dev-merge-bios

parents d75a3313 c1159d74
No related branches found
No related tags found
4 merge requests!342Adding support for EKS 1.23,!329Fix spring vulnerabilities,!328Fix spring vulnerabilities,!311dependency upgrade
Pipeline #153812 failed
......@@ -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)
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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());
}
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment