From f0904f39e6eaa86ac7f969f3500d0f4e4286f7ae Mon Sep 17 00:00:00 2001 From: Stanislav Riabokon <stanislav_riabokon@epam.com> Date: Mon, 19 Oct 2020 00:10:24 +0400 Subject: [PATCH] Added logs and a root pom.xml. --- testing/legal-test-core/pom.xml | 6 ++ .../osdu/legal/util/AcceptanceBaseTest.java | 4 ++ testing/pom.xml | 60 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 testing/pom.xml diff --git a/testing/legal-test-core/pom.xml b/testing/legal-test-core/pom.xml index d8608b4c6..969651efa 100644 --- a/testing/legal-test-core/pom.xml +++ b/testing/legal-test-core/pom.xml @@ -45,6 +45,12 @@ <artifactId>pact-jvm-provider-junit_2.12</artifactId> <version>3.5.5</version> </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>1.18.2</version> + <scope>provided</scope> + </dependency> </dependencies> <repositories> diff --git a/testing/legal-test-core/src/main/java/org/opengroup/osdu/legal/util/AcceptanceBaseTest.java b/testing/legal-test-core/src/main/java/org/opengroup/osdu/legal/util/AcceptanceBaseTest.java index 90b27aa71..d973e66d2 100644 --- a/testing/legal-test-core/src/main/java/org/opengroup/osdu/legal/util/AcceptanceBaseTest.java +++ b/testing/legal-test-core/src/main/java/org/opengroup/osdu/legal/util/AcceptanceBaseTest.java @@ -13,8 +13,10 @@ import com.sun.jersey.api.client.ClientResponse; import java.util.Objects; import javax.ws.rs.core.MediaType; +import lombok.extern.java.Log; import org.junit.Test; +@Log public abstract class AcceptanceBaseTest { protected LegalTagUtils legalTagUtils; @@ -94,9 +96,11 @@ public abstract class AcceptanceBaseTest { ClientResponse response = legalTagUtils .send(this.getApi(), this.getHttpMethod(), legalTagUtils.accessToken(), getBody(), getQuery(), headers); + log.info("Response status = " + response.getStatus()); assertEquals(expectedResponse, response.getStatus()); if (expectedResponse == 204) { if (Objects.nonNull(response.getType())) { + log.info("Content-Type = " + response.getType().toString()); assertTrue(response.getType().toString().toLowerCase().indexOf("text/html") >= 0); //Google Cloud Run specific } else { assertNull(response.getType()); diff --git a/testing/pom.xml b/testing/pom.xml new file mode 100644 index 000000000..0299f5e71 --- /dev/null +++ b/testing/pom.xml @@ -0,0 +1,60 @@ +<?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. +--> +<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> + <groupId>org.opengroup.osdu.legal</groupId> + <artifactId>os-legal-testing</artifactId> + <version>0.0.2-SNAPSHOT</version> + <description>Root Legal Service project</description> + <packaging>pom</packaging> + + <licenses> + <license> + <name>Apache License, Version 2.0</name> + <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> + <distribution>repo</distribution> + </license> + </licenses> + <modules> + <module>legal-test-core</module> + <module>legal-test-aws</module> + <module>legal-test-azure</module> + <module>legal-test-gcp</module> + <module>legal-test-ibm</module> + </modules> + + <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> + +</project> -- GitLab