From 2ede5f09c9601d543f20d466a21e9e85c29eacc7 Mon Sep 17 00:00:00 2001 From: "Plummer, Brittany" Date: Tue, 10 Sep 2019 11:29:42 -0400 Subject: Integrate Logging Library Updated SO to use ONAP provided filters and constants to meet logging standards. Removed redundant classes Updated constant references Issue-ID: SO-2301 Signed-off-by: Benjamin, Max (mb388a) Change-Id: Ia4e3c2b1a4dcb3881aa34d39885c8b2782880d64 --- .../network/tasks/NetworkAdapterRestV1Test.java | 7 ++++--- .../infrastructure/sdnc/tasks/SDNCQueryTasksTest.java | 18 +++++++++--------- .../sdnc/tasks/SDNCRequestTasksTest.java | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/test') diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java index 8aea2d2650..3994208d23 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java @@ -39,7 +39,8 @@ import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.exception.MapperException; -import org.onap.so.utils.TargetEntity; +import org.onap.so.utils.Components; +import org.onap.logging.filter.base.ONAPComponents; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; @@ -113,7 +114,7 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest { delegateExecution.setVariable("NetworkAResponse_MESSAGE", updateNetworkResponse.toXmlString()); doThrow(new BpmnError("MSOWorkflowException")).when(exceptionBuilder).buildAndThrowWorkflowException( - any(DelegateExecution.class), anyInt(), any(String.class), any(TargetEntity.class)); + any(DelegateExecution.class), anyInt(), any(String.class), any(ONAPComponents.class)); try { networkAdapterRestV1Tasks.processCallback(delegateExecution); @@ -122,6 +123,6 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest { } assertNull(delegateExecution.getVariable("updateNetworkResponse")); verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(any(DelegateExecution.class), eq(7000), - eq("test error message"), eq(TargetEntity.OPENSTACK)); + eq("test error message"), eq(Components.OPENSTACK)); } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java index 0ba9237aaf..e158925568 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java @@ -44,8 +44,8 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.client.exception.BBObjectNotFoundException; import org.onap.so.client.exception.BadResponseException; -import org.onap.so.utils.TargetEntities; -import org.onap.so.utils.TargetEntity; +import org.onap.logging.filter.base.ONAPComponentsList; +import org.onap.logging.filter.base.ONAPComponents; public class SDNCQueryTasksTest extends BaseTaskTest { @InjectMocks @@ -65,7 +65,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest { vfModule = setVfModule(); doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException( - any(BuildingBlockExecution.class), eq(7000), any(Exception.class), any(TargetEntities.class)); + any(BuildingBlockExecution.class), eq(7000), any(Exception.class), any(ONAPComponentsList.class)); when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID))) .thenReturn(serviceInstance); @@ -98,7 +98,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest { expectedException.expect(BpmnError.class); sdncQueryTasks.queryVfModule(execution); - verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC); + verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SDNC); } @Test @@ -109,7 +109,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest { expectedException.expect(BpmnError.class); sdncQueryTasks.queryVfModule(execution); - verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO); + verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SO); } @Test @@ -133,7 +133,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest { expectedException.expect(BpmnError.class); sdncQueryTasks.queryVnf(execution); - verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC); + verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SDNC); } @Test @@ -144,7 +144,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest { expectedException.expect(BpmnError.class); sdncQueryTasks.queryVnf(execution); - verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO); + verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SO); } @Test @@ -169,7 +169,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest { expectedException.expect(BpmnError.class); sdncQueryTasks.queryVfModuleForVolumeGroup(execution); - verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC); + verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SDNC); } @Test @@ -180,7 +180,7 @@ public class SDNCQueryTasksTest extends BaseTaskTest { expectedException.expect(BpmnError.class); sdncQueryTasks.queryVfModuleForVolumeGroup(execution); - verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO); + verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, ONAPComponents.SO); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java index 0fc33fe5ce..e435909f59 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java @@ -49,7 +49,7 @@ import org.onap.so.client.exception.MapperException; import org.onap.so.client.sdnc.SDNCClient; import org.onap.so.client.sdnc.beans.SDNCRequest; import org.onap.so.client.sdnc.endpoint.SDNCTopology; -import org.onap.so.utils.TargetEntity; +import org.onap.logging.filter.base.ONAPComponents; import org.w3c.dom.Document; import org.xml.sax.InputSource; import com.fasterxml.jackson.core.JsonParseException; -- cgit 1.2.3-korg