From 608c16ee7f19f3fdbf9168902d21e5a905d1d91d Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan (sk720x)" Date: Thu, 15 Apr 2021 13:26:34 -0400 Subject: Added logging statements for skip post inst conf class Issue-ID: SO-3626 Change-Id: I618b6b6b6049f94bc6c9bfe6be893ac022f2449e Signed-off-by: Kalkere Ramesh, Sharan (sk720x) --- .../org/onap/so/db/catalog/client/CatalogDbClientTest.java | 6 +++--- .../src/test/resources/db/migration/afterMigrate.sql | 6 +++--- .../java/org/onap/so/asdc/client/ASDCControllerITTest.java | 6 +++--- .../infrastructure/pnf/delegate/ConfigCheckerDelegate.java | 2 +- .../tasks/listeners/SkipCDSBuildingBlockListener.java | 14 +++++++++++--- .../workflow/tasks/listeners/SkipConfigVnfListener.java | 2 +- .../onap/so/db/catalog/beans/PnfResourceCustomization.java | 2 +- .../main/java/org/onap/so/db/catalog/beans/Service.java | 2 +- .../onap/so/db/catalog/beans/VfModuleCustomization.java | 2 +- .../onap/so/db/catalog/beans/VnfResourceCustomization.java | 2 +- .../data/repository/PnfCustomizationRepositoryTest.java | 2 +- 11 files changed, 27 insertions(+), 19 deletions(-) diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index c202170235..8ce4051b24 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -197,8 +197,8 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { assertNotNull(vnfResourceCustomization.getVnfResources()); assertNotNull(vnfResourceCustomization.getVfModuleCustomizations()); assertEquals("vSAMP10a", vnfResourceCustomization.getVnfResources().getModelName()); - assertTrue("skip post instantiation configuration", - vnfResourceCustomization.isSkipPostInstConf().booleanValue()); + assertFalse("skip post instantiation configuration", + vnfResourceCustomization.getSkipPostInstConf().booleanValue()); } @Test @@ -617,7 +617,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { assertEquals("modelInstanceName", "PNF routing", pnfResourceCustomization.getModelInstanceName()); assertEquals("blueprintName", "test_configuration_restconf", pnfResourceCustomization.getBlueprintName()); assertEquals("blueprintVersion", "1.0.0", pnfResourceCustomization.getBlueprintVersion()); - assertTrue("skip post instantiation configuration", pnfResourceCustomization.isSkipPostInstConf()); + assertTrue("skip post instantiation configuration", pnfResourceCustomization.getSkipPostInstConf()); PnfResource pnfResource = pnfResourceCustomization.getPnfResources(); assertNotNull(pnfResource); assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID()); diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 53a457dadf..c975f8b755 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -64,9 +64,9 @@ insert into vnf_resource(orchestration_mode, description, creation_timestamp, mo ('HEAT', '1607 vSAMP10a - inherent network', '2017-04-14 21:46:28', 'ff2ae348-214a-11e7-93ae-92361f002672', '', '', '2fff5b20-214b-11e7-93ae-92361f002671', '2.0', 'vSAMP10a', 'VF', 'ff874603-4222-11e7-9252-005056850d2e'); -insert into vnf_resource_customization(model_customization_uuid, model_instance_name, min_instances, max_instances, availability_zone_max_count, nf_type, nf_role, nf_function, nf_naming_code, creation_timestamp, vnf_resource_model_uuid, multi_stage_design,service_model_uuid,resource_input) values -('68dc9a92-214c-11e7-93ae-92361f002671', 'vSAMP10a 1', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002671', null,'5df8b6de-2083-11e7-93ae-92361f002671', '{\\\"resource_input\\\":\\\"test\\\"}'), -('68dc9a92-214c-11e7-93ae-92361f002672', 'vSAMP10a 2', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002672', null,'5df8b6de-2083-11e7-93ae-92361f002672', null); +insert into vnf_resource_customization(model_customization_uuid, model_instance_name, min_instances, max_instances, availability_zone_max_count, nf_type, nf_role, nf_function, nf_naming_code, creation_timestamp, vnf_resource_model_uuid, multi_stage_design,service_model_uuid,resource_input,skip_post_instantiation_configuration) values +('68dc9a92-214c-11e7-93ae-92361f002671', 'vSAMP10a 1', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002671', null,'5df8b6de-2083-11e7-93ae-92361f002671', '{\\\"resource_input\\\":\\\"test\\\"}', false), +('68dc9a92-214c-11e7-93ae-92361f002672', 'vSAMP10a 2', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002672', null,'5df8b6de-2083-11e7-93ae-92361f002672', null, false); diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java index bf2b8ad7bc..556e5b910f 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java @@ -262,7 +262,7 @@ public class ASDCControllerITTest extends BaseTest { pnfCustomization.getBlueprintName()); assertEquals("cds blueprint version(sdnc_model_version property)", "v1.4.0", pnfCustomization.getBlueprintVersion()); - assertTrue("skip post instantiation configuration", pnfCustomization.isSkipPostInstConf()); + assertTrue("skip post instantiation configuration", pnfCustomization.getSkipPostInstConf()); assertEquals("controller actor", "SO-REF-DATA", pnfCustomization.getControllerActor()); /** @@ -533,7 +533,7 @@ public class ASDCControllerITTest extends BaseTest { assertEquals("cds blueprint version(sdnc_model_version property)", "1.0.0", pnfCustomization.getBlueprintVersion()); assertEquals("default software version", "4.0.0", pnfCustomization.getDefaultSoftwareVersion()); - assertTrue("skip post instantiation configuration", pnfCustomization.isSkipPostInstConf()); + assertTrue("skip post instantiation configuration", pnfCustomization.getSkipPostInstConf()); assertEquals("controller actor", "SO-REF-DATA", pnfCustomization.getControllerActor()); /** @@ -643,7 +643,7 @@ public class ASDCControllerITTest extends BaseTest { assertEquals("cds blueprint version(sdnc_model_version property)", "1.0.0", pnfCustomization.getBlueprintVersion()); assertEquals("default software version", "foo-123", pnfCustomization.getDefaultSoftwareVersion()); - assertTrue("skip post instantiation configuration", pnfCustomization.isSkipPostInstConf()); + assertTrue("skip post instantiation configuration", pnfCustomization.getSkipPostInstConf()); assertEquals("controller actor", "SO-REF-DATA", pnfCustomization.getControllerActor()); /** diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java index 37b9376e14..0136c30bee 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java @@ -73,7 +73,7 @@ public class ConfigCheckerDelegate implements JavaDelegate { catalogDbClient.getPnfResourceCustomizationByModelUuid(serviceModelUuid); if (pnfCustomizations != null && !pnfCustomizations.isEmpty()) { PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0); - boolean skipPostInstantiationConfiguration = pnfResourceCustomization.isSkipPostInstConf(); + boolean skipPostInstantiationConfiguration = pnfResourceCustomization.getSkipPostInstConf(); delegateExecution.setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION, skipPostInstantiationConfiguration); delegateExecution.setVariable(PRC_BLUEPRINT_NAME, pnfResourceCustomization.getBlueprintName()); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java index 3af839fbec..272c6189b4 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java @@ -27,12 +27,15 @@ import java.util.Set; import org.apache.logging.log4j.util.Strings; import org.onap.so.bpmn.common.BBConstants; import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner; import org.onap.so.bpmn.common.listener.flowmanipulator.PreFlowManipulator; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.db.catalog.beans.PnfResourceCustomization; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.VnfResourceCustomization; import org.onap.so.db.catalog.client.CatalogDbClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -40,6 +43,8 @@ import org.springframework.util.CollectionUtils; @Component public class SkipCDSBuildingBlockListener implements PreFlowManipulator { + private static Logger logger = LoggerFactory.getLogger(SkipCDSBuildingBlockListener.class); + @Autowired private CatalogDbClient catalogDbClient; @@ -84,7 +89,8 @@ public class SkipCDSBuildingBlockListener implements PreFlowManipulator { VnfResourceCustomization vrc = catalogDbClient.findVnfResourceCustomizationInList(customizationUUID, vnfResourceCustomizations); if (null != vrc) { - boolean skipConfigVNF = vrc.isSkipPostInstConf().booleanValue(); + logger.debug("getSkipPostInstConf value: " + vrc.getSkipPostInstConf().booleanValue()); + boolean skipConfigVNF = vrc.getSkipPostInstConf().booleanValue(); currentSequenceSkipCheck(execution, skipConfigVNF); } @@ -96,7 +102,8 @@ public class SkipCDSBuildingBlockListener implements PreFlowManipulator { catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(customizationUUID); if (null != vfc) { - boolean skipVfModule = vfc.isSkipPostInstConf(); + logger.debug("getSkipPostInstConf value: " + vfc.getSkipPostInstConf().booleanValue()); + boolean skipVfModule = vfc.getSkipPostInstConf(); currentSequenceSkipCheck(execution, skipVfModule); } @@ -106,7 +113,8 @@ public class SkipCDSBuildingBlockListener implements PreFlowManipulator { catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(customizationUUID); if (null != pnfResourceCustomization) { - boolean skipConfigPNF = pnfResourceCustomization.isSkipPostInstConf(); + logger.debug("getSkipPostInstConf value: " + pnfResourceCustomization.getSkipPostInstConf()); + boolean skipConfigPNF = pnfResourceCustomization.getSkipPostInstConf(); currentSequenceSkipCheck(execution, skipConfigPNF); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java index 5ffba455b3..8c74e3df69 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java @@ -34,7 +34,7 @@ public class SkipConfigVnfListener implements PreFlowManipulator { if (vnfResourceCustomizations != null && !vnfResourceCustomizations.isEmpty()) { VnfResourceCustomization vrc = catalogDbClient.findVnfResourceCustomizationInList(vnfCustomizationUUID, vnfResourceCustomizations); - boolean skipConfigVNF = vrc.isSkipPostInstConf().booleanValue(); + boolean skipConfigVNF = vrc.getSkipPostInstConf().booleanValue(); if (skipConfigVNF) { execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, ((int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE)) + 1); diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java index 2dea0bb752..0cfb253fd9 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java @@ -223,7 +223,7 @@ public class PnfResourceCustomization implements Serializable { this.blueprintVersion = blueprintVersion; } - public boolean isSkipPostInstConf() { + public boolean getSkipPostInstConf() { return skipPostInstConf; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java index 3cca869663..b4c75ba776 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java @@ -460,7 +460,7 @@ public class Service implements Serializable { this.blueprintVersion = blueprintVersion; } - public Boolean isSkipPostInstConf() { + public Boolean getSkipPostInstConf() { return skipPostInstConf; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java index f745bb8609..605fdef63b 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java @@ -243,7 +243,7 @@ public class VfModuleCustomization implements Serializable { this.cvnfcCustomization = cvnfcCustomization; } - public Boolean isSkipPostInstConf() { + public Boolean getSkipPostInstConf() { return skipPostInstConf; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java index 740e51a269..174c5a21eb 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java @@ -327,7 +327,7 @@ public class VnfResourceCustomization implements Serializable { this.blueprintVersion = blueprintVersion; } - public Boolean isSkipPostInstConf() { + public Boolean getSkipPostInstConf() { return skipPostInstConf; } diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java index d0c621ddd0..5477e3e563 100644 --- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java +++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java @@ -50,7 +50,7 @@ public class PnfCustomizationRepositoryTest extends BaseTest { assertEquals("modelInstanceName", "PNF routing", pnfResourceCustomization.getModelInstanceName()); assertEquals("blueprintName", "test_configuration_restconf", pnfResourceCustomization.getBlueprintName()); assertEquals("blueprintVersion", "1.0.0", pnfResourceCustomization.getBlueprintVersion()); - assertTrue("skip post instantiation configuration", pnfResourceCustomization.isSkipPostInstConf()); + assertTrue("skip post instantiation configuration", pnfResourceCustomization.getSkipPostInstConf()); PnfResource pnfResource = pnfResourceCustomization.getPnfResources(); assertNotNull(pnfResource); -- cgit 1.2.3-korg