From a5c5b045553342376e240a506a05d0f7b947d191 Mon Sep 17 00:00:00 2001 From: "Bonkur, Venkat" Date: Wed, 25 Mar 2020 17:02:20 -0400 Subject: mso vnf configuration update composite flow Existing Change Management VNF Configuration Update flow migrated to the generic building blocks Introduced Activity BB VNFConfigModifyActivity.bpmn Updates to AppcOrcherationPreProcessor, ApplicationControllerTaskImpl to handle the ConfigModify Activity block. Updates to the catalog migration scripts to include VNF-Config-Update Macro flow. Issue-ID: SO-2768 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I06be7a83fb2738b91b0257e1ec84298a7dafc1a1 --- .../Activity/VNFConfigModifyActivity.bpmn | 67 ++++++++++++++++++++++ .../subprocess/VNFConfigModifyActivityTest.java | 54 +++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFConfigModifyActivity.bpmn create mode 100644 bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFConfigModifyActivityTest.java (limited to 'bpmn/so-bpmn-building-blocks/src') diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFConfigModifyActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFConfigModifyActivity.bpmn new file mode 100644 index 0000000000..d77b1cebb1 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFConfigModifyActivity.bpmn @@ -0,0 +1,67 @@ + + + + + SequenceFlow_0d87xrn + + + SequenceFlow_05oatn2 + SequenceFlow_1pg83wr + + + + SequenceFlow_1pg83wr + + + + SequenceFlow_0d87xrn + SequenceFlow_05oatn2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFConfigModifyActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFConfigModifyActivityTest.java new file mode 100644 index 0000000000..99ee8d9fcb --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFConfigModifyActivityTest.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doThrow; +import java.util.List; +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.junit.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.BaseBPMNTest; + +public class VNFConfigModifyActivityTest extends BaseBPMNTest { + @Test + public void sunnyDayVNFConfigModifyActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFConfigModifyActivity", variables); + assertThat(pi).isNotNull(); + processExternalTasks(pi, "ConfigModify"); + assertThat(pi).isStarted().hasPassedInOrder("Start_VNFConfigModifyActivity", "PreProcessActivity", + "ConfigModify", "End_VNFConfigModifyActivity"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFConfigModifyActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor) + .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFConfigModifyActivity", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_VNFConfigModifyActivity", "PreProcessActivity") + .hasNotPassed("ConfigModify", "End_VNFConfigModifyActivity"); + } + +} -- cgit 1.2.3-korg