aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test/java/org/onap
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2021-01-12 09:12:23 -0500
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2021-08-04 08:55:43 -0400
commit30106b39d2ac1bc206134cfcb8fc73eb1f29b923 (patch)
treebe83e5d35925fdd87c39cba7607feaefc23c34b5 /bpmn/MSOCommonBPMN/src/test/java/org/onap
parent872613eafe80034cca612bd93294286b3dbed4b1 (diff)
Add new endpoint and macro for service upgrade
This enables upgrading an existing service instance by updating its model UUID's in AAI and md-sal. Issue-ID: SO-3636 Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca> Change-Id: Ic5f067a1267053a61f46e2d9563ca4e4ac869bdf
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/onap')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
index 8961c996a8..b561055468 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
@@ -46,6 +46,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.UUID;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Assert;
import org.junit.Rule;
@@ -2984,6 +2985,31 @@ public class BBInputSetupTest {
}
@Test
+ public void testGetGBBMacroExistingServiceUpgrade() throws Exception {
+ String requestAction = "upgradeInstance";
+ GeneralBuildingBlock gBB = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"),
+ GeneralBuildingBlock.class);
+ ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
+ ExecuteBuildingBlock.class);
+ RequestDetails requestDetails = mapper
+ .readValue(new File(RESOURCE_PATH + "RequestDetailsInput_serviceUpgrade.json"), RequestDetails.class);
+ Map<ResourceKey, String> lookupKeyMap = prepareLookupKeyMap();
+ executeBB.setRequestDetails(requestDetails);
+
+ doReturn(new Service()).when(SPY_bbInputSetupUtils)
+ .getCatalogServiceByModelUUID(requestDetails.getModelInfo().getModelVersionId());
+ doReturn(new org.onap.aai.domain.yang.ServiceInstance()).when(SPY_bbInputSetupUtils)
+ .getAAIServiceInstanceById(lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID));
+ doReturn(gBB).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(any(BBInputSetupParameter.class));
+
+ SPY_bbInputSetup.getGBBMacroExistingService(executeBB, lookupKeyMap,
+ executeBB.getBuildingBlock().getBpmnFlowName(), requestAction, null);
+
+ verify(SPY_bbInputSetupUtils, times(1))
+ .getCatalogServiceByModelUUID(requestDetails.getModelInfo().getModelVersionId());
+ }
+
+ @Test
public void testGetGBBMacroExistingServiceServiceinstancenotFoundInAai() throws Exception {
ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
ExecuteBuildingBlock.class);