diff options
20 files changed, 47 insertions, 359 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java index 5cb870e0d7..6a62a5de61 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java @@ -592,7 +592,9 @@ public class HeatBridgeImpl implements HeatBridgeApi { boolean relationshipExist = sriovVfHasSriovPfRelationship(sriovVfUri); - String pserverHostName = port.getHostId(); + + Server server = getOpenstackServerById(port.getDeviceId()); + String pserverHostName = server.getHypervisorHostname(); lIf.setInterfaceDescription("Attached to SR-IOV port: " + pserverHostName); if (!relationshipExist) { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java index 55d76819fc..e5d8a921a5 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java @@ -92,7 +92,7 @@ public class AbstractCDSProcessingBBUtils { * * @param execution BuildingBlockExecution object */ - public void constructExecutionServiceInputObject(BuildingBlockExecution execution) { + public void constructExecutionServiceInputObjectBB(BuildingBlockExecution execution) { logger.trace("Start AbstractCDSProcessingBBUtils.preProcessRequest for BuildingBlockExecution object."); try { @@ -136,7 +136,7 @@ public class AbstractCDSProcessingBBUtils { * * @param execution BuildingBlockExecution object */ - public void sendRequestToCDSClient(BuildingBlockExecution execution) { + public void sendRequestToCDSClientBB(BuildingBlockExecution execution) { logger.trace("Start AbstractCDSProcessingBBUtils.sendRequestToCDSClient for BuildingBlockExecution object."); try { diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java index 10844ec652..40b0ed5624 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtilsTest.java @@ -97,7 +97,7 @@ public class AbstractCDSProcessingBBUtilsTest { BuildingBlockExecution execution = mock(BuildingBlockExecution.class); when(execution.getVariable("executionObject")).thenReturn(abstractCDSPropertiesBean); - abstractCDSProcessingBBUtils.constructExecutionServiceInputObject(execution); + abstractCDSProcessingBBUtils.constructExecutionServiceInputObjectBB(execution); verify(exceptionUtil, times(0)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), anyInt(), any(Exception.class)); } @@ -107,7 +107,7 @@ public class AbstractCDSProcessingBBUtilsTest { BuildingBlockExecution execution = mock(BuildingBlockExecution.class); when(execution.getVariable("executionServiceInput")).thenReturn(abstractCDSPropertiesBean); - abstractCDSProcessingBBUtils.sendRequestToCDSClient(execution); + abstractCDSProcessingBBUtils.sendRequestToCDSClientBB(execution); verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), anyInt(), any(Exception.class)); diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn index ccd6b0bd48..a69ee25a3a 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn @@ -10,11 +10,11 @@ <bpmn:endEvent id="EndEvent_1h3epjc"> <bpmn:incoming>SequenceFlow_161g9uz</bpmn:incoming> </bpmn:endEvent> - <bpmn:serviceTask id="Task_06n9c9v" name="Get Required data to call CDS Client" camunda:expression="${AbstractCDSProcessingBBUtils.constructExecutionServiceInputObject(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:serviceTask id="Task_06n9c9v" name="Get Required data to call CDS Client" camunda:expression="${AbstractCDSProcessingBBUtils.constructExecutionServiceInputObjectBB(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_02v5z4h</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0gksy4i</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:serviceTask id="Task_0kjfr5o" name="CDS (Call SelfServiceAPI) " camunda:expression="${AbstractCDSProcessingBBUtils.sendRequestToCDSClient(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:serviceTask id="Task_0kjfr5o" name="CDS (Call SelfServiceAPI) " camunda:expression="${AbstractCDSProcessingBBUtils.sendRequestToCDSClientBB(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_0gksy4i</bpmn:incoming> <bpmn:outgoing>SequenceFlow_161g9uz</bpmn:outgoing> </bpmn:serviceTask> @@ -47,4 +47,4 @@ </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> -</bpmn:definitions> +</bpmn:definitions>
\ No newline at end of file diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java index d78b7c3af0..1fae5ce06c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBB.java @@ -84,7 +84,7 @@ public class GenericCDSProcessingBB implements ControllerRunnable<BuildingBlockE @Override public void run(ControllerContext<BuildingBlockExecution> context) { BuildingBlockExecution obj = context.getExecution(); - cdsDispather.constructExecutionServiceInputObject(obj); - cdsDispather.sendRequestToCDSClient(obj); + cdsDispather.constructExecutionServiceInputObjectBB(obj); + cdsDispather.sendRequestToCDSClientBB(obj); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java index 3b81d52703..fe6d9de199 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericPnfCDSControllerRunnableBB.java @@ -94,8 +94,8 @@ public class GenericPnfCDSControllerRunnableBB implements ControllerRunnable<Bui @Override public void run(ControllerContext<BuildingBlockExecution> controllerContext) { BuildingBlockExecution buildingBlockExecution = controllerContext.getExecution(); - abstractCDSProcessingBBUtils.constructExecutionServiceInputObject(buildingBlockExecution); - abstractCDSProcessingBBUtils.sendRequestToCDSClient(buildingBlockExecution); + abstractCDSProcessingBBUtils.constructExecutionServiceInputObjectBB(buildingBlockExecution); + abstractCDSProcessingBBUtils.sendRequestToCDSClientBB(buildingBlockExecution); } private AbstractCDSPropertiesBean prepareAndSetCdsPropertyBean(BuildingBlockExecution buildingBlockExecution) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 0f955e2851..d9ad245e76 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -88,6 +88,7 @@ import org.onap.so.serviceinstancebeans.ModelType; import org.onap.so.serviceinstancebeans.Networks; import org.onap.so.serviceinstancebeans.Pnfs; import org.onap.so.serviceinstancebeans.RelatedInstance; +import org.onap.so.serviceinstancebeans.RelatedInstanceList; import org.onap.so.serviceinstancebeans.RequestDetails; import org.onap.so.serviceinstancebeans.Service; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; @@ -566,6 +567,20 @@ public class WorkflowAction { } else { vfModuleCustomizationUUID = aaiVfModule.getModelCustomizationId(); } + String replaceVfModuleCustomizationUUID = ""; + String replaceVnfModuleCustomizationUUID = ""; + boolean isReplace = false; + if (dataObj.getRequestAction().equalsIgnoreCase("replaceInstance") + || dataObj.getRequestAction().equalsIgnoreCase("replaceInstanceRetainAssignments")) { + for (RelatedInstanceList relatedInstList : dataObj.getRequestDetails().getRelatedInstanceList()) { + RelatedInstance relatedInstance = relatedInstList.getRelatedInstance(); + if (relatedInstance.getModelInfo().getModelType().equals(ModelType.vnf)) { + replaceVnfModuleCustomizationUUID = relatedInstance.getModelInfo().getModelCustomizationId(); + } + } + replaceVfModuleCustomizationUUID = dataObj.getRequestDetails().getModelInfo().getModelCustomizationId(); + isReplace = true; + } List<org.onap.aai.domain.yang.Vnfc> vnfcs = getRelatedResourcesInVfModule(vnfId, vfModuleId, org.onap.aai.domain.yang.Vnfc.class, Types.VNFC); @@ -579,9 +594,19 @@ public class WorkflowAction { } workflowIdsCopy.setConfigurationId(configuration.getConfigurationId()); for (OrchestrationFlow orchFlow : result) { - dataObj.getResourceKey().setVfModuleCustomizationId(vfModuleCustomizationUUID); + if (!isReplace) { + dataObj.getResourceKey().setVfModuleCustomizationId(vfModuleCustomizationUUID); + dataObj.getResourceKey().setVnfCustomizationId(vnfCustomizationUUID); + } else { + if (orchFlow.getFlowName().contains("Delete")) { + dataObj.getResourceKey().setVfModuleCustomizationId(vfModuleCustomizationUUID); + dataObj.getResourceKey().setVnfCustomizationId(vnfCustomizationUUID); + } else { + dataObj.getResourceKey().setVfModuleCustomizationId(replaceVfModuleCustomizationUUID); + dataObj.getResourceKey().setVnfCustomizationId(replaceVnfModuleCustomizationUUID); + } + } dataObj.getResourceKey().setCvnfModuleCustomizationId(vnfc.getModelCustomizationId()); - dataObj.getResourceKey().setVnfCustomizationId(vnfCustomizationUUID); String vnfcName = vnfc.getVnfcName(); if (vnfcName == null || vnfcName.isEmpty()) { buildAndThrowException(dataObj.getExecution(), "Exception in create execution list " diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index f0898ace81..43a85051be 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -414,9 +414,12 @@ public class WorkflowActionBBTasks { String handlingCode = (String) execution.getVariable(HANDLINGCODE); final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); + String requestAction = (String) execution.getVariable(G_ACTION); ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1); String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName(); - if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode)) { + if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode) + && !(requestAction.equalsIgnoreCase("replaceInstance") + || requestAction.equalsIgnoreCase("replaceInstanceRetainAssignments"))) { postProcessingExecuteBBActivateVfModule(execution, ebb, flowsToExecute); } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java index 24bbc78afb..e360dc7c42 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericCDSProcessingBBTest.java @@ -102,8 +102,8 @@ public class GenericCDSProcessingBBTest extends BaseTaskTest { AbstractCDSPropertiesBean cdsBean = prepareCDSBean(); doReturn(cdsBean).when(generatePayloadForCds).buildCdsPropertiesBean(buildingBlockExecution); - doNothing().when(cdsDispather).constructExecutionServiceInputObject(buildingBlockExecution); - doNothing().when(cdsDispather).sendRequestToCDSClient(buildingBlockExecution); + doNothing().when(cdsDispather).constructExecutionServiceInputObjectBB(buildingBlockExecution); + doNothing().when(cdsDispather).sendRequestToCDSClientBB(buildingBlockExecution); // when Boolean isUnderstandable = controllerRunnable.understand(controllerContext); diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStack.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStack.java deleted file mode 100644 index cbb375ae55..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStack.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Openstack-CreateStack") -@RequestMapping(value = "/sim/v1/tenantOne/stacks", method = RequestMethod.POST) -public class CreateStack extends AbstractSimulatorScenario { - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().post().extractFromPayload("$.stack_name", "stackName"); - - scenario.action(new CreateAAInventory()); - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Create.json")); - - - } - - -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStackAudit.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStackAudit.java deleted file mode 100644 index 35e0571b14..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateStackAudit.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Openstack-CreateStackAudit") -@RequestMapping(value = "/sim/mockPublicUrlThree/stacks", method = RequestMethod.POST) -public class CreateStackAudit extends AbstractSimulatorScenario { - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().post().extractFromPayload("$.stack_name", "stackName"); - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); - - - } - - -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDelete.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDelete.java deleted file mode 100644 index 046829fa2f..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/ModuleCreateDelete.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.onap.so.simulator.actions.aai.DeleteVServers; -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Openstack-ModuleCreateDelete") -@RequestMapping(value = "/sim/v1/tenantOne/stacks/dummy_id/stackId") -public class ModuleCreateDelete extends AbstractSimulatorScenario { - - - @Override - public void run(ScenarioDesigner scenario) { - // Get to see if stack exists - scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, - "correlationId"); - scenario.echo("${correlationId}"); - scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, - "${correlationId}"); - - scenario.variable("stackName", "dummy_id"); - scenario.variable("cloudOwner", "cloudOwner"); - scenario.variable("cloudRegion", "regionOne"); - scenario.variable("tenantId", "0422ffb57ba042c0800a29dc85ca70f8"); - scenario.variable("vServerId", "92272b67-d23f-42ca-87fa-7b06a9ec81f3"); - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); - - // Initial Get from Openstack Adapter prior to deletion of the stack - scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); - - // Delete of the stack - scenario.http().receive().delete(); - scenario.action(new DeleteVServers()); - scenario.http().send().response(HttpStatus.NO_CONTENT); - - // Final Get from Openstack Adapter after the deletion of the stack - scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); - - } - -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameFailureId.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameFailureId.java deleted file mode 100644 index 3c95149afe..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameFailureId.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Query-Failure-ID-Name-Resources") -@RequestMapping(value = "/sim/v1/tenantOne/stacks/failure_id/resources", method = RequestMethod.GET) -public class QueryResourcesByStackNameFailureId extends AbstractSimulatorScenario { - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().get(); - - scenario.variable("stackName", "failure_id"); - - scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json") - .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json")); - - } -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java deleted file mode 100644 index 434eafc668..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Query-Replace-ID-Name-Resources") -@RequestMapping(value = "/sim/v1/tenantOne/stacks/replace_module/resources", method = RequestMethod.GET) -public class QueryResourcesByStackNameModuleReplace extends AbstractSimulatorScenario { - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().get(); - - scenario.variable("stackName", "replace_module"); - - scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json") - .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json")); - - } -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java deleted file mode 100644 index 6504cf6dc0..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Query-Replace-Volume-ID-Name-Resources") -@RequestMapping(value = "/sim/v1/tenantOne/stacks/replace_module_volume_id/resources", method = RequestMethod.GET) -public class QueryResourcesByStackNameModuleReplaceVolume extends AbstractSimulatorScenario { - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().get(); - - scenario.variable("stackName", "replace_module_volume_id"); - - scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json") - .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json")); - - } -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStack.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStack.java deleted file mode 100644 index ecd0c9fdba..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStack.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Openstack-QueryStackByName") -@RequestMapping(value = "/sim/v1/tenantOne/stacks/*", method = RequestMethod.GET) -public class QueryStack extends AbstractSimulatorScenario { - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().get(); - - scenario.http().send().response(HttpStatus.NOT_FOUND); - - } - -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro1.java deleted file mode 100644 index 249834a8d8..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro1.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Openstack-QueryStackByID-NetworkMacro1") -@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_network1/*", method = RequestMethod.GET) -public class QueryStackByIdNetworkMacro1 extends AbstractSimulatorScenario { - - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, - "correlationId"); - scenario.echo("${correlationId}"); - scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, - "${correlationId}"); - - scenario.variable("stackName", "dummy_id"); - - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); - - scenario.http().receive().get(); - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); - - } - -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro2.java deleted file mode 100644 index b3c6c7231f..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdNetworkMacro2.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Openstack-QueryStackByID-NetworkMacro2") -@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_network1/*", method = RequestMethod.GET) -public class QueryStackByIdNetworkMacro2 extends AbstractSimulatorScenario { - - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, - "correlationId"); - scenario.echo("${correlationId}"); - scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, - "${correlationId}"); - - scenario.variable("stackName", "dummy_id"); - - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); - - scenario.http().receive().get(); - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); - - } - -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdVolumeGroup.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdVolumeGroup.java deleted file mode 100644 index cbe842caf9..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdVolumeGroup.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Openstack-VolumeGroup-Interactions") -@RequestMapping(value = "/sim/v1/tenantOne/stacks/VolumeGroup/*") -public class QueryStackByIdVolumeGroup extends AbstractSimulatorScenario { - - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().get().extractFromHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, - "correlationId"); - scenario.echo("${correlationId}"); - scenario.correlation().start().onHeader(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, - "${correlationId}"); - - scenario.variable("stackName", "VolumeGroup"); - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); - - scenario.http().receive().delete(); - - scenario.http().send().response(HttpStatus.NO_CONTENT); - - scenario.http().receive().get(); - - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); - } - -} diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByName.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByName.java deleted file mode 100644 index b51a608e6d..0000000000 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByName.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.onap.so.simulator.scenarios.openstack; - -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; - -@Scenario("Openstack-QueryStackByName3") -@RequestMapping(value = "/sim/mockPublicUrlThree/stacks/*", method = RequestMethod.GET) -public class QueryStackByName extends AbstractSimulatorScenario { - - @Override - public void run(ScenarioDesigner scenario) { - scenario.http().receive().get(); - - scenario.http().send().response(HttpStatus.NOT_FOUND); - - } - - -} |