Skip to content
Snippets Groups Projects
Commit 2a60021a authored by Bhushan Rade's avatar Bhushan Rade
Browse files

IBM Int test code merge

parent a43d341f
No related branches found
No related tags found
1 merge request!21IBM Int test code merge
Pipeline #9179 passed
Showing
with 718 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu.register</groupId>
<artifactId>register-test-ibm</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Register service GCP integration tests </description>
<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>
<os-core-lib-ibm.version>0.3.6-SNAPSHOT</os-core-lib-ibm.version>
</properties>
<dependencies>
<!-- added for Keyclock token genration -->
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-lib-ibm</artifactId>
<version>${os-core-lib-ibm.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.8</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
<version>1.30.2</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.30.2</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>guava-jdk5</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>0.15.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.1-jre</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>core-lib-gcp</artifactId>
<version>0.1.21</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu.register</groupId>
<artifactId>register-test-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-provider-junit_2.12</artifactId>
<version>3.5.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<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/157/packages/maven</url>
</repository>
<snapshotRepository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/157/packages/maven</url>
</snapshotRepository>
</distributionManagement>
</project>
/*
* 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.register.action;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestCreateActionApi extends CreateActionApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.action;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestDeleteActionApi extends DeleteActionApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.action;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestGetActionByIdApi extends GetActionByIdApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.action;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestRetrieveActionApi extends RetrieveActionApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.ddms;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestCreateRegistrationApi extends CreateRegistrationApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.ddms;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestDeleteRegistrationApi extends DeleteRegistrationApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.ddms;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestGetConsumptionByIdApi extends GetConsumptionByIdApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.ddms;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestGetRegistrationByIdApi extends GetRegistrationByIdApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.ddms;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestQueryDdmsByType extends QueryDdmsByTypeTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.subscriber;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestCreateSubscriberApi extends CreateSubscriberApiTest {
@Before
@Override
public void setup() throws Exception {
this.testUtils = new IBMTestUtils();
super.setup();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.subscriber;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestDeleteSubscriberApi extends DeleteSubscriberApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.subscriber;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestGetSubscriberByIdApi extends GetSubscriberByIdApiTest {
@Before
@Override
public void setup() throws Exception {
this.testUtils = new IBMTestUtils();
super.setup();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.subscriber;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestListTopicsApi extends ListTopicsApiTest {
@Before
@Override
public void setup() {
this.testUtils = new IBMTestUtils();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/*
* 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.register.subscriber;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.register.util.IBMTestUtils;
public class TestQuerySubscriber extends QuerySubscriberTest {
@Before
@Override
public void setup() throws Exception {
this.testUtils = new IBMTestUtils();
super.setup();
}
@After
@Override
public void tearDown() {
this.testUtils = null;
}
}
/* * 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.register.util;
import com.google.common.base.Strings;
import org.apache.commons.lang.NullArgumentException;
import org.opengroup.osdu.core.ibm.util.IdentityClient;
public class IBMTestUtils extends TestUtils {
@Override
public synchronized String getOpsAccessToken() throws Exception {
if (Strings.isNullOrEmpty(opsToken)) {
opsToken=IdentityClient.getTokenForUserWithAccess();
}
return "Bearer " + opsToken;
}
@Override
public synchronized String getAdmAccessToken() throws Exception {
if (Strings.isNullOrEmpty(admToken)) {
admToken = IdentityClient.getTokenForUserWithAccess();
}
return "Bearer " + admToken;
}
@Override
public synchronized String getEditorAccessToken() throws Exception {
if (Strings.isNullOrEmpty(editorToken)) {
editorToken = IdentityClient.getTokenForUserWithAccess();
}
return "Bearer " + editorToken;
}
@Override
public synchronized String getNoDataAccessToken() throws Exception {
if (Strings.isNullOrEmpty(noAccessToken)) {
noAccessToken = IdentityClient.getTokenForUserWithNoAccess();
}
return "Bearer " + noAccessToken;
}
}
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