Commit f258d5a4 authored by Riabokon Stanislav(EPAM)[GCP]'s avatar Riabokon Stanislav(EPAM)[GCP]
Browse files

Merge branch 'master' into integration-master

parents c2774d20 ba921ddd
......@@ -5,7 +5,7 @@ version: 2
cli:
server: https://app.fossa.com
fetcher: custom
project: os-delivery
project: Delivery
analyze:
modules:
- name: os-delivery
......@@ -24,3 +24,11 @@ analyze:
type: mvn
target: provider/delivery-ibm/pom.xml
path: .
- name: delivery-gcp
type: mvn
target: provider/delivery-gcp/pom.xml
path: .
- name: delivery-azure
type: mvn
target: provider/delivery-azure/pom.xml
path: .
......@@ -7,6 +7,22 @@ variables:
IBM_BUILD_SUBDIR: provider/delivery-ibm
IBM_INT_TEST_SUBDIR: testing/delivery-test-ibm
AZURE_SERVICE: delivery
AZURE_BUILD_SUBDIR: provider/delivery-azure
AZURE_TEST_SUBDIR: testing/delivery-test-azure
# --- osdu gcp specific variables ---
# OSDU_BUILD_SUBDIR: provider/file-gcp-datastore
# OSDU_INT_TEST_SUBDIR: testing/file-test-core
OSDU_GCP_SERVICE: delivery
OSDU_GCP_VENDOR: gcp
OSDU_GCP_APPLICATION_NAME: os-delivery
OSDU_GCP_REDIS_HOST: 10.234.198.27
OSDU_GCP_SEARCH_QUERY_URL: https://os-search-dot-nice-etching-277309.uc.r.appspot.com//api/search/v2/query
OSDU_GCP_ENV_VARS: GCP_ENTITLEMENTS_URL=$OSDU_GCP_ENTITLEMENTS_URL,GCP_SEARCH_QUERY_URL=$OSDU_GCP_SEARCH_QUERY_URL,GCP_REDIS_HOST=$OSDU_GCP_REDIS_HOST --vpc-connector=$OSDU_GCP_VPC_CONNECTOR
OSDU_GCP_PORT: 8080
# --- end of osud gcp specific variables ---
include:
- project: 'osdu/platform/ci-cd-pipelines'
file: 'standard-setup.yml'
......@@ -24,11 +40,17 @@ include:
file: 'publishing/pages.yml'
- project: 'osdu/platform/ci-cd-pipelines'
file: 'cloud-providers/aws.yml'
file: 'cloud-providers/aws.yml'
- project: 'osdu/platform/ci-cd-pipelines'
file: 'cloud-providers/ibm.yml'
- project: "osdu/platform/ci-cd-pipelines"
file: 'cloud-providers/osdu-gcp-cloudrun.yml'
- project: 'osdu/platform/ci-cd-pipelines'
file: 'cloud-providers/azure.yml'
# disable the eslint scanner
# I think this is being generated from the presence of an HTML file, but there
# is no javascript to scan, so the job isn't helpful and just gets in the way
......
......@@ -2,13 +2,6 @@
Generated by fossa-cli (https://github.com/fossas/fossa-cli).
This software includes the following software and licenses:
========================================================================
Apache-1.1
========================================================================
The following software have components provided under the terms of this license:
- StAX (from http://stax.codehaus.org/)
========================================================================
Apache-2.0
========================================================================
......@@ -217,16 +210,24 @@ The following software have components provided under the terms of this license:
- Apache Log4j API (from )
- Apache Log4j to SLF4J Adapter (from )
- AssertJ fluent assertions (from )
- AutoValue Annotations (from )
- Bean Validation API (from http://beanvalidation.org)
- Byte Buddy (without dependencies) (from )
- Byte Buddy Java agent (from )
- ClassMate (from http://github.com/cowtowncoder/java-classmate)
- Cloud Storage JSON API v1-rev58-1.21.0 (from )
- CloudWatch Metrics for AWS Java SDK (from https://aws.amazon.com/sdkforjava)
- Commons IO (from http://commons.apache.org/io/)
- Elastic JNA Distribution (from https://github.com/java-native-access/jna)
- Elasticsearch: 5.0.0-alpha5 (from https://github.com/elastic/elasticsearch)
- FindBugs-jsr305 (from http://findbugs.sourceforge.net/)
- Google APIs Client Library for Java (from )
- Google App Engine extensions to the Google HTTP Client Library for Java. (from )
- Google Cloud Core (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core)
- Google Cloud Core HTTP (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http)
- Google Cloud Storage (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-storage)
- Google HTTP Client Library for Java (from https://github.com/google/google-http-java-client.git)
- Google OAuth Client Library for Java (from )
- Gson (from https://github.com/google/gson)
- Guava InternalFutureFailureAccess and InternalFutures (from )
- Guava ListenableFuture only (from )
......@@ -246,15 +247,20 @@ The following software have components provided under the terms of this license:
- JSON Web Token support for the JVM (from https://github.com/jwtk/jjwt.git)
- JSON library from Android SDK (from http://developer.android.com/sdk)
- JSONassert (from https://github.com/skyscreamer/JSONassert)
- Jackson 2 extensions to the Google HTTP Client Library for Java. (from https://github.com/google/google-http-java-client.git/google-http-client-jackson2)
- Jackson dataformat: CBOR (from http://github.com/FasterXML/jackson-dataformats-binary)
- Jackson datatype: JSR310 (from http://wiki.fasterxml.com/JacksonModuleJSR310)
- Jackson-annotations (from http://github.com/FasterXML/jackson)
- Jackson-core (from https://github.com/FasterXML/jackson-core)
- Jackson-dataformat-Smile (from http://github.com/FasterXML/jackson-dataformat-smile)
- Jackson-dataformat-XML (from http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson)
- Jackson-datatype-jdk8 (from )
- Jackson-module-JAXB-annotations (from http://wiki.fasterxml.com/JacksonJAXBAnnotations)
- Jackson-module-parameter-names (from )
- Java Libraries for Amazon Simple WorkFlow (from https://aws.amazon.com/sdkforjava)
- Java Native Access (from https://github.com/java-native-access/jna)
- Java Native Access Platform (from https://github.com/java-native-access/jna)
- Javassist (from http://www.javassist.org/)
- Javassist (from http://www.javassist.org/)
- Javassist (from http://www.javassist.org/)
......@@ -276,20 +282,27 @@ The following software have components provided under the terms of this license:
- Lucene Spatial Extras (from )
- Lucene Suggest (from )
- MapStruct Core (from )
- Mockito (from http://mockito.org)
- Microsoft Azure Netty HTTP Client Library (from https://github.com/Azure/azure-sdk-for-java)
- Mockito (from http://www.mockito.org)
- Mockito (from http://mockito.org)
- Mockito (from http://www.mockito.org)
- Mockito (from http://mockito.org)
- Mockito (from http://mockito.org)
- Netty/Buffer (from http://netty.io/)
- Netty/Codec (from )
- Netty/Codec/HTTP (from )
- Netty/Codec/HTTP2 (from )
- Netty/Codec/Socks (from )
- Netty/Common (from )
- Netty/Handler (from )
- Netty/Handler/Proxy (from )
- Netty/Resolver (from )
- Netty/TomcatNative [BoringSSL - Static] (from )
- Netty/Transport (from http://netty.io/)
- Netty/Transport/Native/Unix/Common (from )
- Nimbus JOSE+JWT (from https://bitbucket.org/connect2id/nimbus-jose-jwt)
- Nimbus LangTag (from https://bitbucket.org/connect2id/nimbus-language-tags)
- Non-Blocking Reactive Foundation for the JVM (from https://github.com/reactor/reactor)
- OAuth 2.0 SDK with OpenID Connect extensions (from https://bitbucket.org/connect2id/oauth-2.0-sdk-with-openid-connect-extensions)
- OAuth 2.0 SDK with OpenID Connect extensions (from https://bitbucket.org/connect2id/oauth-2.0-sdk-with-openid-connect-extensions)
- Objenesis (from http://objenesis.org)
- OkHttp (from )
......@@ -297,9 +310,10 @@ The following software have components provided under the terms of this license:
- Okio (from )
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- PowerMock (from http://www.powermock.org)
- QpidJMS Client (from )
- Simple XML (from http://simple.sourceforge.net)
- Reactive Streams Netty driver (from https://github.com/reactor/reactor-netty)
- SnakeYAML (from http://www.snakeyaml.org)
- Spring AOP (from https://github.com/spring-projects/spring-framework)
- Spring Beans (from https://github.com/spring-projects/spring-framework)
......@@ -330,26 +344,27 @@ The following software have components provided under the terms of this license:
- Spring Transaction (from https://github.com/spring-projects/spring-framework)
- Spring Web (from https://github.com/spring-projects/spring-framework)
- Spring Web MVC (from https://github.com/spring-projects/spring-framework)
- StAX (from http://stax.codehaus.org/)
- StAX API (from http://stax.codehaus.org/)
- T-Digest (from https://github.com/tdunning/t-digest)
- Woodstox (from https://github.com/FasterXML/woodstox)
- aggs-matrix-stats (from https://github.com/elastic/elasticsearch)
- cli (from https://github.com/elastic/elasticsearch)
- com.google.api.grpc:proto-google-common-protos (from https://github.com/googleapis/googleapis)
- com.google.api.grpc:proto-google-iam-v1 (from https://github.com/googleapis/googleapis)
- compiler (from http://github.com/spullara/mustache.java)
- elasticsearch-core (from https://github.com/elastic/elasticsearch)
- error-prone annotations (from )
- io.grpc:grpc-context (from https://github.com/grpc/grpc-java)
- io.grpc:grpc-context (from https://github.com/grpc/grpc-java)
- ion-java (from https://github.com/amznlabs/ion-java/)
- jackson-databind (from http://github.com/FasterXML/jackson)
- java-cloudant (from https://cloudant.com)
- java-cloudant (from https://cloudant.com)
- javax.inject (from http://code.google.com/p/atinject/)
- javax.inject (from )
- javax.inject (from http://code.google.com/p/atinject/)
- jersey-repackaged-guava (from )
- jose4j (from https://bitbucket.org/b_c/jose4j/)
- lang-mustache (from https://github.com/elastic/elasticsearch)
- lettuce (from http://github.com/mp911de/lettuce/wiki)
- minio (from https://github.com/minio/minio-java)
- org.xmlunit:xmlunit-core (from http://www.xmlunit.org/)
- parent-join (from https://github.com/elastic/elasticsearch)
- powermock-api-mockito (from )
......@@ -396,36 +411,56 @@ BSD-2-Clause
========================================================================
The following software have components provided under the terms of this license:
- API Common (from https://github.com/googleapis)
- GAX (Google Api eXtensions) (from https://github.com/googleapis)
- GAX (Google Api eXtensions) (from https://github.com/googleapis)
- Hamcrest Core (from http://hamcrest.org/)
- Lucene Common Analyzers (from )
- StAX (from http://stax.codehaus.org/)
- ThreeTen backport (from https://www.threeten.org/threetenbp)
========================================================================
BSD-3-Clause
========================================================================
The following software have components provided under the terms of this license:
- API Common (from https://github.com/googleapis)
- ASM Core (from )
- Apache Commons Codec (from http://commons.apache.org/proper/commons-codec/)
- GAX (Google Api eXtensions) (from https://github.com/googleapis)
- GAX (Google Api eXtensions) (from https://github.com/googleapis)
- Google APIs Client Library for Java (from )
- Google Auth Library for Java - Credentials (from )
- Google Auth Library for Java - OAuth2 HTTP (from )
- Hamcrest library (from )
- Lucene Common Analyzers (from )
- Lucene Core (from )
- Lucene Suggest (from )
- Mockito (from http://www.mockito.org)
- Mockito (from http://www.mockito.org)
- NanoHttpd-Core (from )
- Netty/Codec/HTTP (from )
- Protocol Buffer Java API (from https://developers.google.com/protocol-buffers/)
- Protocol Buffers [Util] (from )
- Reflections (from http://github.com/ronmamo/reflections)
- SnakeYAML (from http://www.snakeyaml.org)
- Spring Core (from https://github.com/spring-projects/spring-framework)
- Stax2 API (from http://github.com/FasterXML/stax2-api)
- ThreeTen backport (from https://www.threeten.org/threetenbp)
========================================================================
CC-BY-3.0
========================================================================
The following software have components provided under the terms of this license:
- "Java Concurrency in Practice" book annotations (from http://jcip.net/)
- FindBugs-jsr305 (from http://findbugs.sourceforge.net/)
========================================================================
CC0-1.0
========================================================================
The following software have components provided under the terms of this license:
- reactive-streams (from http://www.reactive-streams.org/)
========================================================================
CDDL-1.0
========================================================================
......@@ -516,21 +551,23 @@ LGPL-2.1-only
The following software have components provided under the terms of this license:
- Elastic JNA Distribution (from https://github.com/java-native-access/jna)
- Java Native Access (from https://github.com/java-native-access/jna)
- Java Native Access Platform (from https://github.com/java-native-access/jna)
- Javassist (from http://www.javassist.org/)
- Javassist (from http://www.javassist.org/)
- Javassist (from http://www.javassist.org/)
- Logback Classic Module (from )
- Logback Core Module (from )
- SpotBugs Annotations (from https://spotbugs.github.io/)
========================================================================
LGPL-2.1-or-later
========================================================================
The following software have components provided under the terms of this license:
- Java Native Access (from https://github.com/java-native-access/jna)
- Java Native Access Platform (from https://github.com/java-native-access/jna)
- Javassist (from http://www.javassist.org/)
- SnakeYAML (from http://www.snakeyaml.org)
- SpotBugs Annotations (from https://spotbugs.github.io/)
========================================================================
LGPL-3.0-only
......@@ -553,14 +590,20 @@ The following software have components provided under the terms of this license:
- JUL to SLF4J bridge (from http://www.slf4j.org)
- Java JWT (from http://www.jwt.io)
- Lucene Core (from )
- Microsoft Azure Java Core Library (from https://github.com/Azure/azure-sdk-for-java)
- Microsoft Azure Netty HTTP Client Library (from https://github.com/Azure/azure-sdk-for-java)
- Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java)
- Microsoft Azure client library for Identity (from https://github.com/Azure/azure-sdk-for-java)
- Microsoft Azure common module for Storage (from https://github.com/Azure/azure-sdk-for-java)
- Mockito (from http://mockito.org)
- Mockito (from http://www.mockito.org)
- Mockito (from http://www.mockito.org)
- Mockito (from http://mockito.org)
- Mockito (from http://mockito.org)
- Netty/Codec/HTTP (from )
- Netty/Common (from )
- Project Lombok (from https://projectlombok.org)
- SLF4J API Module (from http://www.slf4j.org)
- msal4j (from https://github.com/AzureAD/microsoft-authentication-library-for-java)
- powermock-api-mockito (from )
- spring-security-core (from http://spring.io/spring-security)
......@@ -590,6 +633,7 @@ The following software have components provided under the terms of this license:
- HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/)
- jersey-core-common (from )
- jersey-repackaged-guava (from )
- reactive-streams (from http://www.reactive-streams.org/)
========================================================================
SPL-1.0
......@@ -614,6 +658,7 @@ The following software have components provided under the terms of this license:
- Guava: Google Core Libraries for Java (from https://github.com/google/guava.git)
- HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/)
- Joda-Time (from http://www.joda.org/joda-time/)
- Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java)
- Project Lombok (from https://projectlombok.org)
- Spring Web (from https://github.com/spring-projects/spring-framework)
......
......@@ -20,14 +20,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu</groupId>
<artifactId>delivery-core</artifactId>
<version>0.0.1</version>
<version>0.0.2-SNAPSHOT</version>
<description>Core project for the Delivery Service</description>
<packaging>jar</packaging>
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-delivery</artifactId>
<version>0.0.1</version>
<version>0.0.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -32,9 +32,13 @@ public class SignedUrl {
@JsonProperty("uri")
URI uri;
@JsonProperty("url")
URL url;
@JsonProperty("createdAt")
Instant createdAt;
@JsonProperty("connectionString")
String connectionString;
}
......@@ -32,4 +32,7 @@ public class SrnFileData {
@JsonProperty("kind")
String kind;
@JsonProperty("connectionString")
String connectionString;
}
......@@ -28,7 +28,6 @@ import org.opengroup.osdu.core.common.http.HttpResponse;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.entitlements.IEntitlementsAndCacheService;
import org.springframework.stereotype.Service;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import javax.inject.Inject;
import java.util.List;
......@@ -83,15 +82,16 @@ public class EntitlementsAndCacheServiceImpl implements IEntitlementsAndCacheSer
}
@Override
public boolean hasOwnerAccess(DpsHeaders dpsHeaders, String[] strings) {
throw new NotImplementedException(); // TODO: Implement later
public boolean hasOwnerAccess(DpsHeaders headers, String[] ownerList) {
throw new UnsupportedOperationException();
}
@Override
public List<RecordMetadata> hasValidAccess(List<RecordMetadata> list, DpsHeaders dpsHeaders) {
throw new NotImplementedException(); // TODO: Implement later
public List<RecordMetadata> hasValidAccess(List<RecordMetadata> recordsMetadata, DpsHeaders headers) {
throw new UnsupportedOperationException();
}
protected Groups getGroups(DpsHeaders headers) {
String cacheKey = this.getGroupCacheKey(headers);
Groups groups = this.cache.get(cacheKey);
......
......@@ -58,7 +58,10 @@ public class LocationServiceImpl implements ILocationService {
SignedUrl signedUrl = storageService.createSignedUrl(entry.getKey(), value.getUnsignedUrl(), headers.getAuthorization());
if(signedUrl != null && signedUrl.getUrl() != null){
if(!(entry.getKey().toLowerCase().contains("ovds"))){
value.setSignedUrl(signedUrl.getUrl().toString());
}
value.setConnectionString(signedUrl.getConnectionString());
processed.put(entry.getKey(), value);
} else {
unprocessed.add(entry.getKey());
......
......@@ -109,7 +109,7 @@ public class SearchServiceImpl implements ISearchService {
String unsignedURL = unsignedUrlLocationMapper.getUnsignedURLFromSearchResponse(searchResult);
SrnFileData srnData = new SrnFileData(null, unsignedURL, kind);
SrnFileData srnData = new SrnFileData(null, unsignedURL, kind, null);
if(unsignedURL != null) {
parsed.put(srn, srnData);
} else {
......@@ -165,10 +165,11 @@ public class SearchServiceImpl implements ISearchService {
.builder()
.httpMethod(HttpMethods.POST)
.url(SEARCH_QUERY_RECORD_HOST)
.body(query.toString())
.headers(dpsHeaders)
.build();
.body(query.toString()).build();
HttpResponse response = this.urlFetchService.sendRequest(request);
String dataFromSearch = response.getBody();
QueryResponse queryResponse = this.gson.fromJson(dataFromSearch, QueryResponse.class);
......
......@@ -63,6 +63,7 @@ public class LocationServiceImplTest {
String unsignedUrl2 = "http://unsignedurl2.com";
String unsignedUrl3 = "http://unsignedurl3.com";
String kind = "opendes:osdu:file:0.0.4";
String connectionString = "connectionString";
List<String> srns = new ArrayList<>();
srns.add(srn1);
......@@ -70,9 +71,9 @@ public class LocationServiceImplTest {
srns.add(srn3);
Map<String, SrnFileData> processed = new HashMap<>();
processed.put(srn1, new SrnFileData(null, unsignedUrl1, kind));
processed.put(srn2, new SrnFileData(null, unsignedUrl2, kind));
processed.put(srn3, new SrnFileData(null, unsignedUrl3, kind));
processed.put(srn1, new SrnFileData(null, unsignedUrl1, kind, connectionString));
processed.put(srn2, new SrnFileData(null, unsignedUrl2, kind, connectionString));
processed.put(srn3, new SrnFileData(null, unsignedUrl3, kind, connectionString));
List<String> unprocessed = new ArrayList<>();
UrlSigningResponse unsignedUrlsResponse = UrlSigningResponse.builder().processed(processed).unprocessed(unprocessed).build();
......@@ -82,16 +83,19 @@ public class LocationServiceImplTest {
signedUrl1.setUri(new URI(unsignedUrl1));
signedUrl1.setUrl(new URL(unsignedUrl1));
signedUrl1.setCreatedAt(Instant.now());
signedUrl1.setConnectionString(connectionString);
SignedUrl signedUrl2 = new SignedUrl();
signedUrl2.setUri(new URI(unsignedUrl2));
signedUrl2.setUrl(new URL(unsignedUrl2));
signedUrl2.setCreatedAt(Instant.now());
signedUrl1.setConnectionString(connectionString);
SignedUrl signedUrl3 = new SignedUrl();
signedUrl3.setUri(new URI(unsignedUrl3));
signedUrl3.setUrl(new URL(unsignedUrl3));
signedUrl3.setCreatedAt(Instant.now());
signedUrl1.setConnectionString(connectionString);
Mockito.when(storageService.createSignedUrl(Mockito.eq(srn1), Mockito.eq(unsignedUrl1), Mockito.any())).thenReturn(signedUrl1);
Mockito.when(storageService.createSignedUrl(Mockito.eq(srn2), Mockito.eq(unsignedUrl2), Mockito.any())).thenReturn(signedUrl2);
......
......@@ -17,11 +17,7 @@ package org.opengroup.osdu.delivery.service;
import static org.mockito.MockitoAnnotations.initMocks;
import com.google.gson.Gson;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.http.HttpStatus;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
......@@ -30,8 +26,8 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.opengroup.osdu.core.common.http.FetchServiceHttpRequest;
import org.opengroup.osdu.core.common.http.IUrlFetchService;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.HttpResponse;
import org.opengroup.osdu.core.common.model.search.QueryResponse;
import org.opengroup.osdu.delivery.DeliveryApplication;
......@@ -41,6 +37,14 @@ import org.opengroup.osdu.delivery.provider.interfaces.IUnsignedUrlLocationMappe
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.util.ReflectionTestUtils;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.mockito.MockitoAnnotations.initMocks;
@RunWith(MockitoJUnitRunner.class)
@SpringBootTest(classes={DeliveryApplication.class})
public class SearchServiceImplTest {
......@@ -118,8 +122,8 @@ public class SearchServiceImplTest {
Mockito.when(unsignedUrlLocationMapper.getUnsignedURLFromSearchResponse(searchResult3)).thenReturn(null);
Map<String, SrnFileData> processed = new HashMap<>();
processed.put("srn:file/csv:7344999246049527:", new SrnFileData(null, unsignedUrl1, searchResult1.get("kind").toString()));
processed.put("srn:file/csv:69207556434748899880399:", new SrnFileData(null, unsignedUrl2, searchResult2.get("kind").toString()));
processed.put("srn:file/csv:7344999246049527:", new SrnFileData(null, unsignedUrl1, searchResult1.get("kind").toString(), null));
processed.put("srn:file/csv:69207556434748899880399:", new SrnFileData(null, unsignedUrl2, searchResult2.get("kind").toString(), null));
List<String> unprocessed = new ArrayList<>();
unprocessed.add("srn:file/csv:59158134479121976019:");
......@@ -198,7 +202,7 @@ public class SearchServiceImplTest {
recordIds.add("srn:file/csv:7344999246049527:");
recordIds.add("srn:file/csv:69207556434748899880399:");
recordIds.add("srn:file/csv:59158134479121976019:");
FetchServiceHttpRequest.builder().httpMethod("POST").build();
Mockito.when(urlFetchService.sendRequest(Mockito.any()))
.thenReturn(new HttpResponse());
......
pipeline {
agent {
kubernetes {
cloud 'openshift'
label 'maven-openjdk18'
yaml """
spec:
containers:
- name: jnlp
image: quay.io/openshift/origin-jenkins-agent-maven:v4.0.0
volumeMounts:
- mountPath: "/tmp"
name: "workspace-volume"
readOnly: false
workingDir: "/tmp"
securityContext:
privileged: false
tty: false
resources:
limits:
cpu: 200m
memory: 250Mi
requests:
cpu: 200m
memory: 250Mi
restartPolicy: "Never"
"""
}
}
environment {
//Cluster environment variable(CLS_ENV). Like QA, DEV, PERF, PROD etc.
CLS_ENV = "dev"
//Service variable(CORE_SERVICE). Like indexer, search, delivery, storage, legal etc.
CORE_SERVICE = "delivery"
//GitHub repo URL credential ID for Environment variable files which saved as Secure text in Jenkins Credential.
GIT_ENV_VAR_PATH_URL = credentials('GitRepo-URL-For-Environment-variables')
//Personal token variable ID which saved as Secure text in Jenkins Credential. Like: GitHub-PRIVATE-TOKEN.
PRIVATE_TOKEN = credentials('GitHub-PRIVATE-TOKEN')
def runShell = sh (returnStdout: true, script: "curl --header 'PRIVATE-TOKEN: $PRIVATE_TOKEN' ''$GIT_ENV_VAR_PATH_URL'%2F'$CORE_SERVICE'_'$CLS_ENV'_env.json/raw?ref=master' -s -o env.json")
}
stages {
stage('Integration_test') {
environment {
def readContent = readJSON file: 'env.json'
AUTH_USER_ACCESS = "${readContent['AUTH_USER_ACCESS']}"
AUTH_USER_ACCESS_PASSWORD = "${readContent['AUTH_USER_ACCESS_PASSWORD']}"
DEFAULT_DATA_PARTITION_ID_TENANT1 = "${readContent['DEFAULT_DATA_PARTITION_ID_TENANT1']}"
DEFAULT_DATA_PARTITION_ID_TENANT2 = "${readContent['DEFAULT_DATA_PARTITION_ID_TENANT2']}"
DELIVERY_HOST = "${readContent['DELIVERY_HOST']}"
ENTITLEMENTS_DOMAIN = "${readContent['ENTITLEMENTS_DOMAIN']}"
IBM_COS_ACCESS_KEY = "${readContent['IBM_COS_ACCESS_KEY']}"
IBM_COS_ENDPOINT = "${readContent['IBM_COS_ENDPOINT']}"
IBM_COS_REGION = "${readContent['IBM_COS_REGION']}"
IBM_COS_SECRET_KEY = "${readContent['IBM_COS_SECRET_KEY']}"
KEYCLOAK_CLIENT_ID = "${readContent['KEYCLOAK_CLIENT_ID']}"
KEYCLOAK_CLIENT_SECRET = "${readContent['KEYCLOAK_CLIENT_SECRET']}"
KEYCLOAK_REALM = "${readContent['KEYCLOAK_REALM']}"
KEYCLOAK_URL = "${readContent['KEYCLOAK_URL']}"
LEGAL_TAG = "${readContent['LEGAL_TAG']}"
OTHER_RELEVANT_DATA_COUNTRIES = "${readContent['OTHER_RELEVANT_DATA_COUNTRIES']}"
SEARCH_HOST = "${readContent['SEARCH_HOST']}"
STORAGE_HOST = "${readContent['STORAGE_HOST']}"
}
steps {
script {
sh 'mvn -f testing/delivery-test-ibm/pom.xml test'
}
}
}
}
}
\ No newline at end of file
#####################
# README: Defines a template to be used as a starting point for defining a service pipeline
#####################
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- /**/*.md
- .gitignore