diff options
author | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2021-02-18 14:19:02 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-02-18 14:19:02 +0000 |
commit | ec5cd7680b3b485e35397e1aa626ae30a80077c6 (patch) | |
tree | c42bf13e28ba18fa71a5cde527af8d2efaa2577b | |
parent | 48997934fa955d2b89eab9742634e4251113e6bf (diff) | |
parent | b02ced4ac80ef8b59421928355e83ba8cc9febd4 (diff) |
Merge "Increase code coverage for ExecuteBuildingBlockBuilder class"
2 files changed, 24 insertions, 1 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java index b8699838e2..2138f489ee 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java @@ -204,7 +204,7 @@ public class ExecuteBuildingBlockBuilder { isVirtualLink, resource.getVirtualLinkKey(), null, isConfiguration, null))); } - private ConfigurationResourceKeys getConfigurationResourceKeys(Resource resource, String vnfcName) { + protected ConfigurationResourceKeys getConfigurationResourceKeys(Resource resource, String vnfcName) { ConfigurationResourceKeys configurationResourceKeys = new ConfigurationResourceKeys(); Optional.ofNullable(vnfcName).ifPresent(configurationResourceKeys::setVnfcName); configurationResourceKeys.setCvnfcCustomizationUUID(resource.getCvnfModuleCustomizationId()); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilderTest.java index c8914f6e02..fae2317c8d 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilderTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilderTest.java @@ -27,6 +27,7 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; import org.junit.Test; +import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; import java.util.ArrayList; @@ -87,4 +88,26 @@ public class ExecuteBuildingBlockBuilderTest { } assertNotNull(result); } + + @Test + public void getConfigurationResourceKeysTest() { + String vnfcName = "vnfc"; + String vfModuleCustomizationId = "1a2b3c4e5d"; + String cvnfModuleCustomizationId = "2b1a3c"; + String vnfCustomizationId = "zz12aa"; + + Resource resource = new Resource(WorkflowType.SERVICE, "123", true); + + resource.setCvnfModuleCustomizationId(vfModuleCustomizationId); + resource.setCvnfModuleCustomizationId(cvnfModuleCustomizationId); + resource.setVnfCustomizationId(vnfCustomizationId); + + ConfigurationResourceKeys confResourceKeys = executeBBBuilder.getConfigurationResourceKeys(resource, vnfcName); + + assertNotNull(confResourceKeys); + assertEquals(vnfcName, confResourceKeys.getVnfcName()); + assertEquals(cvnfModuleCustomizationId, confResourceKeys.getCvnfcCustomizationUUID()); + assertEquals(vnfCustomizationId, confResourceKeys.getVnfResourceCustomizationUUID()); + + } } |