Skip to content
Snippets Groups Projects
Commit 63119c5b authored by Alan Braz's avatar Alan Braz
Browse files

Merge branch 'trusted-ibm-squash' into 'master'

IBM cd/ci and integration tests

See merge request !24
parents deb1a3d7 6ab66e99
No related branches found
No related tags found
2 merge requests!29Pull latest changes from master,!24IBM cd/ci and integration tests
Pipeline #2481 failed
Showing
with 515 additions and 304 deletions
......@@ -16,6 +16,8 @@ variables:
AZURE_BUILD_SUBDIR: provider/legal-azure
AZURE_TEST_SUBDIR: testing/legal-test-azure
IBM_BUILD_SUBDIR: provider/legal-ibm
IBM_INT_TEST_SUBDIR: testing/legal-test-ibm
include:
- project: "osdu/platform/ci-cd-pipelines"
......@@ -29,7 +31,9 @@ include:
ref: "master"
file: 'cloud-providers/gcp.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: "scanners/fossa.yml"
- project: "osdu/platform/ci-cd-pipelines"
......
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>os-core</id>
<username>slb-des-ext-collaboration</username>
<password>${VSTS_FEED_TOKEN}</password>
</server>
</servers>
</settings>
\ No newline at end of file
......@@ -39,6 +39,7 @@
<module>provider/legal-byoc</module>
<module>provider/legal-azure</module>
<module>provider/legal-aws</module>
<module>provider/legal-ibm</module>
</modules>
<repositories>
......
......@@ -13,7 +13,7 @@
<artifactId>legal-ibm</artifactId>
<packaging>jar</packaging>
<properties>
<osdu.ibmcore.version>0.0.13-SNAPSHOT</osdu.ibmcore.version>
<osdu.ibmcore.version>0.0.14-SNAPSHOT</osdu.ibmcore.version>
</properties>
......@@ -70,7 +70,6 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
......@@ -123,4 +122,17 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<build.profile.id>local</build.profile.id>
<profileActive>local</profileActive>
</properties>
</profile>
</profiles>
</project>
......@@ -34,6 +34,12 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Component;
import com.cloudant.client.api.Database;
import com.cloudant.client.api.query.JsonIndex;
import com.cloudant.client.org.lightcouch.DocumentConflictException;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
/**
* @author mbayser
*
......@@ -90,6 +96,35 @@ public class StorageReaderFactoryImpl implements IStorageReaderFactory {
}
IBMCloudantClientFactory cloudantFactory = new IBMCloudantClientFactory(creds);
// Initialize data
try {
Database db = cloudantFactory.getDatabase(dbNamePrefix, dbName);
System.out.println("creating indexes...");
db.createIndex(JsonIndex.builder().name("tenant-region-json-index").asc("tenant", "region").definition());
try {
JsonObject json = new JsonObject();
json.addProperty("_id", "integratio_test");
json.addProperty("name", "Malaysia");
json.addProperty("alpha2", "MY");
json.addProperty("numeric", 458);
json.addProperty("residencyRisk", "Client consent required");
JsonArray array = new JsonArray();
array.add("Transferred Data");
json.add("typesNotApplyDataResidency", array);
json.addProperty("tenant", "opendes");
json.addProperty("region", "us");
db.save(json);
logger.info("MY Country created for integration tests.");
} catch (DocumentConflictException e) {
logger.info("MY Country already exists.");
}
} catch (MalformedURLException e1) {
logger.error("Error initializing country database data.", e1);
}
return getReader(cloudantFactory, tenant, projectRegion, dbNamePrefix, dbName);
}
......
// (C) Copyright IBM Corporation 2019
// U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.legal.ibm.di;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.legal.StatusChangedTags;
import org.opengroup.osdu.legal.provider.interfaces.ILegalTagPublisher;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
/**
* @author mbayser
*
*/
@ConditionalOnProperty(
value="ibm.legal.publisher.devnull",
havingValue = "true",
matchIfMissing = false)
@Service
public class DevNullPublisher implements ILegalTagPublisher {
/* (non-Javadoc)
* @see org.opengroup.osdu.legal.provider.interfaces.LegalTagPublisher#publish(java.lang.String, org.opengroup.osdu.core.api.DpsHeaders, org.opengroup.osdu.legal.jobs.StatusChangedTags)
*/
@Override
public void publish(String projectId, DpsHeaders headers, StatusChangedTags tags) throws Exception {
// TODO Auto-generated method stub
}
}
......@@ -25,15 +25,12 @@ import org.opengroup.osdu.core.common.model.legal.StatusChangedTag;
import org.opengroup.osdu.core.common.model.legal.StatusChangedTags;
import org.opengroup.osdu.core.ibm.messagebus.IMessageFactory;
import org.opengroup.osdu.legal.provider.interfaces.ILegalTagPublisher;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import com.google.gson.Gson;
@ConditionalOnProperty(
value="ibm.legal.publisher.devnull",
havingValue = "false",
matchIfMissing = true)
import net.minidev.json.JSONObject;
@Component
public class LegalTagPublisherImpl implements ILegalTagPublisher {
......@@ -51,13 +48,16 @@ public class LegalTagPublisherImpl implements ILegalTagPublisher {
List<StatusChangedTag> batch = tags.getStatusChangedTags().subList(i,
Math.min(tags.getStatusChangedTags().size(), i + BATCH_SIZE));
String json = gson.toJson(batch);
JSONObject statusChangedTags = new JSONObject();
statusChangedTags.appendField("statusChangedTags", batch);
String json = gson.toJson(statusChangedTags);
message.put("data", json);
message.put(DpsHeaders.ACCOUNT_ID, headers.getPartitionIdWithFallbackToAccountId());
message.put(DpsHeaders.DATA_PARTITION_ID, headers.getPartitionIdWithFallbackToAccountId());
headers.addCorrelationIdIfMissing();
message.put(DpsHeaders.CORRELATION_ID, headers.getCorrelationId());
mq.sendMessage(IMessageFactory.LEGAL_QUEUE_NAME, gson.toJson(message));
// TODO discover where this message is consumed!
}
......
......@@ -21,6 +21,7 @@ import static com.cloudant.client.api.query.Expression.in;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.sql.Date;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
......@@ -32,6 +33,7 @@ import javax.inject.Inject;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.legal.LegalTag;
import org.opengroup.osdu.core.common.model.legal.ListLegalTagArgs;
import org.opengroup.osdu.core.common.model.legal.Properties;
import org.opengroup.osdu.core.ibm.auth.ServiceCredentials;
import org.opengroup.osdu.core.ibm.cloudant.IBMCloudantClientFactory;
import org.opengroup.osdu.legal.provider.interfaces.ILegalTagRepository;
......@@ -46,6 +48,7 @@ import com.cloudant.client.api.Database;
import com.cloudant.client.api.model.Response;
import com.cloudant.client.api.query.EmptyExpression;
import com.cloudant.client.api.query.ExecutionStats;
import com.cloudant.client.api.query.JsonIndex;
import com.cloudant.client.api.query.QueryBuilder;
import com.cloudant.client.api.query.QueryResult;
import com.cloudant.client.api.query.Selector;
......@@ -120,7 +123,55 @@ public class CloudantLegalTagRepository implements ILegalTagRepository {
.registerTypeAdapter(CloudantBackedLegalTag.class, CloudantBackedLegalTag.serializer)
.registerTypeAdapter(CloudantBackedLegalTag.class, CloudantBackedLegalTag.deserializer);
this.cloudant = cloudantFactory.getClient();
this.db = cloudantFactory.getDatabase(cloudant, dbNamePrefix, dataBaseName);
this.db = cloudantFactory.getDatabase(cloudant, dbNamePrefix, dataBaseName);
db.createIndex(JsonIndex.builder().name("is-valid-json-index").asc("is_valid").definition());
db.createIndex(JsonIndex.builder().name("id-json-index").asc("_id").definition());
try {
LegalTag tag = new LegalTag();
tag.setName("opendes-dps-integration-test-1566474656479");
tag.setDescription("invalid date");
tag.setIsValid(true);
Properties tp = new Properties();
tp.setCountryOfOrigin(Arrays.asList("US"));
tp.setContractId("A1234");
tp.setOriginator("MyCompany");
tp.setDataType("Transferred Data");
tp.setSecurityClassification("Public");
tp.setPersonalData("No Personal Data");
tp.setExportClassification("EAR99");
tp.setExpirationDate(Date.valueOf("2005-12-11"));
tag.setProperties(tp);
tag.setDefaultId();
db.save(tag);
logger.info("Invalid tag created for integration tests.");
} catch (DocumentConflictException e) {
logger.info("Invalid Tag already exists.");
}
try {
LegalTag tag = new LegalTag();
tag.setName("opendes-public-usa-dataset-1");
tag.setDescription("test for opendes-storage");
tag.setIsValid(true);
Properties tp = new Properties();
tp.setCountryOfOrigin(Arrays.asList("US"));
tp.setContractId(Properties.UNKNOWN_CONTRACT_ID);
tp.setOriginator("MyCompany");
tp.setDataType("Public Domain Data");
tp.setSecurityClassification("Public");
tp.setPersonalData("No Personal Data");
tp.setExportClassification("EAR99");
tp.setExpirationDate(Properties.DEFAULT_EXPIRATIONDATE);
tag.setProperties(tp);
tag.setDefaultId();
db.save(tag);
logger.info("Default tag created for integration tests.");
} catch (DocumentConflictException e) {
logger.info("Default Tag already exists.");
}
}
@Override
......
......@@ -20,8 +20,6 @@ ibm:
env:
prefix: acceptance-test
legal:
publisher:
devnull: true
db:
name: legal-tags
credentials: file:/somepath
......@@ -33,3 +31,9 @@ ibm:
url: ${ibm.legal.db.url}
user: ${ibm.legal.db.user}
password: ${ibm.legal.db.password}
amqphub:
amqp10jms:
remote-url: REPLACE_ME
username: REPLACE_ME
password: REPLACE_ME
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017-2019 Schlumberger
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Copyright 2017-2019 Schlumberger Licensed under the Apache License,
Version 2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License. -->
<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>
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>
<groupId>org.opengroup.osdu.legal</groupId>
<artifactId>legal-test-ibm</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>jar</packaging>
<groupId>org.opengroup.osdu.legal</groupId>
<artifactId>legal-test-ibm</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.main.basedir>${project.basedir}</project.main.basedir>
</properties>
<dependencies>
<dependency>
<groupId>org.opengroup.osdu.legal</groupId>
<artifactId>legal-test-core</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.microsoft.azure/azure-storage-blob -->
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-lib-ibm</artifactId>
<version>0.0.14-SNAPSHOT</version>
</dependency>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.main.basedir>${project.basedir}</project.main.basedir>
<!--
<PROJECT_ID>${PROJECT_ID}</PROJECT_ID>
<HOST_URL>${HOST_URL}</HOST_URL>
<ENTITLEMENT_URL>${ENTITLEMENT_URL}</ENTITLEMENT_URL>
<INTEGRATION_TESTER>${INTEGRATION_TESTER}</INTEGRATION_TESTER>
<INTEGRATION_TEST_AUDIENCE>${INTEGRATION_TEST_AUDIENCE}</INTEGRATION_TEST_AUDIENCE>
<MY_TENANT>${MY_TENANT}</MY_TENANT>
<CLIENT_TENANT>${CLIENT_TENANT}</CLIENT_TENANT>
<MY_TENANT_PROJECT>${MY_TENANT_PROJECT}</MY_TENANT_PROJECT>
<CLIENT_TENANT_PROJECT>${CLIENT_TENANT_PROJECT}</CLIENT_TENANT_PROJECT>
-->
</properties>
<!-- Tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu.legal</groupId>
<artifactId>legal-test-core</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
<repositories>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</url>
</repository>
</repositories>
<!-- Tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- can remove this? -->
<repositories>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/74/packages/maven</url>
</repository>
<snapshotRepository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/74/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<distributionManagement>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/74/packages/maven</url>
</repository>
<snapshotRepository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/74/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<build>
<defaultGoal>test</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/acceptanceTests</include>
</includes>
</configuration>
</execution>
</executions>
<configuration>
<trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
</plugins>
</build>
</project>
#!/bin/bash
export TENANT_INFO_DATABASE=acceptance-test-tenant-info
export LEGAL_TAG_DATABASE=acceptance-test-legal-tags
export COUNTRIES_DATABASE=acceptance-test-countries
# snagged from: https://stackoverflow.com/a/51264222/26510
function toAbsPath {
local target
target="$1"
if [ "$target" == "." ]; then
echo "$(pwd)"
elif [ "$target" == ".." ]; then
echo "$(dirname "$(pwd)")"
else
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
fi
}
function getScriptDir(){
local SOURCED
local RESULT
(return 0 2>/dev/null) && SOURCED=1 || SOURCED=0
if [ "$SOURCED" == "1" ]
then
RESULT=$(dirname "$1")
else
RESULT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
fi
toAbsPath "$RESULT"
}
SCRIPT_DIR=$(getScriptDir "$0")
CRED_FILE=$(basename ${IBM_CREDENTIALS_FILE})
mkdir config
cp ${IBM_CREDENTIALS_FILE} config/
cat <<EOF > config/application.yml
ibm:
tenant:
cloudant:
dbName: tenant-info
credentials: file:config/${CRED_FILE}
legal:
cloudant:
dbName: legal-tags
credentials: file:config/${CRED_FILE}
EOF
java -jar ${SCRIPT_DIR}/../../provider/legal-ibm/target/legal-ibm-0.0.4-SNAPSHOT-spring-boot.jar
#!/bin/bash
if [ -z "$LEGAL_TEST_TOKEN" ]
then
echo "env var LEGAL_TEST_TOKEN not set"
exit 1
fi
DATABASE_PREFIX=acceptance-test
export COUNTRIES_DATABASE=$DATABASE_PREFIX-countries
export TENANT_INFO_DATABASE=$DATABASE_PREFIX-tenant-info
export LEGAL_TAG_DATABASE=$DATABASE_PREFIX-legal-tags
export DATA_PARTITION_ID=data-partition-id
export HOST_URL=http://localhost:8080/api/legal/v1/
#export HOST_URL=http://localhost:8080/api/legal/v1/
export HOST_URL=https://os-legal-ibm-osdu-r2.osduadev-a1c3eaf78a86806e299f5f3f207556f0-0000.us-south.containers.appdomain.cloud/api/legal/v1/
export MY_TENANT=TENANT1
export MY_TENANT_PROJECT=PROJECT1
mvn test
#!/bin/bash
BASE_URL=$(jq -r ".url" < ${IBM_CREDENTIALS_FILE})
USERNAME=$(jq -r ".username" < ${IBM_CREDENTIALS_FILE})
PASSWORD=$(jq -r ".password" < ${IBM_CREDENTIALS_FILE})
DATABASE_PREFIX=acceptance-test
curl -XPUT -u $USERNAME:$PASSWORD $BASE_URL/$DATABASE_PREFIX-countries
curl -XPUT -u $USERNAME:$PASSWORD $BASE_URL/$DATABASE_PREFIX-legal-tags
curl -XPUT -u $USERNAME:$PASSWORD $BASE_URL/$DATABASE_PREFIX-tenant-info
# snagged from: https://stackoverflow.com/a/51264222/26510
function toAbsPath {
local target
target="$1"
if [ "$target" == "." ]; then
echo "$(pwd)"
elif [ "$target" == ".." ]; then
echo "$(dirname "$(pwd)")"
else
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
fi
}
function getScriptDir(){
local SOURCED
local RESULT
(return 0 2>/dev/null) && SOURCED=1 || SOURCED=0
if [ "$SOURCED" == "1" ]
then
RESULT=$(dirname "$1")
else
RESULT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
fi
toAbsPath "$RESULT"
}
SCRIPT_DIR=$(getScriptDir "$0")
TEST_COUNTRIES=${SCRIPT_DIR}/../legal-test-core/src/main/resources/TenantConfigTestingPurpose.json
cat $TEST_COUNTRIES | jq -rc '{ "docs": [.[] + {"tenant": "TENANT1", "region": "us"}]}' | curl -XPOST --data-binary @- -H"Content-type: application/json" -u $USERNAME:$PASSWORD $BASE_URL/$DATABASE_PREFIX-countries/_bulk_docs
TEST_TENANT=${SCRIPT_DIR}/src/test/resources/Tenant.json
curl -XPOST --data-binary @${TEST_TENANT} -H"Content-type: application/json" -u $USERNAME:$PASSWORD $BASE_URL/$DATABASE_PREFIX-tenant-info/_bulk_docs
TEST_TAGS=${SCRIPT_DIR}/src/test/resources/InitialTags.json
curl -XPOST --data-binary @${TEST_TAGS} -H"Content-type: application/json" -u $USERNAME:$PASSWORD $BASE_URL/$DATABASE_PREFIX-legal-tags/_bulk_docs
// Copyright 2020 IBM Corp. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.legal.acceptanceTests;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opengroup.osdu.legal.util.IBMLegalTagUtils;
public class TestCreateLegalTagApiAcceptance extends CreateLegalTagApiAcceptanceTests {
@Before
@Override
public void setup() throws Exception {
this.legalTagUtils = new IBMLegalTagUtils();
super.setup();
}
@After
@Override
public void teardown() throws Exception {
super.teardown();
this.legalTagUtils = null;
}
@Test
@Override
public void should_return307_when_makingHttpRequest()throws Exception{
//services are enforced to run in https on OpenShift
}
@Test
@Override
public void should_return401_when_makingHttpRequestWithoutToken()throws Exception{
//services are enforced to run in https on OpenShift
}
}
// Copyright 2020 IBM Corp. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.legal.acceptanceTests;
import static junit.framework.TestCase.assertTrue;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opengroup.osdu.legal.util.IBMLegalTagUtils;
import org.opengroup.osdu.legal.util.IBMServiceBusHelper;
import org.opengroup.osdu.legal.util.LegalTagUtils;
public class TestDeleteLegalTagApiAcceptance extends DeleteLegalTagApiAcceptanceTests {
@Before
@Override
public void setup() throws Exception {
this.legalTagUtils = new IBMLegalTagUtils();
super.setup();
}
@After
@Override
public void teardown() throws Exception {
super.teardown();
this.legalTagUtils = null;
}
@Test
@Override
public void should_return307_when_makingHttpRequest()throws Exception{
//services are enforced to run in https on OpenShift
}
@Test
@Override
public void should_return401_when_makingHttpRequestWithoutToken()throws Exception{
//services are enforced to run in https on OpenShift
}
/*@Test
public void should_receiveSubscriptionMessage_when_deletingAContractThatDoesExist() throws Exception {
//clear out topic queue before test
while (IBMServiceBusHelper.getMessage(1) != null) {}
name = LegalTagUtils.createRandomNameTenant();
legalTagUtils.getResult(legalTagUtils.create(name), 201, String.class );
validateAccess(204);
boolean passed = false;
int i = 0;
while (i < 10 && !passed) {
String message = IBMServiceBusHelper.getMessage(2);
System.out.println(">>>> " + message);
passed = IBMServiceBusHelper.checkLegalTagNameSent(message, name);
++i;
Thread.sleep(1000);
}
assertTrue("Pubsub message not received with tag: " + name, passed);
}*/
}
// Copyright 2020 IBM Corp. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.legal.acceptanceTests;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opengroup.osdu.legal.util.IBMLegalTagUtils;
public class TestGetLegalTagApiAcceptance extends GetLegalTagApiAcceptanceTests {
@Before
@Override
public void setup() throws Exception {
this.legalTagUtils = new IBMLegalTagUtils();
super.setup();
}
@After
@Override
public void teardown() throws Exception {
super.teardown();
this.legalTagUtils = null;
}
@Test
@Override
public void should_return307_when_makingHttpRequest()throws Exception{
//services are enforced to run in https on OpenShift
}
@Test
@Override
public void should_return401_when_makingHttpRequestWithoutToken()throws Exception{
//services are enforced to run in https on OpenShift
}
}
// Copyright 2020 IBM Corp. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.legal.acceptanceTests;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opengroup.osdu.legal.util.IBMLegalTagUtils;
public class TestGetLegalTagPropertiesApiAcceptance extends GetLegalTagPropertiesApiAcceptanceTests {
@Before
@Override
public void setup() throws Exception {
this.legalTagUtils = new IBMLegalTagUtils();
super.setup();
}
@After
@Override
public void teardown() throws Exception {
super.teardown();
this.legalTagUtils = null;
}
@Test
@Override
public void should_return307_when_makingHttpRequest()throws Exception{
//services are enforced to run in https on OpenShift
}
@Test
@Override
public void should_return401_when_makingHttpRequestWithoutToken()throws Exception{
//services are enforced to run in https on OpenShift
}
}
// Copyright 2020 IBM Corp. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.legal.acceptanceTests;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opengroup.osdu.legal.util.IBMLegalTagUtils;
public class TestGetLegalTagsApiAcceptance extends GetLegalTagsApiAcceptanceTests {
@Before
@Override
public void setup() throws Exception {
this.legalTagUtils = new IBMLegalTagUtils();
super.setup();
}
@After
@Override
public void teardown() throws Exception {
super.teardown();
this.legalTagUtils = null;
}
@Test
@Override
public void should_return307_when_makingHttpRequest()throws Exception{
//services are enforced to run in https on OpenShift
}
@Test
@Override
public void should_return401_when_makingHttpRequestWithoutToken()throws Exception{
//services are enforced to run in https on OpenShift
}
}
// (C) Copyright IBM Corporation 2019
// U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
// Copyright 2020 IBM Corp. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
......@@ -13,31 +12,39 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.legal.ibm.acceptanceTests;
package org.opengroup.osdu.legal.acceptanceTests;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.legal.acceptanceTests.ListLegalTagsApiAcceptanceTests;
import org.opengroup.osdu.legal.ibm.acceptanceTests.util.IBMLegalTagUtils;
import org.junit.Test;
import org.opengroup.osdu.legal.util.IBMLegalTagUtils;
/**
* @author mbayser
*
*/
public class TestListLegalTagsApiAcceptance extends ListLegalTagsApiAcceptanceTests {
@Before
@Override
public void setup() throws Exception {
public void setup() throws Exception {
this.legalTagUtils = new IBMLegalTagUtils();
super.setup();
}
@After
@Override
public void teardown() throws Exception {
public void teardown() throws Exception {
super.teardown();
this.legalTagUtils = null;
}
}
\ No newline at end of file
@Test
@Override
public void should_return307_when_makingHttpRequest()throws Exception{
//services are enforced to run in https on OpenShift
}
@Test
@Override
public void should_return401_when_makingHttpRequestWithoutToken()throws Exception{
//services are enforced to run in https on OpenShift
}
}
// (C) Copyright IBM Corporation 2019
// U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
// Copyright 2020 IBM Corp. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
......@@ -13,17 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.legal.ibm.acceptanceTests;
package org.opengroup.osdu.legal.acceptanceTests;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.legal.acceptanceTests.UpdateLegalTagApiAcceptanceTests;
import org.opengroup.osdu.legal.ibm.acceptanceTests.util.IBMLegalTagUtils;
import org.junit.Test;
import org.opengroup.osdu.legal.util.IBMLegalTagUtils;
/**
* @author mbayser
*
*/
public class TestUpdateLegalTagApiAcceptance extends UpdateLegalTagApiAcceptanceTests {
@Before
......@@ -36,8 +31,21 @@ public class TestUpdateLegalTagApiAcceptance extends UpdateLegalTagApiAcceptance
@After
@Override
public void teardown() throws Exception {
super.teardown();
this.legalTagUtils = null;
}
@Test
@Override
public void should_return307_when_makingHttpRequest()throws Exception{
//services are enforced to run in https on OpenShift
}
@Test
@Override
public void should_return401_when_makingHttpRequestWithoutToken()throws Exception{
//services are enforced to run in https on OpenShift
}
}
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