summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPlummer, Brittany <brittany.plummer@att.com>2019-12-16 08:46:15 -0500
committerBenjamin, Max (mb388a) <mb388a@att.com>2019-12-16 08:46:15 -0500
commit656afb108d09cbeb3da31983a4616345b57bfae4 (patch)
tree7f78e68a5ebdbcf631bb1f5e5d134ef3fedd65c0
parenta0a017f918430fbd1c14c3af2718b993f0e9357c (diff)
update so to use 1.6.3 snapshot from the logging
Updated snapshot to 1.6.3 and began fixing failing tests Update SOAPLoggingInInterceptor to use new InvocationID value Changed client and server keys to InvocationID BPRestCallback to use ServerInvocationId Removed logging MDC checking from unit tests Began switching bprestcallback to use resttemplate Removed changes to logback replacing invocationIds Updated logic where requestEntity is created on null message Added unit tests for BPRestCallback Set InvocationID in MDC in SOAPLoggingInInterceptor Send in URI to prevent encoding of URI causing % to change to %25 Updated restTemplate to fix issue with interceptors Issue-ID: SO-2571 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I7e0d80eae9036c993414ae96ebd571c89cb9dfa9
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java56
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java27
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java3
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java144
-rw-r--r--adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackUnitTest.java142
-rw-r--r--adapters/mso-sdnc-adapter/src/test/resources/BPRestCallbackRequest.json1
-rw-r--r--common/src/main/java/org/onap/so/utils/Components.java5
-rw-r--r--cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java42
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java55
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java32
-rw-r--r--pom.xml6
12 files changed, 226 insertions, 288 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
index 347bce5b17..69a23a0eba 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
@@ -21,21 +21,11 @@
package org.onap.so.adapters.catalogdb.catalogrest;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.INVOCATION_ID;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.LOG_TIMESTAMP;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.PARTNER_NAME;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.RESPONSE_CODE;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.SERVICE_NAME;
import java.io.IOException;
-import java.util.Map;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.json.JSONException;
import org.junit.Test;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest;
import org.onap.so.db.catalog.beans.ServiceRecipe;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -46,7 +36,6 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.util.UriComponentsBuilder;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class CatalogDBRestTest extends CatalogDbAdapterBaseTest {
@@ -109,26 +98,6 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest {
restTemplate.exchange(createURLWithPort("/manage/health"), HttpMethod.GET, entity, String.class);
assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.spring.interceptor.LoggingInterceptor")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("/manage/health", mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.spring.interceptor.LoggingInterceptor")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("200", mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
- assertEquals("", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("/manage/health", mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("COMPLETED", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- }
}
/* Service Resources Endpoint */
@@ -815,31 +784,6 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest {
assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value());
JSONAssert.assertEquals(badQueryParamResponse, response.getBody().toString(), false);
-
-
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter")
- && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("UNKNOWN", mdc.get(PARTNER_NAME));
- assertEquals("v2/vfModules", mdc.get(SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(RESPONSE_STATUS_CODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter")
- && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(LOG_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("500", mdc.get(RESPONSE_CODE));
- assertEquals("UNKNOWN", mdc.get(PARTNER_NAME));
- assertEquals("v2/vfModules", mdc.get(SERVICE_NAME));
- assertEquals("ERROR", mdc.get(RESPONSE_STATUS_CODE));
- assertNotNull(mdc.get(RESPONSE_DESCRIPTION));
- }
}
@Test
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
index 92d3114ebe..eacd413df6 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
@@ -23,17 +23,14 @@ package org.onap.so.adapters.requestsdb.adapters;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.adapters.requestsdb.MsoRequestsDbAdapter;
import org.onap.so.adapters.requestsdb.RequestStatusType;
import org.onap.so.adapters.requestsdb.RequestsAdapterBase;
@@ -47,7 +44,6 @@ import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
import org.onap.so.requestsdb.RequestsDbConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.server.LocalServerPort;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class MSORequestDBImplTest extends RequestsAdapterBase {
@@ -423,28 +419,5 @@ public class MSORequestDBImplTest extends RequestsAdapterBase {
ResourceOperationStatus actualResource =
dbAdapter.getResourceOperationStatus(serviceId, operationId, "template1");
assertThat(actualResource, sameBeanAs(expectedResource));
-
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor")
- && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("UNKNOWN", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("/services/RequestsDbAdapter", mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor")
- && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals(null, mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
- assertEquals("UNKNOWN", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("/services/RequestsDbAdapter", mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("COMPLETE", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- }
}
-
-
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
index fc6d0a6fc9..55a05436f0 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
@@ -23,7 +23,9 @@
package org.onap.so.adapters.sdnc;
import java.util.concurrent.Executor;
+import org.onap.logging.filter.base.Constants;
import org.onap.logging.filter.spring.MDCTaskDecorator;
+import org.onap.so.utils.Components;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -52,6 +54,7 @@ public class SDNCAdapterApplication {
}
public static void main(String[] args) {
+ System.setProperty(Constants.Property.PARTNER_NAME, Components.SDNC_ADAPTER.toString());
SpringApplication.run(SDNCAdapterApplication.class, args);
System.getProperties().setProperty("server.name", "Springboot");
setLogsDir();
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
index 8a1a7559b5..631be2f9ff 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
@@ -24,27 +24,30 @@
package org.onap.so.adapters.sdnc.sdncrest;
+import java.net.URI;
import javax.xml.bind.DatatypeConverter;
-import org.onap.so.logger.LoggingAnchor;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.util.EntityUtils;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.logging.filter.spring.SpringClientPayloadFilter;
import org.onap.so.adapters.sdnc.impl.Constants;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
+import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter;
+import org.onap.so.utils.CryptoUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.onap.so.utils.CryptoUtils;
-import org.slf4j.MDC;
import org.springframework.core.env.Environment;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.HttpStatusCodeException;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.UriComponentsBuilder;
/**
* Sends asynchronous messages to the BPMN WorkflowMessage service.
@@ -95,81 +98,72 @@ public class BPRestCallback {
logger.info(LoggingAnchor.THREE, MessageEnum.RA_CALLBACK_BPEL.toString(),
message == null ? "[no content]" : message, CAMUNDA);
-
- HttpPost method = null;
- HttpResponse httpResponse = null;
-
try {
int timeout = 60 * 1000;
+ RestTemplate restTemplate = setRestTemplate(timeout);
- RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
- .setConnectionRequestTimeout(timeout).build();
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
- HttpClient client = HttpClientBuilder.create().build();
- method = new HttpPost(url);
- method.setConfig(requestConfig);
-
- if (message != null) {
- method.setEntity(new StringEntity(message, ContentType.APPLICATION_JSON));
- }
-
- boolean error = false;
-
- try {
- String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.BPEL_AUTH_PROP),
- env.getProperty(Constants.ENCRYPTION_KEY_PROP));
- String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
- method.setHeader("Authorization", authorization);
- method.setHeader(ONAPLogConstants.Headers.REQUEST_ID, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
- method.setHeader(ONAPLogConstants.Headers.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- method.setHeader(ONAPLogConstants.Headers.PARTNER_NAME, "SO-SDNCAdapter");
- } catch (Exception e) {
- logger.error(LoggingAnchor.FOUR, MessageEnum.RA_SET_CALLBACK_AUTH_EXC.toString(), CAMUNDA,
- ErrorCode.BusinessProcessError.getValue(), "Unable to set authorization in callback request",
- e);
- error = true;
- }
+ boolean error = setAuthorizationHeader(headers);
+ HttpEntity<String> requestEntity = new HttpEntity<>(message, headers);
if (!error) {
- httpResponse = client.execute(method);
-
- @SuppressWarnings("unused")
- String responseContent = null;
-
- if (httpResponse.getEntity() != null) {
- responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
- }
-
- if (httpResponse.getStatusLine().getStatusCode() >= 300) {
- String msg = "Received error response to callback request: " + httpResponse.getStatusLine();
- logger.error(LoggingAnchor.FOUR, MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), CAMUNDA,
- ErrorCode.BusinessProcessError.getValue(), msg);
-
- }
+ postRequest(restTemplate, url, requestEntity);
}
+ logger.info(LoggingAnchor.TWO, MessageEnum.RA_CALLBACK_BPEL_COMPLETE.toString(), CAMUNDA);
return true;
} catch (Exception e) {
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), CAMUNDA,
ErrorCode.BusinessProcessError.getValue(), "Error sending callback request", e);
return false;
- } finally {
- if (httpResponse != null) {
- try {
- EntityUtils.consume(httpResponse.getEntity());
- httpResponse = null;
- } catch (Exception e) {
- logger.debug("Exception:", e);
- }
- }
+ }
+ }
- if (method != null) {
- try {
- method.reset();
- } catch (Exception e) {
- logger.debug("Exception:", e);
- }
- }
- logger.info(LoggingAnchor.TWO, MessageEnum.RA_CALLBACK_BPEL_COMPLETE.toString(), CAMUNDA);
+ protected boolean setAuthorizationHeader(HttpHeaders headers) {
+ boolean error = false;
+ try {
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.BPEL_AUTH_PROP),
+ env.getProperty(Constants.ENCRYPTION_KEY_PROP));
+ String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
+ headers.set("Authorization", authorization);
+ } catch (Exception e) {
+ logger.error(LoggingAnchor.FOUR, MessageEnum.RA_SET_CALLBACK_AUTH_EXC.toString(), CAMUNDA,
+ ErrorCode.BusinessProcessError.getValue(), "Unable to set authorization in callback request", e);
+ error = true;
+ }
+ return error;
+ }
+
+ private void postRequest(RestTemplate restTemplate, String url, HttpEntity<String> requestEntity) {
+ ResponseEntity<String> response = null;
+ try {
+ UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(url);
+ URI uri = builder.build(true).toUri();
+ response = restTemplate.postForEntity(uri, requestEntity, String.class);
+ } catch (HttpStatusCodeException e) {
+ logResponseError(e.getStatusCode());
+ }
+ if (response != null && response.getStatusCode().is3xxRedirection()) {
+ logResponseError(response.getStatusCode());
}
}
+
+ private void logResponseError(HttpStatus statusCode) {
+ String msg = "Received error response to callback request: " + statusCode;
+ logger.error(LoggingAnchor.FOUR, MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), CAMUNDA,
+ ErrorCode.BusinessProcessError.getValue(), msg);
+ }
+
+ protected RestTemplate setRestTemplate(int timeout) {
+ RestTemplate restTemplate = new RestTemplate();
+ HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory();
+ factory.setConnectionRequestTimeout(timeout);
+ factory.setReadTimeout(timeout);
+ factory.setConnectTimeout(timeout);
+ restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(factory));
+ restTemplate.getInterceptors().add(new SOSpringClientFilter());
+ restTemplate.getInterceptors().add((new SpringClientPayloadFilter()));
+ return restTemplate;
+ }
}
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackUnitTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackUnitTest.java
new file mode 100644
index 0000000000..09089890ab
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackUnitTest.java
@@ -0,0 +1,142 @@
+package org.onap.so.adapters.sdnc.sdncrest;
+
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.when;
+import java.io.IOException;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.adapters.sdnc.impl.Constants;
+import org.springframework.core.env.Environment;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.HttpServerErrorException;
+import org.springframework.web.client.ResourceAccessException;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.UriComponentsBuilder;
+
+@RunWith(MockitoJUnitRunner.class)
+public class BPRestCallbackUnitTest {
+ @Mock
+ private Environment env;
+
+ @Mock
+ private RestTemplate restTemplate;
+
+ @Spy
+ @InjectMocks
+ private BPRestCallback bpRestCallback;
+
+ private HttpEntity<String> requestEntity;
+ private String message;
+ private HttpHeaders headers;
+ private URI uri;
+
+ @Before
+ public void setUp() throws IOException {
+ headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ message = input("BPRestCallbackRequest.json");
+ requestEntity = new HttpEntity<>(message, headers);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromUriString("http://localhost:8000/sdnc");
+ uri = builder.build(true).toUri();
+ }
+
+ public String input(String JsonInput) throws IOException {
+ JsonInput = "src/test/resources/" + JsonInput;
+ return new String(Files.readAllBytes(Paths.get(JsonInput)));
+ }
+
+ @Test
+ public void sendTest() throws IOException {
+ ResponseEntity<String> postResponse = new ResponseEntity<String>("response", HttpStatus.OK);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
+ when(restTemplate.postForEntity(uri, requestEntity, String.class)).thenReturn(postResponse);
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertTrue(response);
+ }
+
+ @Test
+ public void sendNoAuthHeaderTest() throws IOException {
+ doReturn(true).when(bpRestCallback).setAuthorizationHeader(headers);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertTrue(response);
+ }
+
+ @Test
+ public void sendErrorTest() throws IOException {
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ when(restTemplate.postForEntity(uri, requestEntity, String.class))
+ .thenThrow(new HttpServerErrorException(HttpStatus.INTERNAL_SERVER_ERROR, null, null, null));
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertTrue(response);
+ }
+
+ @Test
+ public void sendResponse3xxTest() throws IOException {
+ ResponseEntity<String> postResponse = new ResponseEntity<String>("response", HttpStatus.MULTIPLE_CHOICES);
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ when(restTemplate.postForEntity(uri, requestEntity, String.class)).thenReturn(postResponse);
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertTrue(response);
+ }
+
+ @Test
+ public void sendResponseNullMessageTest() throws IOException {
+ HttpHeaders httpHeaders = new HttpHeaders();
+ httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+ HttpEntity<String> requestEntityNoMessage = new HttpEntity<>(null, httpHeaders);
+ ResponseEntity<String> postResponse = new ResponseEntity<String>("response", HttpStatus.OK);
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(httpHeaders);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ when(restTemplate.postForEntity(uri, requestEntityNoMessage, String.class)).thenReturn(postResponse);
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", null);
+ assertTrue(response);
+ }
+
+ @Test
+ public void postThrowsExceptionTest() throws IOException {
+ doReturn(false).when(bpRestCallback).setAuthorizationHeader(headers);
+ doReturn(restTemplate).when(bpRestCallback).setRestTemplate(60000);
+ when(restTemplate.postForEntity(uri, requestEntity, String.class))
+ .thenThrow(new ResourceAccessException("ResourceAccessException"));
+ boolean response = bpRestCallback.send("http://localhost:8000/sdnc", message);
+ assertFalse(response);
+ }
+
+ @Test
+ public void setAuthorizationHeaderTest() {
+ HttpHeaders authHeaders = new HttpHeaders();
+ when(env.getProperty(Constants.BPEL_AUTH_PROP))
+ .thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C");
+ when(env.getProperty(Constants.ENCRYPTION_KEY_PROP)).thenReturn("07a7159d3bf51a0e53be7a8f89699be7");
+ boolean result = bpRestCallback.setAuthorizationHeader(authHeaders);
+ assertFalse(result);
+ }
+
+ @Test
+ public void setAuthorizationHeaderErrorTest() {
+ HttpHeaders authHeaders = new HttpHeaders();
+ when(env.getProperty(Constants.BPEL_AUTH_PROP)).thenReturn("test");
+ when(env.getProperty(Constants.ENCRYPTION_KEY_PROP)).thenReturn("test");
+ boolean result = bpRestCallback.setAuthorizationHeader(authHeaders);
+ assertTrue(result);
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/test/resources/BPRestCallbackRequest.json b/adapters/mso-sdnc-adapter/src/test/resources/BPRestCallbackRequest.json
new file mode 100644
index 0000000000..21f3dab7e0
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/resources/BPRestCallbackRequest.json
@@ -0,0 +1 @@
+{"SDNCServiceResponse":{"sdncRequestId":"b5b763aa-0d8a-4438-b900-83af45d21d10","responseCode":"200","ackFinalIndicator":"N"}} \ No newline at end of file
diff --git a/common/src/main/java/org/onap/so/utils/Components.java b/common/src/main/java/org/onap/so/utils/Components.java
index d8d703affc..5af8c5aa56 100644
--- a/common/src/main/java/org/onap/so/utils/Components.java
+++ b/common/src/main/java/org/onap/so/utils/Components.java
@@ -6,10 +6,11 @@ import org.onap.logging.filter.base.ONAPComponents;
import org.onap.logging.filter.base.ONAPComponentsList;
public enum Components implements ONAPComponentsList {
- OPENSTACK, UNKNOWN, ASDC_CONTROLLER, APIH;
+ OPENSTACK, UNKNOWN, ASDC_CONTROLLER, APIH, SDNC_ADAPTER;
+
public static Set<Components> getSOInternalComponents() {
- return EnumSet.of(ASDC_CONTROLLER, APIH);
+ return EnumSet.of(ASDC_CONTROLLER, APIH, SDNC_ADAPTER);
}
@Override
diff --git a/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java b/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java
index f6ac449057..d1f509f476 100644
--- a/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java
+++ b/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java
@@ -83,6 +83,7 @@ public class SOAPLoggingInInterceptor extends AbstractSoapInterceptor {
String invocationId = getValueOrDefault(headers, ONAPLogConstants.Headers.INVOCATION_ID.toLowerCase(),
UUID.randomUUID().toString());
MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
+ MDC.put(ONAPLogConstants.MDCs.SERVER_INVOCATION_ID, invocationId);
}
private void setRequestId(Map<String, List<String>> headers) {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java
index 8881a08ff3..99542f02ff 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ManualTasksTest.java
@@ -26,24 +26,13 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static com.shazam.shazamcrest.MatcherAssert.assertThat;
-import static org.onap.logging.filter.base.Constants.HttpHeaders.ECOMP_REQUEST_ID;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.INVOCATION_ID;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.PARTNER_NAME;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.RESPONSE_CODE;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.LOG_TIMESTAMP;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.SERVICE_NAME;
-import static org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE;
import static org.onap.logging.filter.base.Constants.HttpHeaders.CLIENT_ID;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.ECOMP_REQUEST_ID;
import java.io.IOException;
-import java.util.Map;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
import org.junit.Test;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.apihandlerinfra.tasksbeans.RequestDetails;
import org.onap.so.apihandlerinfra.tasksbeans.RequestInfo;
import org.onap.so.apihandlerinfra.tasksbeans.TaskRequestReference;
@@ -59,7 +48,6 @@ import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.tomakehurst.wiremock.http.Fault;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class ManualTasksTest extends BaseTest {
@@ -108,34 +96,6 @@ public class ManualTasksTest extends BaseTest {
// then
assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
assertThat(realResponse, sameBeanAs(expectedResponse));
-
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("UNKNOWN", mdc.get(PARTNER_NAME));
- assertEquals("tasks/v1/55/complete", mdc.get(SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(RESPONSE_STATUS_CODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(LOG_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(INVOCATION_ID));
- assertEquals("202", mdc.get(RESPONSE_CODE));
- assertEquals("UNKNOWN", mdc.get(PARTNER_NAME));
- assertEquals("tasks/v1/55/complete", mdc.get(SERVICE_NAME));
- assertEquals("COMPLETE", mdc.get(RESPONSE_STATUS_CODE));
- assertNotNull(mdc.get(RESPONSE_DESCRIPTION));
- assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0));
- assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0));
- assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0));
- assertEquals("1.0.0", response.getHeaders().get("X-LatestVersion").get(0));
- }
}
@Test
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 7ac009b22f..9f742784d4 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,14 +29,13 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+import static org.onap.logging.filter.base.Constants.HttpHeaders.CLIENT_ID;
import static org.onap.logging.filter.base.Constants.HttpHeaders.ONAP_REQUEST_ID;
-import static org.onap.so.logger.HttpHeadersConstants.REQUESTOR_ID;
import static org.onap.logging.filter.base.Constants.HttpHeaders.TRANSACTION_ID;
-import static org.onap.logging.filter.base.Constants.HttpHeaders.CLIENT_ID;
+import static org.onap.so.logger.HttpHeadersConstants.REQUESTOR_ID;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -81,7 +80,6 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.tomakehurst.wiremock.http.Fault;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class ServiceInstancesTest extends BaseTest {
@@ -214,37 +212,6 @@ public class ServiceInstancesTest extends BaseTest {
assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value());
ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
-
-
-
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("UNKNOWN", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("onap/so/infra/serviceInstantiation/v5/serviceInstances",
- mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("INPROGRESS", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("EXIT")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.LOG_TIMESTAMP));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("202", mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
- assertEquals("UNKNOWN", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- assertEquals("onap/so/infra/serviceInstantiation/v5/serviceInstances",
- mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
- assertEquals("COMPLETE", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION));
- assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0));
- assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0));
- assertEquals("5.0.0", response.getHeaders().get("X-LatestVersion").get(0));
- }
}
@Test
@@ -397,15 +364,6 @@ public class ServiceInstancesTest extends BaseTest {
.withStatus(HttpStatus.SC_NOT_FOUND)));
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatusCode().value());
-
- for (ILoggingEvent logEvent : TestAppender.events) {
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.SOAuditLogContainerFilter")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertEquals("32807a28-1a14-4b88-b7b3-2950918aa76d", mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertNotNull(mdc.get("PartnerName"));
- }
- }
}
@Test
@@ -2645,15 +2603,6 @@ public class ServiceInstancesTest extends BaseTest {
ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class);
assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId"));
assertEquals(response.getHeaders().get(TRANSACTION_ID).get(0), "32807a28-1a14-4b88-b7b3-2950918aa76d");
-
- for (ILoggingEvent logEvent : TestAppender.events) {
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertEquals("32807a28-1a14-4b88-b7b3-2950918aa76d", mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
- assertEquals("VID", mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
- }
- }
}
@Test
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java
index cfb865c9e1..2e9576cf7c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/client/grm/GRMClientTest.java
@@ -28,12 +28,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
import java.io.File;
import java.nio.file.Files;
import java.util.List;
-import java.util.Map;
import javax.ws.rs.core.MediaType;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -48,7 +45,6 @@ import org.onap.so.client.grm.beans.ServiceEndPointLookupRequest;
import org.onap.so.client.grm.beans.ServiceEndPointRequest;
import org.onap.so.client.grm.exceptions.GRMClientCallFailed;
import org.slf4j.MDC;
-import ch.qos.logback.classic.spi.ILoggingEvent;
public class GRMClientTest extends BaseTest {
@@ -79,36 +75,10 @@ public class GRMClientTest extends BaseTest {
List<ServiceEndPoint> list = sel.getServiceEndPointList();
assertEquals(3, list.size());
- boolean foundInvoke = false;
- boolean foundInvokeReturn = false;
- for (ILoggingEvent logEvent : TestAppender.events)
- if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOMetricLogClientFilter")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("INVOKE")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("GRM", mdc.get("TargetEntity"));
- assertEquals("INPROGRESS", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- foundInvoke = true;
- } else if (logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.SOMetricLogClientFilter")
- && logEvent.getMarker() != null && logEvent.getMarker().getName().equals("INVOKE-RETURN")) {
- Map<String, String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
- assertEquals("200", mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
- assertEquals("COMPLETED", mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
- foundInvokeReturn = true;
- }
-
- if (!foundInvoke)
- fail("INVOKE Marker not found");
-
- if (!foundInvokeReturn)
- fail("INVOKE RETURN Marker not found");
-
wireMockServer.verify(postRequestedFor(urlEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
.withHeader(ONAPLogConstants.Headers.INVOCATION_ID.toString(), matching(uuidRegex))
.withHeader(ONAPLogConstants.Headers.REQUEST_ID.toString(), matching(uuidRegex))
- .withHeader(ONAPLogConstants.Headers.PARTNER_NAME.toString(), equalTo("SO")));
- TestAppender.events.clear();
+ .withHeader(ONAPLogConstants.Headers.PARTNER_NAME.toString(), equalTo("SO.APIH")));
}
@Test
diff --git a/pom.xml b/pom.xml
index 0cd606e7b2..69481e9a76 100644
--- a/pom.xml
+++ b/pom.xml
@@ -630,17 +630,17 @@
<dependency>
<groupId>org.onap.logging-analytics</groupId>
<artifactId>logging-slf4j</artifactId>
- <version>1.6.2-SNAPSHOT</version>
+ <version>1.6.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.onap.logging-analytics</groupId>
<artifactId>logging-filter-base</artifactId>
- <version>1.6.2-SNAPSHOT</version>
+ <version>1.6.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.onap.logging-analytics</groupId>
<artifactId>logging-filter-spring</artifactId>
- <version>1.6.2-SNAPSHOT</version>
+ <version>1.6.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>