diff options
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn/src/test')
17 files changed, 225 insertions, 200 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java index fd38ff024d..f6284f3535 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java @@ -3,7 +3,9 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -31,14 +33,12 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -import org.camunda.bpm.engine.RuntimeService; -import org.camunda.bpm.engine.test.Deployment; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.core.WorkflowException; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit test for CreateAAIVfModule.bpmn. @@ -46,7 +46,7 @@ import org.onap.so.logger.MsoLogger; public class CreateAAIVfModuleIT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleIT.class); + Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class); @Test public void TestCreateGenericVnfSuccess_200() { @@ -264,4 +264,4 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest { .withStatus(200))); } -}
\ No newline at end of file +} diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java index 6af705fd54..f72ca79dc6 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -34,7 +36,8 @@ import org.junit.Assert; import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.mock.FileUtil; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit tests for CreateAAIVfModuleVolumeGroup.bpmn. @@ -42,7 +45,7 @@ import org.onap.so.logger.MsoLogger; public class CreateAAIVfModuleVolumeGroupIT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleVolumeGroupIT.class); + Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleVolumeGroupIT.class); /** * Test the happy path through the flow. @@ -66,8 +69,8 @@ public class CreateAAIVfModuleVolumeGroupIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "CAAIVfModVG_updateVfModuleResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "CAAIVfModVG_updateVfModuleResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(200, responseCode.intValue()); logEnd(); @@ -93,8 +96,8 @@ public class CreateAAIVfModuleVolumeGroupIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "CAAIVfModVG_getVfModuleResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "CAAIVfModVG_getVfModuleResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(404, responseCode.intValue()); logEnd(); @@ -122,8 +125,8 @@ public class CreateAAIVfModuleVolumeGroupIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "CAAIVfModVG_updateVfModuleResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "CAAIVfModVG_updateVfModuleResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(404, responseCode.intValue()); logEnd(); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java index 27b39aec64..f98e4477aa 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java @@ -33,11 +33,11 @@ import java.util.UUID; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.test.Deployment; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.core.WorkflowException; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit test for DeleteAAIVfModule.bpmn. @@ -46,7 +46,7 @@ import org.onap.so.logger.MsoLogger; public class DeleteAAIVfModuleIT extends BaseIntegrationTest { private static final String EOL = "\n"; - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,DeleteAAIVfModuleIT.class); + Logger logger = LoggerFactory.getLogger(DeleteAAIVfModuleIT.class); @Test public void TestDeleteGenericVnfSuccess_200() { diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java index a6d26540dc..f477926f99 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java @@ -3,7 +3,9 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -33,7 +35,8 @@ import java.util.UUID; import org.junit.Assert; import org.junit.Test; import org.onap.so.BaseIntegrationTest; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit test for FalloutHandler.bpmn. @@ -41,7 +44,7 @@ import org.onap.so.logger.MsoLogger; public class FalloutHandlerIT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,FalloutHandlerIT.class); + Logger logger = LoggerFactory.getLogger(FalloutHandlerIT.class); private void setupMocks() { @@ -147,7 +150,7 @@ public class FalloutHandlerIT extends BaseIntegrationTest { public void msoFalloutHandlerWithNotificationurlNoRequestId() throws Exception{ String method = getClass().getSimpleName() + "." + new Object() { }.getClass().getEnclosingMethod().getName(); - logger.debug("STARTED TEST: " + method); + logger.debug("STARTED TEST: {}", method); //Setup Mocks setupMocks(); //Execute Flow @@ -186,7 +189,7 @@ public class FalloutHandlerIT extends BaseIntegrationTest { public void msoFalloutHandlerWithNoNotificationurlNoRequestId() throws Exception{ String method = getClass().getSimpleName() + "." + new Object() { }.getClass().getEnclosingMethod().getName(); - logger.debug("STARTED TEST: " + method); + logger.debug("STARTED TEST: {}", method); //Setup Mocks setupMocks(); //Execute Flow diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java index 744ef9bea5..67ae7de928 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -33,13 +35,14 @@ import org.camunda.bpm.engine.task.TaskQuery; import org.junit.Assert; import org.junit.Test; import org.onap.so.BaseIntegrationTest; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit test for RainyDayHandler.bpmn. */ public class ManualHandlingIT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,ManualHandlingIT.class); + Logger logger = LoggerFactory.getLogger(ManualHandlingIT.class); @Test public void TestManualHandlingSuccess() { @@ -76,8 +79,8 @@ public class ManualHandlingIT extends BaseIntegrationTest { List<Task> tasks = q.orderByTaskCreateTime().asc().list(); for (Task task : tasks) { - logger.debug("TASK ID: " + task.getId()); - logger.debug("TASK NAME: " + task.getName()); + logger.debug("TASK ID: {}", task.getId()); + logger.debug("TASK NAME: {}", task.getName()); try { logger.debug("Completing the task"); @@ -85,7 +88,7 @@ public class ManualHandlingIT extends BaseIntegrationTest { completeVariables.put("responseValue", "skip"); taskService.complete(task.getId(), completeVariables); } catch(Exception e) { - logger.debug("GOT EXCEPTION: " + e.getMessage()); + logger.debug("GOT EXCEPTION: {}", e.getMessage()); } } @@ -93,4 +96,4 @@ public class ManualHandlingIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); } -}
\ No newline at end of file +} diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java index 398efb972f..b370e6c48f 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -34,7 +36,8 @@ import org.onap.so.bpmn.core.domain.ServiceDecomposition; import org.onap.so.bpmn.core.domain.ServiceInstance; import org.onap.so.bpmn.core.domain.VnfResource; import org.onap.so.bpmn.mock.FileUtil; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.ArrayList; @@ -56,7 +59,7 @@ import static org.onap.so.bpmn.mock.StubResponseOof.mockOof_500; @Ignore public class OofHomingTestIT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleIT.class); + Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class); ServiceDecomposition serviceDecomposition = new ServiceDecomposition(); String subscriber = ""; @@ -261,7 +264,7 @@ public class OofHomingTestIT extends BaseIntegrationTest { vnfModel.setModelType("testModelTypeVNF"); vnf.setModelInfo(vnfModel); vnfList.add(vnf); - logger.debug("SERVICE DECOMP: " + serviceDecomposition.getServiceResourcesJsonString()); + logger.debug("SERVICE DECOMP: {}", serviceDecomposition.getServiceResourcesJsonString()); serviceDecomposition.setModelInfo(sModel); serviceDecomposition.setAllottedResources(arList); serviceDecomposition.setVnfResources(vnfList); @@ -416,9 +419,8 @@ public class OofHomingTestIT extends BaseIntegrationTest { ServiceDecomposition sd = (ServiceDecomposition) getVariableFromHistory(busKey, "serviceDecomposition"); - logger.debug("In testHoming_success_vnfResourceList, ServiceDecomposition = " + sd); + logger.debug("In testHoming_success_vnfResourceList, ServiceDecomposition = {}", sd); List<VnfResource> vnfResourceList = sd.getVnfResources(); -//logger.debug(" vnfResourceList = " + vnfResourceList); vnfResourceList.get(0).setResourceId("test-resource-id-000"); // Invoke Homing @@ -454,29 +456,27 @@ public class OofHomingTestIT extends BaseIntegrationTest { "WorkflowException"); ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey, "serviceDecomposition"); - logger.debug("serviceDecompositionExp is: " + serviceDecompositionExp); + logger.debug("serviceDecompositionExp is: {}", serviceDecompositionExp); Resource resourceVnf = serviceDecompositionExp.getServiceResource("test-resource-id-000"); - logger.debug("resourceVnf is: " + resourceVnf); + logger.debug("resourceVnf is: {}", resourceVnf); HomingSolution resourceVnfHoming = resourceVnf.getHomingSolution(); String resourceVnfHomingString = resourceVnfHoming.toString(); - logger.debug("resourceVnfHomingString is: " + resourceVnfHomingString); + logger.debug("resourceVnfHomingString is: {}", resourceVnfHomingString); resourceVnfHomingString = resourceVnfHomingString.replaceAll("\\s+", " "); - logger.debug("Now resourceVnfHomingString is: " + resourceVnfHomingString); + logger.debug("Now resourceVnfHomingString is: {}", resourceVnfHomingString); assertNull(workflowException); //Verify request String oofRequest = (String) getVariableFromHistory(businessKey, "oofRequest"); - logger.debug("oofRequest is: " + oofRequest); + logger.debug("oofRequest is: {}", oofRequest); assertEquals(FileUtil.readResourceFile("__files/BuildingBlocks/oofRequest_infravnf"). replaceAll("\n", "").replaceAll("\r", ""). replaceAll("\t", ""), oofRequest.replaceAll("\n", ""). replaceAll("\r", "").replaceAll("\t", "")); - //logger.debug("resourceVnfHoming.getVnf().getResourceId() is: " + resourceVnfHoming.getVnf().getResourceId()); - assertEquals(homingSolutionService("service", "service-instance-01234", "MDTNJ01", "test-resource-id-000","CloudOwner", "mtmnj1a", @@ -539,7 +539,6 @@ public class OofHomingTestIT extends BaseIntegrationTest { } @Test - public void testHoming_error_inputVariable() throws Exception { String businessKey = UUID.randomUUID().toString(); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java index b8ae341361..8b8abab6b2 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java @@ -3,7 +3,9 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -33,12 +35,12 @@ import java.util.UUID; import org.camunda.bpm.engine.test.Deployment; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.bpmn.mock.FileUtil; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit tests for PrepareUpdateAAIVfModule.bpmn. @@ -46,7 +48,7 @@ import org.onap.so.logger.MsoLogger; public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,PrepareUpdateAAIVfModuleIT.class); + Logger logger = LoggerFactory.getLogger(PrepareUpdateAAIVfModuleIT.class); /** * Test the happy path through the flow. @@ -73,11 +75,11 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "PUAAIVfMod_updateVfModuleResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "PUAAIVfMod_updateVfModuleResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(200, responseCode.intValue()); String heatStackId = (String) getVariableFromHistory(businessKey, "PUAAIVfMod_heatStackId"); - logger.debug("Ouput heat-stack-id:" + heatStackId); + logger.debug("Ouput heat-stack-id:{}", heatStackId); Assert.assertEquals("slowburn", heatStackId); logEnd(); @@ -106,11 +108,11 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest { String response = (String) getVariableFromHistory(businessKey, "PUAAIVfMod_getVnfResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "PUAAIVfMod_getVnfResponseCode"); WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(404, responseCode.intValue()); Assert.assertNotNull(workflowException); - logger.debug("Subflow WorkflowException error message: " + workflowException.getErrorMessage()); + logger.debug("Subflow WorkflowException error message: {}", workflowException.getErrorMessage()); logEnd(); } @@ -137,7 +139,7 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest { WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException"); Assert.assertNotNull(workflowException); - logger.debug("Subflow WorkflowException error message: " + workflowException.getErrorMessage()); + logger.debug("Subflow WorkflowException error message: {}", workflowException.getErrorMessage()); Assert.assertTrue(workflowException.getErrorMessage().startsWith("VF Module validation error: Orchestration")); logEnd(); @@ -165,7 +167,7 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest { WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException"); Assert.assertNotNull(workflowException); - logger.debug("Subflow WorkflowException error message: " + workflowException.getErrorMessage()); + logger.debug("Subflow WorkflowException error message: {}", workflowException.getErrorMessage()); Assert.assertTrue(workflowException.getErrorMessage().startsWith("VF Module validation error: VF Module")); logEnd(); @@ -196,11 +198,11 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest { String response = (String) getVariableFromHistory(businessKey, "PUAAIVfMod_updateVfModuleResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "PUAAIVfMod_updateVfModuleResponseCode"); WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(404, responseCode.intValue()); Assert.assertNotNull(workflowException); - logger.debug("Subflow WorkflowException error message: " + workflowException.getErrorMessage()); + logger.debug("Subflow WorkflowException error message: {}", workflowException.getErrorMessage()); logEnd(); } diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java index baf41d120b..12e12dc7d6 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -35,7 +37,8 @@ import org.junit.Ignore; import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.mock.FileUtil; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit tests for SDNCAdapterRestV2.bpmn. @@ -48,7 +51,7 @@ public class SDNCAdapterRestV2IT extends BaseIntegrationTest { private final CallbackSet callbacks = new CallbackSet(); - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,SDNCAdapterRestV2IT.class); + Logger logger = LoggerFactory.getLogger(SDNCAdapterRestV2IT.class); /** diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java index f3f950746c..2205d01cca 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -38,7 +40,8 @@ import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.bpmn.core.domain.*; import org.onap.so.bpmn.mock.FileUtil; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -47,7 +50,7 @@ import org.onap.so.logger.MsoLogger; @Ignore public class SniroHomingV1IT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,SniroHomingV1IT.class); + Logger logger = LoggerFactory.getLogger(SniroHomingV1IT.class); ServiceDecomposition serviceDecomposition = new ServiceDecomposition(); @@ -121,7 +124,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest { vnfModel.setModelType("testModelTypeVNF"); vnf.setModelInfo(vnfModel); vnfList.add(vnf); - logger.debug("SERVICE DECOMP: " + serviceDecomposition.getServiceResourcesJsonString()); + logger.debug("SERVICE DECOMP: {}", serviceDecomposition.getServiceResourcesJsonString()); serviceDecomposition.setModelInfo(sModel); serviceDecomposition.setAllottedResources(arList); serviceDecomposition.setVnfResources(vnfList); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java index e1a265b274..48790708f0 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java @@ -3,7 +3,9 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -39,7 +41,8 @@ import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.bpmn.mock.FileUtil; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit tests for UpdateAAIGenericVnf bpmn. @@ -47,7 +50,7 @@ import org.onap.so.logger.MsoLogger; public class UpdateAAIGenericVnfIT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleIT.class); + Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class); /** @@ -73,8 +76,8 @@ public class UpdateAAIGenericVnfIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "UAAIGenVnf_updateGenericVnfResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIGenVnf_updateGenericVnfResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(200, responseCode.intValue()); logEnd(); @@ -103,7 +106,7 @@ public class UpdateAAIGenericVnfIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException"); - logger.debug("Workflow Exception: " + workflowException); + logger.debug("Workflow Exception: {}", workflowException); Assert.assertNotNull(workflowException); logEnd(); @@ -132,8 +135,8 @@ public class UpdateAAIGenericVnfIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "UAAIGenVnf_getGenericVnfResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIGenVnf_getGenericVnfResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(404, responseCode.intValue()); logEnd(); @@ -164,8 +167,8 @@ public class UpdateAAIGenericVnfIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "UAAIGenVnf_updateGenericVnfResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIGenVnf_updateGenericVnfResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(404, responseCode.intValue()); logEnd(); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java index 3ff2657193..3dd2ac957c 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java @@ -3,7 +3,9 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -39,6 +41,8 @@ import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.mock.FileUtil; import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit tests for UpdateAAIVfModuleTest.bpmn. @@ -46,7 +50,7 @@ import org.onap.so.logger.MsoLogger; public class UpdateAAIVfModuleIT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,CreateAAIVfModuleIT.class); + Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class); /** @@ -72,8 +76,8 @@ public class UpdateAAIVfModuleIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "UAAIVfMod_updateVfModuleResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIVfMod_updateVfModuleResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(200, responseCode.intValue()); logEnd(); @@ -101,8 +105,8 @@ public class UpdateAAIVfModuleIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "UAAIVfMod_getVfModuleResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIVfMod_getVfModuleResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(404, responseCode.intValue()); logEnd(); @@ -132,8 +136,8 @@ public class UpdateAAIVfModuleIT extends BaseIntegrationTest { Assert.assertTrue(isProcessEnded(businessKey)); String response = (String) getVariableFromHistory(businessKey, "UAAIVfMod_updateVfModuleResponse"); Integer responseCode = (Integer) getVariableFromHistory(businessKey, "UAAIVfMod_updateVfModuleResponseCode"); - logger.debug("Subflow response code: " + responseCode); - logger.debug("Subflow response: " + response); + logger.debug("Subflow response code: {}", responseCode); + logger.debug("Subflow response: {}", response); Assert.assertEquals(404, responseCode.intValue()); logEnd(); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java index fc15e92bca..ad08f8b2bb 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java @@ -1,9 +1,11 @@ /*- - * ============LICENSE_START======================================================= + * ============LICENSE_START======================================================= * ONAP - SO - * ================================================================================ + * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -38,7 +40,8 @@ import org.junit.Ignore; import org.junit.Test; import org.onap.so.BaseIntegrationTest; import org.onap.so.bpmn.core.WorkflowException; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit tests for VnfAdapterRestV1. @@ -46,7 +49,7 @@ import org.onap.so.logger.MsoLogger; public class VnfAdapterRestV1IT extends BaseIntegrationTest { - MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,VnfAdapterRestV1IT.class); + Logger logger = LoggerFactory.getLogger(VnfAdapterRestV1IT.class); private static final String EOL = "\n"; @@ -256,7 +259,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest { waitForProcessEnd(businessKey, 10000); String response = (String) getVariableFromHistory(businessKey, "vnfAdapterRestV1Response"); - logger.debug("Response:\n" + response); + logger.debug("Response:\n{}", response); assertTrue(response!=null && response.contains("<createVfModuleResponse>")); assertTrue((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator")); @@ -285,7 +288,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest { waitForProcessEnd(businessKey, 10000); String response = (String) getVariableFromHistory(businessKey, "vnfAdapterRestV1Response"); - logger.debug("Response:\n" + response); + logger.debug("Response:\n{}", response); assertTrue(response.contains("<updateVfModuleResponse>")); assertTrue((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator")); @@ -314,7 +317,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest { waitForProcessEnd(businessKey, 10000); String response = (String) getVariableFromHistory(businessKey, "vnfAdapterRestV1Response"); - logger.debug("Response:\n" + response); + logger.debug("Response:\n{}", response); assertTrue(response.contains("<deleteVfModuleResponse>")); assertTrue((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator")); @@ -343,7 +346,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest { waitForProcessEnd(businessKey, 10000); String response = (String) getVariableFromHistory(businessKey, "vnfAdapterRestV1Response"); - logger.debug("Response:\n" + response); + logger.debug("Response:\n{}", response); assertTrue(response.contains("<rollbackVfModuleResponse>")); assertTrue((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator")); @@ -376,7 +379,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest { logger.debug(wfe.toString()); String response = (String) getVariableFromHistory(businessKey, "WorkflowResponse"); - logger.debug("Response:\n" + response); + logger.debug("Response:\n{}", response); assertTrue(response.contains("<vfModuleException>")); assertFalse((boolean) getVariableFromHistory(businessKey, "VNFREST_SuccessIndicator")); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java index d24e953196..117d3b213a 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -81,7 +83,8 @@ import org.onap.so.bpmn.common.workflow.service.WorkflowMessageResource; import org.onap.so.bpmn.common.workflow.service.WorkflowResource; import org.onap.so.bpmn.core.domain.Resource; import org.onap.so.bpmn.core.domain.ServiceDecomposition; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -106,7 +109,7 @@ import org.xml.sax.SAXException; public abstract class WorkflowTest { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, WorkflowTest.class); + private static final Logger logger = LoggerFactory.getLogger(WorkflowTest.class); //TODO this is not used anymore, can maybe be removed @Rule @@ -165,14 +168,14 @@ public abstract class WorkflowTest { * Logs a test start method. */ protected void logStart() { - msoLogger.debug("STARTED TEST"); + logger.debug("STARTED TEST"); } /** * Logs a test end method. */ protected void logEnd() { - msoLogger.debug("ENDED TEST"); + logger.debug("ENDED TEST"); } /** @@ -184,14 +187,14 @@ public abstract class WorkflowTest { protected void invokeSubProcess(String processKey, String businessKey, Map<String, Object> injectedVariables) { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); List<String> arguments = runtimeMxBean.getInputArguments(); - msoLogger.debug("JVM args = " + arguments); + logger.debug("JVM args = {}", arguments); msoRequestId = (String) injectedVariables.get("mso-request-id"); String requestId = (String) injectedVariables.get("msoRequestId"); if (msoRequestId == null && requestId == null) { String msg = "mso-request-id variable was not provided"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -205,14 +208,14 @@ public abstract class WorkflowTest { protected String invokeSubProcess(String processKey, Map<String, Object> injectedVariables) { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); List<String> arguments = runtimeMxBean.getInputArguments(); - msoLogger.debug("JVM args = " + arguments); + logger.debug("JVM args = {}", arguments); msoRequestId = (String) injectedVariables.get("mso-request-id"); String requestId = (String) injectedVariables.get("msoRequestId"); if (msoRequestId == null && requestId == null) { String msg = "mso-request-id variable was not provided"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -256,13 +259,13 @@ public abstract class WorkflowTest { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); List<String> arguments = runtimeMxBean.getInputArguments(); - msoLogger.debug("JVM args = " + arguments); + logger.debug("JVM args = {}", arguments); Map<String, Object> variables = createVariables(schemaVersion, businessKey, request, injectedVariables, false); VariableMapImpl variableMapImpl = createVariableMapImpl(variables); - msoLogger.debug("Sending " + request + " to " + processKey + " process"); + logger.debug("Sending {} to {} process", request, processKey); TestAsyncResponse asyncResponse = new TestAsyncResponse(); @@ -290,13 +293,13 @@ public abstract class WorkflowTest { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); List<String> arguments = runtimeMxBean.getInputArguments(); - msoLogger.debug("JVM args = " + arguments); + logger.debug("JVM args = {}", arguments); Map<String, Object> variables = createVariables(schemaVersion, businessKey, request, injectedVariables, serviceInstantiationModel); VariableMapImpl variableMapImpl = createVariableMapImpl(variables); - msoLogger.debug("Sending " + request + " to " + processKey + " process"); + logger.debug("Sending {} to {} process", request, processKey); return workflowResource.startProcessInstanceByKey( processKey, variableMapImpl); @@ -337,7 +340,7 @@ public abstract class WorkflowTest { for (String var : notAllowed) { if (var.equals(key)) { String msg = "Cannot specify " + var + " in injected variables"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } } @@ -367,11 +370,11 @@ public abstract class WorkflowTest { catch(Exception e) { } if (msoRequestId == null || msoRequestId.trim().equals("")) { - msoLogger.debug("No requestId element in injectedVariables"); + logger.debug("No requestId element in injectedVariables"); variables.put("mso-request-id", UUID.randomUUID().toString()); } if (msoServiceInstanceId == null || msoServiceInstanceId.trim().equals("")) { - msoLogger.debug("No seviceInstanceId element in injectedVariables"); + logger.debug("No seviceInstanceId element in injectedVariables"); variables.put("mso-service-instance-id", UUID.randomUUID().toString()); } @@ -387,7 +390,7 @@ public abstract class WorkflowTest { } if (msoRequestId == null || msoRequestId.trim().equals("")) { String msg = "No request-id element in " + request; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } } @@ -446,8 +449,7 @@ public abstract class WorkflowTest { */ protected WorkflowResponse receiveResponse(String businessKey, TestAsyncResponse asyncResponse, long timeout) { - msoLogger.debug("Waiting " + timeout + "ms for process with business key " + businessKey - + " to send a response"); + logger.debug("Waiting {}ms for process with business key {} to send a response", timeout, businessKey); long now = System.currentTimeMillis() + timeout; long endTime = now + timeout; @@ -456,7 +458,7 @@ public abstract class WorkflowTest { Response response = asyncResponse.getResponse(); if (response != null) { - msoLogger.debug("Received a response from process with business key " + businessKey); + logger.debug("Received a response from process with business key {}", businessKey); Object entity = response.getEntity(); @@ -464,7 +466,7 @@ public abstract class WorkflowTest { String msg = "Response entity is " + (entity == null ? "null" : entity.getClass().getName()) + ", expected WorkflowResponse"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); return null; // unreachable } @@ -477,7 +479,7 @@ public abstract class WorkflowTest { } catch (InterruptedException e) { String msg = "Interrupted waiting for a response from process with business key " + businessKey; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); return null; // unreachable } @@ -487,7 +489,7 @@ public abstract class WorkflowTest { String msg = "No response received from process with business key " + businessKey + " within " + timeout + "ms"; - msoLogger.debug(msg); + logger.debug(msg); fail("Process with business key " + businessKey + " did not end within 10000ms"); return null; // unreachable } @@ -525,7 +527,7 @@ public abstract class WorkflowTest { if (callbackData == null) { String msg = "No callback defined for '" + action + "' SDNC request"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -536,7 +538,7 @@ public abstract class WorkflowTest { contentType = JSON; } else { String msg = "Invalid SDNC program modifier: '" + modifier + "'"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -625,7 +627,7 @@ public abstract class WorkflowTest { if (callbackData == null) { String msg = "No callback defined for '" + action + "' SDNC request"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -637,7 +639,7 @@ public abstract class WorkflowTest { if (callbackData == null) { String msg = "No callback defined for '" + action + "' SDNC request"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -650,7 +652,7 @@ public abstract class WorkflowTest { respMsg = "SERVER ERROR"; } else { String msg = "Invalid SDNC program modifier: '" + modifier + "'"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -699,7 +701,7 @@ public abstract class WorkflowTest { if (callbackData == null) { String msg = "No callback defined for '" + action + "' VNF REST request"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -710,7 +712,7 @@ public abstract class WorkflowTest { contentType = "text/plain"; } else { String msg = "Invalid VNF REST program modifier: '" + modifier + "'"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -763,18 +765,18 @@ public abstract class WorkflowTest { if (callbackData == null) { String msg = "No callback defined for '" + action + "' VNF request"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } content = callbackData.getContent(); } else if ("ERR".equals(modifier)) { String msg = "Currently unsupported VNF program modifier: '" + modifier + "'"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } else { String msg = "Invalid VNF program modifier: '" + modifier + "'"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -790,7 +792,7 @@ public abstract class WorkflowTest { if (!injected) { String msg = "Failed to inject VNF '" + action + "' callback"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -810,8 +812,7 @@ public abstract class WorkflowTest { * @param timeout the timeout in milliseconds */ protected void waitForRunningProcessCount(String processKey, int count, long timeout) { - msoLogger.debug("Waiting " + timeout + "ms for there to be " + count + " " - + processKey + " instances"); + logger.debug("Waiting {}ms for there to be {} {} instances", timeout, count, processKey); long now = System.currentTimeMillis() + timeout; long endTime = now + timeout; @@ -824,8 +825,7 @@ public abstract class WorkflowTest { .list().size(); if (actual != last) { - msoLogger.debug("There are now " + actual + " " - + processKey + " instances"); + logger.debug("There are now {} {} instances", actual, processKey); last = actual; } @@ -838,7 +838,7 @@ public abstract class WorkflowTest { } catch (InterruptedException e) { String msg = "Interrupted waiting for there to be " + count + " " + processKey + " instances"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -847,7 +847,7 @@ public abstract class WorkflowTest { String msg = "Timed out waiting for there to be " + count + " " + processKey + " instances"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -862,8 +862,7 @@ public abstract class WorkflowTest { protected Object getProcessVariable(String processKey, String variable, long timeout) { - msoLogger.debug("Waiting " + timeout + "ms for " - + processKey + "." + variable + " to be set"); + logger.debug("Waiting " + timeout + "ms for " + processKey + "." + variable + " to be set"); long now = System.currentTimeMillis() + timeout; long endTime = now + timeout; @@ -874,10 +873,10 @@ public abstract class WorkflowTest { while (value == null) { if (now > endTime) { if (processInstance == null) { - msoLogger.debug("Timed out waiting for " + logger.debug("Timed out waiting for " + processKey + " to start"); } else { - msoLogger.debug("Timed out waiting for " + logger.debug("Timed out waiting for " + processKey + "[" + processInstance.getId() + "]." + variable + " to be set"); } @@ -896,7 +895,8 @@ public abstract class WorkflowTest { processInstance = processInstanceQuery.singleResult(); }else{ //TODO There shouldnt be more than one in the list but seems to be happening, need to figure out why happening and best way to get correct one from list - msoLogger.debug("Process Instance Query returned " + processInstanceQuery.count() + " instance. Getting the last instance in the list"); + logger.debug("Process Instance Query returned {} instance. Getting the last instance in the list", + processInstanceQuery.count()); List<ProcessInstance> processList = processInstanceQuery.list(); processInstance = processList.get((processList.size() - 1)); } @@ -910,15 +910,14 @@ public abstract class WorkflowTest { try { Thread.sleep(200); } catch (InterruptedException e) { - msoLogger.debug("Interrupted waiting for " - + processKey + "." + variable + " to be set"); + logger.debug("Interrupted waiting for {}.{} to be set", processKey, variable); return null; } now = System.currentTimeMillis(); } - msoLogger.debug(processKey + "[" + logger.debug(processKey + "[" + processInstance.getId() + "]." + variable + "=" + value); @@ -952,10 +951,10 @@ public abstract class WorkflowTest { // Deprecated usage. All test code should switch to the (( ... )) syntax. content = content.replace("{{REQUEST-ID}}", sdncRequestId); - msoLogger.debug("Injecting SDNC adapter callback"); + logger.debug("Injecting SDNC adapter callback"); Response response = workflowMessageResource.deliver(contentType, "SDNCAResponse", sdncRequestId, content); - msoLogger.debug("Workflow response to SDNC adapter callback: " + response); + logger.debug("Workflow response to SDNC adapter callback: " + response); return true; } @@ -987,7 +986,7 @@ public abstract class WorkflowTest { // TODO this needs to be fixed. It is causing double tags and content // Need to parse content before setting below since content includes not just RequestData or modify callback files to only contain RequestData contents. - msoLogger.debug("Injecting SDNC adapter callback"); + logger.debug("Injecting SDNC adapter callback"); CallbackHeader callbackHeader = new CallbackHeader(); callbackHeader.setRequestId(sdncRequestId); callbackHeader.setResponseCode(String.valueOf(respCode)); @@ -996,7 +995,7 @@ public abstract class WorkflowTest { sdncAdapterCallbackRequest.setCallbackHeader(callbackHeader); sdncAdapterCallbackRequest.setRequestData(content); SDNCAdapterResponse sdncAdapterResponse = callbackService.sdncAdapterCallback(sdncAdapterCallbackRequest); - msoLogger.debug("Workflow response to SDNC adapter callback: " + sdncAdapterResponse); + logger.debug("Workflow response to SDNC adapter callback: " + sdncAdapterResponse); return true; } @@ -1023,10 +1022,10 @@ public abstract class WorkflowTest { // Deprecated usage. All test code should switch to the (( ... )) syntax. content = content.replace("{{MESSAGE-ID}}", messageId); - msoLogger.debug("Injecting VNF adapter callback"); + logger.debug("Injecting VNF adapter callback"); Response response = workflowMessageResource.deliver(contentType, "VNFAResponse", messageId, content); - msoLogger.debug("Workflow response to VNF adapter callback: " + response); + logger.debug("Workflow response to VNF adapter callback: {}", response); return true; } @@ -1059,7 +1058,7 @@ public abstract class WorkflowTest { content = content.replace("{{REQUEST-ID}}", msoRequestId); } - msoLogger.debug("Injecting VNF adapter callback"); + logger.debug("Injecting VNF adapter callback"); // Is it possible to unmarshal this with JAXB? I couldn't. @@ -1132,8 +1131,8 @@ public abstract class WorkflowTest { createVnfNotification.setRollback(rollback); } catch (Exception e) { - msoLogger.debug("Failed to unmarshal VNF callback content:"); - msoLogger.debug(content); + logger.debug("Failed to unmarshal VNF callback content:"); + logger.debug(content); return false; } @@ -1175,7 +1174,7 @@ public abstract class WorkflowTest { // Deprecated usage. All test code should switch to the (( ... )) syntax. content = content.replace("{{MESSAGE-ID}}", messageId); - msoLogger.debug("Injecting VNF adapter delete callback"); + logger.debug("Injecting VNF adapter delete callback"); // Is it possible to unmarshal this with JAXB? I couldn't. @@ -1195,8 +1194,8 @@ public abstract class WorkflowTest { } } catch (Exception e) { - msoLogger.debug("Failed to unmarshal VNF Delete callback content:"); - msoLogger.debug(content); + logger.debug("Failed to unmarshal VNF Delete callback content:"); + logger.debug(content); return false; } @@ -1239,7 +1238,7 @@ public abstract class WorkflowTest { // Deprecated usage. All test code should switch to the (( ... )) syntax. content = content.replace("{{REQUEST-ID}}", msoRequestId); - msoLogger.debug("Injecting VNF adapter callback"); + logger.debug("Injecting VNF adapter callback"); // Is it possible to unmarshal this with JAXB? I couldn't. @@ -1308,8 +1307,8 @@ public abstract class WorkflowTest { updateVnfNotification.setRollback(rollback); } catch (Exception e) { - msoLogger.debug("Failed to unmarshal VNF callback content:"); - msoLogger.debug(content); + logger.debug("Failed to unmarshal VNF callback content:"); + logger.debug(content); return false; } @@ -1362,7 +1361,7 @@ public abstract class WorkflowTest { if (callbackData == null) { String msg = "No '" + action + "' workflow message callback is defined"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1370,7 +1369,7 @@ public abstract class WorkflowTest { if (messageType == null || messageType.trim().equals("")) { String msg = "No workflow message type is defined in the '" + action + "' callback"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1378,7 +1377,7 @@ public abstract class WorkflowTest { contentType = callbackData.getContentType(); } else { String msg = "Invalid workflow message program modifier: '" + modifier + "'"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1416,10 +1415,10 @@ public abstract class WorkflowTest { content = content.replace("((CORRELATOR))", correlator); } - msoLogger.debug("Injecting " + messageType + " message"); + logger.debug("Injecting " + messageType + " message"); Response response = workflowMessageResource.deliver(contentType, messageType, correlator, content); - msoLogger.debug("Workflow response to " + messageType + " message: " + response); + logger.debug("Workflow response to {} message: {}", messageType, response); return true; } @@ -1458,7 +1457,7 @@ public abstract class WorkflowTest { if (callbackData == null) { String msg = "No '" + action + "' workflow message callback is defined"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1466,7 +1465,7 @@ public abstract class WorkflowTest { if (messageType == null || messageType.trim().equals("")) { String msg = "No workflow message type is defined in the '" + action + "' callback"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1474,7 +1473,7 @@ public abstract class WorkflowTest { contentType = callbackData.getContentType(); } else { String msg = "Invalid workflow message program modifier: '" + modifier + "'"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1588,10 +1587,10 @@ public abstract class WorkflowTest { } } } - msoLogger.debug("Injecting " + messageType + " message"); + logger.debug("Injecting " + messageType + " message"); Response response = workflowMessageResource.deliver(contentType, messageType, correlator, content); - msoLogger.debug("Workflow response to " + messageType + " message: " + response); + logger.debug("Workflow response to {} message: {}", messageType, response); return true; } @@ -1602,15 +1601,14 @@ public abstract class WorkflowTest { * @param timeout the amount of time to wait, in milliseconds */ protected void waitForProcessEnd(String businessKey, long timeout) { - msoLogger.debug("Waiting " + timeout + "ms for process with business key " + - businessKey + " to end"); + logger.debug("Waiting {}ms for process with business key {} to end", timeout, businessKey); long now = System.currentTimeMillis() + timeout; long endTime = now + timeout; while (now <= endTime) { if (isProcessEnded(businessKey)) { - msoLogger.debug("Process with business key " + businessKey + " has ended"); + logger.debug("Process with business key {} has ended", businessKey); return; } @@ -1619,7 +1617,7 @@ public abstract class WorkflowTest { } catch (InterruptedException e) { String msg = "Interrupted waiting for process with business key " + businessKey + " to end"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1628,7 +1626,7 @@ public abstract class WorkflowTest { String msg = "Process with business key " + businessKey + " did not end within " + timeout + "ms"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1643,15 +1641,14 @@ public abstract class WorkflowTest { * @author cb645j */ protected void waitForProcessEnd(String businessKey, String processName, long timeout) { - msoLogger.debug("Waiting " + timeout + "ms for process with business key " + - businessKey + " to end"); + logger.debug("Waiting {}ms for process with business key {} to end", timeout, businessKey); long now = System.currentTimeMillis() + timeout; long endTime = now + timeout; while (now <= endTime) { if (isProcessEnded(businessKey, processName)) { - msoLogger.debug("Process with business key " + businessKey + " has ended"); + logger.debug("Process with business key {} has ended", businessKey); return; } @@ -1660,7 +1657,7 @@ public abstract class WorkflowTest { } catch (InterruptedException e) { String msg = "Interrupted waiting for process with business key " + businessKey + " to end"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1669,7 +1666,7 @@ public abstract class WorkflowTest { String msg = "Process with business key " + businessKey + " did not end within " + timeout + "ms"; - msoLogger.debug(msg); + logger.debug(msg); fail(msg); } @@ -1747,8 +1744,8 @@ public abstract class WorkflowTest { .variableName(variableName).singleResult(); return v == null ? null : v.getValue(); } catch (Exception e) { - msoLogger.debug("Error retrieving variable " + variableName + - " from historical process with business key " + businessKey + ": " + e); + logger.debug("Error retrieving variable {} from historical process with business key {}: ", variableName, businessKey, + e); return null; } } @@ -1777,10 +1774,12 @@ public abstract class WorkflowTest { return variable == null ? null : variable.getValue(); }catch(ProcessEngineException e){ - msoLogger.debug("Multiple proccess instances exist with process name " + processName + " and business key " + businessKey + ". Must pass instance index as a parameter."); + logger.debug("Multiple proccess instances exist with process name {} and business key {}. Must pass instance " + + "index as a parameter.", processName, businessKey); return null; }catch(Exception e){ - msoLogger.debug("Error retrieving variable " + variableName + " from historical process for process " + processName + " with business key " + businessKey + ": " + e); + logger.debug("Error retrieving variable {} from historical process for process {} with business key {}: ", + variableName, processName, businessKey, e); return null; } } @@ -1814,7 +1813,8 @@ public abstract class WorkflowTest { return variable == null ? null : variable.getValue(); }catch(Exception e) { - msoLogger.debug("Error retrieving variable " + variableName + " from historical process for process " + processName + " with business key " + businessKey + ": " + e); + logger.debug("Error retrieving variable {} from historical process for process {} with business key {}: ", + variableName, processName, businessKey, e); return null; } } @@ -1851,8 +1851,7 @@ public abstract class WorkflowTest { .variableName(variableName).singleResult(); return v == null ? null : v.getValue(); } catch (Exception e) { - msoLogger.debug("Error retrieving variable " + variableName + - " from sub flow: " + subflowName + ", Exception is: " + e); + logger.debug("Error retrieving variable {} from sub flow: {}, Exception is: ", variableName, subflowName, e); return null; } } @@ -1886,8 +1885,8 @@ public abstract class WorkflowTest { .variableName(variableName).singleResult(); return v == null ? null : v.getValue(); } catch (Exception e) { - msoLogger.debug("Error retrieving variable " + variableName + - " from " + subflowInstanceIndex + " instance index of sub flow: " + subflowName + ", Exception is: " + e); + logger.debug("Error retrieving variable {} from {} instance index of sub flow: {}, Exception is: ", variableName, + subflowInstanceIndex, subflowName, e); return null; } } diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java index 13fe61f704..5cc0281407 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java @@ -23,7 +23,7 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; -import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; +import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID; import java.util.HashMap; @@ -62,7 +62,7 @@ public class CreateAndActivatePnfResourceTest extends BaseIntegrationTest { @Test public void shouldWaitForMessageFromDmaapAndUpdateAaiEntryWhenAaiEntryExists() { // given - variables.put(CORRELATION_ID, PnfManagementTestImpl.ID_WITH_ENTRY); + variables.put(PNF_CORRELATION_ID, PnfManagementTestImpl.ID_WITH_ENTRY); // when ProcessInstance instance = runtimeService .startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables); @@ -73,7 +73,7 @@ public class CreateAndActivatePnfResourceTest extends BaseIntegrationTest { assertThat(instance).isEnded().hasPassedInOrder( "CreateAndActivatePnf_StartEvent", "CheckInputs", - "CheckAiiForCorrelationId", + "CheckAiiForPnfCorrelationId", "DoesAaiContainInfoAboutPnf", "AaiEntryExists", "InformDmaapClient", @@ -88,7 +88,7 @@ public class CreateAndActivatePnfResourceTest extends BaseIntegrationTest { @Test public void shouldCreateAaiEntryWaitForMessageFromDmaapAndUpdateAaiEntryWhenNoAaiEntryExists() { // given - variables.put(CORRELATION_ID, PnfManagementTestImpl.ID_WITHOUT_ENTRY); + variables.put(PNF_CORRELATION_ID, PnfManagementTestImpl.ID_WITHOUT_ENTRY); // when ProcessInstance instance = runtimeService .startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables); @@ -99,7 +99,7 @@ public class CreateAndActivatePnfResourceTest extends BaseIntegrationTest { assertThat(instance).isEnded().hasPassedInOrder( "CreateAndActivatePnf_StartEvent", "CheckInputs", - "CheckAiiForCorrelationId", + "CheckAiiForPnfCorrelationId", "DoesAaiContainInfoAboutPnf", "CreatePnfEntryInAai", "AaiEntryExists", diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java index 146e07b820..6a5f9fac74 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/DmaapClientTestImpl.java @@ -30,19 +30,19 @@ import org.springframework.stereotype.Component; @Primary public class DmaapClientTestImpl implements DmaapClient { - private String correlationId; + private String pnfCorrelationId; private Runnable informConsumer; @Override - public void registerForUpdate(String correlationId, Runnable informConsumer) { - this.correlationId = correlationId; + public void registerForUpdate(String pnfCorrelationId, Runnable informConsumer) { + this.pnfCorrelationId = pnfCorrelationId; this.informConsumer = informConsumer; } @Override - public Runnable unregister(String correlationId) { - if (Objects.equals(this.correlationId, correlationId)) { - this.correlationId = null; + public Runnable unregister(String pnfCorrelationId) { + if (Objects.equals(this.pnfCorrelationId, pnfCorrelationId)) { + this.pnfCorrelationId = null; Runnable informConsumer = this.informConsumer; this.informConsumer = null; return informConsumer; @@ -50,8 +50,8 @@ public class DmaapClientTestImpl implements DmaapClient { return null; } - public String getCorrelationId() { - return correlationId; + public String getPnfCorrelationId() { + return pnfCorrelationId; } public Runnable getInformConsumer() { @@ -63,6 +63,6 @@ public class DmaapClientTestImpl implements DmaapClient { } public boolean haveRegisteredConsumer() { - return correlationId != null; + return pnfCorrelationId != null; } } diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java index 84c983619b..f9db93e3f7 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java @@ -40,8 +40,8 @@ public class PnfManagementTestImpl implements PnfManagement { private Map<String, String> serviceAndPnfRelationMap = new HashMap<>(); @Override - public Optional<Pnf> getEntryFor(String correlationId) { - if (Objects.equals(correlationId, ID_WITH_ENTRY)) { + public Optional<Pnf> getEntryFor(String pnfCorrelationId) { + if (Objects.equals(pnfCorrelationId, ID_WITH_ENTRY)) { return Optional.of(new Pnf()); } else { return Optional.empty(); @@ -49,8 +49,8 @@ public class PnfManagementTestImpl implements PnfManagement { } @Override - public void createEntry(String correlationId, Pnf entry) { - created.put(correlationId, entry); + public void createEntry(String pnfCorrelationId, Pnf entry) { + created.put(pnfCorrelationId, entry); } @Override diff --git a/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml b/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml index 21ad485fdb..56a92cbd01 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml +++ b/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml @@ -157,7 +157,7 @@ sniro: headers.latestVersion: 2 spring: datasource: - jdbcUrl: jdbc:mariadb://localhost:3307/camundabpmn + url: jdbc:mariadb://localhost:3307/camundabpmn username: root password: password driver-class-name: org.mariadb.jdbc.Driver |