From faa0b29e3b7b1fa23a1444a5d9ac020b3c60dedc Mon Sep 17 00:00:00 2001 From: "r.bogacki" Date: Thu, 14 Mar 2019 15:24:57 +0100 Subject: Removed MsoLogger class Bye bye MsoLogger class. Extracted constants to separated classes. Fixed imports. Change-Id: I7c8e0527e7dbd097d3ea93b9dab279354652da47 Issue-ID: LOG-631 Signed-off-by: Robert Bogacki --- .../catalogdb/catalogrest/CatalogDBRestTest.java | 30 +++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'adapters/mso-catalog-db-adapter/src') 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 0f5ad6d92f..a97029ef5b 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,6 +21,13 @@ package org.onap.so.adapters.catalogdb.catalogrest; import static org.junit.Assert.*; +import static org.onap.so.logger.MdcConstants.ENDTIME; +import static org.onap.so.logger.MdcConstants.INVOCATION_ID; +import static org.onap.so.logger.MdcConstants.PARTNERNAME; +import static org.onap.so.logger.MdcConstants.RESPONSECODE; +import static org.onap.so.logger.MdcConstants.RESPONSEDESC; +import static org.onap.so.logger.MdcConstants.SERVICE_NAME; +import static org.onap.so.logger.MdcConstants.STATUSCODE; import java.io.IOException; @@ -39,7 +46,6 @@ import org.junit.runner.RunWith; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.adapters.catalogdb.CatalogDBApplication; -import org.onap.so.logger.MsoLogger; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; import org.springframework.boot.web.server.LocalServerPort; @@ -833,22 +839,22 @@ public class CatalogDBRestTest { Map mdc = logEvent.getMDCPropertyMap(); assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP)); assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID)); - assertNotNull(mdc.get(MsoLogger.INVOCATION_ID)); - assertEquals("UNKNOWN",mdc.get(MsoLogger.PARTNERNAME)); - assertEquals("v2/vfModules",mdc.get(MsoLogger.SERVICE_NAME)); - assertEquals("INPROGRESS",mdc.get(MsoLogger.STATUSCODE)); + assertNotNull(mdc.get(INVOCATION_ID)); + assertEquals("UNKNOWN",mdc.get(PARTNERNAME)); + assertEquals("v2/vfModules",mdc.get(SERVICE_NAME)); + assertEquals("INPROGRESS",mdc.get(STATUSCODE)); }else if(logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging") && logEvent.getMarker().getName().equals("EXIT")){ Map mdc = logEvent.getMDCPropertyMap(); assertNotNull(mdc.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP)); - assertNotNull(mdc.get(MsoLogger.ENDTIME)); + assertNotNull(mdc.get(ENDTIME)); assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID)); - assertNotNull(mdc.get(MsoLogger.INVOCATION_ID)); - assertEquals("500",mdc.get(MsoLogger.RESPONSECODE)); - assertEquals("UNKNOWN",mdc.get(MsoLogger.PARTNERNAME)); - assertEquals("v2/vfModules",mdc.get(MsoLogger.SERVICE_NAME)); - assertEquals("ERROR",mdc.get(MsoLogger.STATUSCODE)); - assertNotNull(mdc.get(MsoLogger.RESPONSEDESC)); + assertNotNull(mdc.get(INVOCATION_ID)); + assertEquals("500",mdc.get(RESPONSECODE)); + assertEquals("UNKNOWN",mdc.get(PARTNERNAME)); + assertEquals("v2/vfModules",mdc.get(SERVICE_NAME)); + assertEquals("ERROR",mdc.get(STATUSCODE)); + assertNotNull(mdc.get(RESPONSEDESC)); } } -- cgit 1.2.3-korg