aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-08-31 18:14:48 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-31 18:14:48 +0000
commit00da3f4b4087e78d56f09dfe8ab01616d6ad68b0 (patch)
tree8f7d4c1038ac792eee87c8eabecacddb552513ec /mso-api-handlers
parentb3b1c9fa6b788db9c1933f20b4cf85cc62656167 (diff)
parentb92b1f86492d1fb0e546ef5124116abdf2d07dc9 (diff)
Merge "Update Logging"
Diffstat (limited to 'mso-api-handlers')
-rw-r--r--mso-api-handlers/mso-api-handler-common/pom.xml14
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironment.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java11
5 files changed, 25 insertions, 9 deletions
diff --git a/mso-api-handlers/mso-api-handler-common/pom.xml b/mso-api-handlers/mso-api-handler-common/pom.xml
index b1963f1f4c..0743a2d2c5 100644
--- a/mso-api-handlers/mso-api-handler-common/pom.xml
+++ b/mso-api-handlers/mso-api-handler-common/pom.xml
@@ -130,6 +130,20 @@
<groupId>org.onap.so</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-client</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-bindings-soap</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
index 1700e121f0..e6bbc4de4a 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
@@ -29,7 +29,7 @@ import org.onap.so.apihandler.filters.RequestUriFilter;
import org.onap.so.apihandlerinfra.exceptions.ApiExceptionMapper;
import org.onap.so.apihandlerinfra.tenantisolation.CloudOrchestration;
import org.onap.so.apihandlerinfra.tenantisolation.CloudResourcesOrchestration;
-import org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
import org.onap.so.web.exceptions.RuntimeExceptionMapper;
import org.springframework.context.annotation.Configuration;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironment.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironment.java
index c16f7bb9ef..b09bbae0ad 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironment.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironment.java
@@ -76,8 +76,8 @@ public class CreateEcompOperationalEnvironment {
requestDb.updateInfraFailureCompletion(e.getMessage(), requestId, request.getOperationalEnvironmentId());
throw validateException;
}
- //Update request database
- requestDb.updateInfraSuccessCompletion("SUCCESSFULLY Created ECOMP OperationalEnvironment.", requestId, request.getOperationalEnvironmentId());
+ //Update request database
+ requestDb.updateInfraSuccessCompletion("SUCCESSFULLY Created ECOMP OperationalEnvironment.", requestId, request.getOperationalEnvironmentId());
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
index 5b37d772c6..76f4bb08a2 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
@@ -29,6 +29,7 @@ import com.github.tomakehurst.wiremock.http.Fault;
import org.apache.http.HttpStatus;
import org.junit.Before;
import org.junit.Test;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ServiceRecipe;
import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -1934,7 +1935,7 @@ public class ServiceInstancesTest extends BaseTest{
@Test
public void invalidRequestId() throws IOException {
String illegalRequestId = "1234";
- headers.set("X-ECOMP-RequestID", illegalRequestId);
+ headers.set(ONAPLogConstants.Headers.REQUEST_ID, illegalRequestId);
uri = servInstanceuri + "v5/serviceInstances";
ResponseEntity<String> response = sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java
index 0ace9d5445..585eff23c4 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java
@@ -23,7 +23,7 @@ package org.onap.so.apihandlerinfra.tenantisolation.process;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertThat;
-
+import java.util.UUID;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpStatus;
@@ -107,22 +107,23 @@ public class CreateEcompOperationalEnvironmentTest extends BaseTest{
.errorInfo(errorLoggerInfo).build();
InfraActiveRequests iar = new InfraActiveRequests();
- iar.setRequestId("123");
+ String uuid = UUID.randomUUID().toString();
+ iar.setRequestId(uuid);
iar.setOperationalEnvName("myOpEnv");
iar.setRequestScope("create");
iar.setRequestStatus("PENDING");
iar.setRequestAction("UNKNOWN");
- stubFor(get(urlPathEqualTo("/infraActiveRequests/123"))
+ stubFor(get(urlPathEqualTo("/infraActiveRequests/"+uuid))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withBody(mapper.writeValueAsString(iar))
.withStatus(HttpStatus.SC_OK)));
stubFor(post(urlPathEqualTo("/infraActiveRequests/"))
- .withRequestBody(containing("{\"requestId\":\"123\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"FAILED\",\"statusMessage\":\"FAILURE, operationalEnvironmentId - operationalEnvId; Error message: empty"))
+ .withRequestBody(containing("{\"requestId\":\""+uuid+ "\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"FAILED\",\"statusMessage\":\"FAILURE, operationalEnvironmentId - operationalEnvId; Error message:"))
.willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.withStatus(HttpStatus.SC_OK)));
try {
- createEcompOpEn.execute("123", getCloudOrchestrationRequest());
+ createEcompOpEn.execute(uuid, getCloudOrchestrationRequest());
}catch(ApiException e){
assertThat(e, sameBeanAs((ApiException) expectedException).ignoring("cause"));
}