From e2c77490982e448fb94477cebc5b7d4b8110321d Mon Sep 17 00:00:00 2001 From: "Smokowski, Steve (ss835w)" Date: Tue, 4 Sep 2018 15:31:38 -0400 Subject: Client Logging Update Client Logging to use interceptor Move CXF to own project due to dependency hell Issue-ID: SO-947 Change-Id: I2597ff6d32231b8625b04ef63ab5e8f589e2545c Signed-off-by: Smokowski, Steve (ss835w) --- .../so/adapters/requestsdb/application/CXFConfiguration.java | 12 +++--------- .../adapters/requestsdb/adapters/HealthCheckHandlerTest.java | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'adapters/mso-requests-db-adapter/src') diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java index 0404c10760..23a769bc21 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java @@ -45,12 +45,6 @@ public class CXFConfiguration { @Autowired private MsoRequestsDbAdapter requestDbAdapterImpl; - @Autowired - private SOAPLoggingInInterceptor soapInInterceptor; - - @Autowired - private SOAPLoggingOutInterceptor soapOutInterceptor; - @Bean public ServletRegistrationBean cxfServlet() { @@ -65,9 +59,9 @@ public class CXFConfiguration { logFeature.setPrettyLogging(true); logFeature.initialize(bus); endpoint.getFeatures().add(logFeature); - endpoint.getInInterceptors().add(soapInInterceptor); - endpoint.getOutInterceptors().add(soapOutInterceptor); - endpoint.getOutFaultInterceptors().add(soapOutInterceptor); + endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor()); + endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor()); + endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor()); return endpoint; } diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java index 159eb015de..4e00ced841 100644 --- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java +++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java @@ -58,7 +58,7 @@ public class HealthCheckHandlerTest { @Test public void testHealthcheck() throws JSONException { - + TestAppender.events.clear(); HttpEntity entity = new HttpEntity(null, headers); ResponseEntity response = restTemplate.exchange( @@ -87,6 +87,7 @@ public class HealthCheckHandlerTest { assertEquals("/manage/health",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME)); assertEquals("COMPLETED",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE)); } + TestAppender.events.clear(); } private String createURLWithPort(String uri) { -- cgit 1.2.3-korg