diff options
author | Kuleshov, Elena <evn@att.com> | 2019-12-18 09:24:33 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2019-12-18 09:24:34 -0500 |
commit | c0fbd45596e038ecceb77422c4cae840ad114efa (patch) | |
tree | c9b76ff27774b5a87e6539c3995fd5778907f965 /so-simulator/src/main/java | |
parent | 145eb372a14a2dd25f75033acd37e269c33caf95 (diff) |
Support for volume groups on replace VF Module.
Support for volume groups on replace VF Module.
[MSO-8375 R2002} Add full JUnit coverage for replaceVFModule scenarios,
add replace changes to general macro data.
Fix a JUnit to pass correct parameters to a method.
Add back setting volume group id for new volume group on replace action.
Issue-ID: SO-2577
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I73289da21e0c7de7451b63e99e184692e800aaf0
Diffstat (limited to 'so-simulator/src/main/java')
2 files changed, 76 insertions, 0 deletions
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 new file mode 100644 index 0000000000..5e4bb98926 --- /dev/null +++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java @@ -0,0 +1,25 @@ +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/mockPublicUrl/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/QueryStackByIdReplaceModuleVolume.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModuleVolume.java new file mode 100644 index 0000000000..170c3105b3 --- /dev/null +++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdReplaceModuleVolume.java @@ -0,0 +1,51 @@ +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.onap.so.simulator.actions.aai.DeleteVServers; +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-Replace-VF-Module-Volume-Get") +@RequestMapping(value = "/sim/mockPublicUrl/stacks/replace_module_volume_id/*") +public class QueryStackByIdReplaceModuleVolume 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", "replace_module_volume_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")); + } + +} |