aboutsummaryrefslogtreecommitdiffstats
path: root/so-simulator/src/main/java
diff options
context:
space:
mode:
authorBoslet, Cory <cory.boslet@att.com>2020-10-20 11:38:11 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-10-21 16:20:20 -0400
commit1b0033ac8a578730ba95e48f7a7ab73e49380b51 (patch)
tree29b7e93e525645a29e1b7cd87391c6dbc4d17c44 /so-simulator/src/main/java
parent7396509f9c11cc4e9651210cf8a290679bb17fd5 (diff)
Removed audit code
Updated to error on inventory therefore no longer need audit Removed the audit UT test from source Removed the audit from the task services. Updated the BB unit test to not have audit anymore Changed robots to fix for create inventory. Delete the vnfc by id after each robot Create pserver in aai that ci is using Continue to fix robot test for heat bridge Continue to fix robots due to heatbridge enabled More changes to simulator to account for heatbridge for replace scenrios Added get resources scenrio for heatbridge Added header and added version to simulator Added correct response file and header for base module id Fixed the remaining failing service instance robots Changed to get tenant id else where when null Fixed the macro robots for heatbridge and getting resources Added scenrios that are still needed for heatbridge Added to connect when already exist and missing relationships Updated unit test to account for change to code. Issue-ID: SO-3316 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I8cefebd91261fcb8ff03d582afb48517dd34625a
Diffstat (limited to 'so-simulator/src/main/java')
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java15
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java6
7 files changed, 70 insertions, 20 deletions
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
index edf212429c..d8d62d99bc 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
@@ -29,8 +29,7 @@ public class ProcessVnfc extends AbstractTestAction {
AAIResourcesClient aaiResourceClient = new AAIResourcesClient();
if (context.getVariable("requestAction").equals("CreateVfModuleInstance")
- && context.getVariable("serviceAction").equals("assign")
- && context.getVariable("vfModuleName").equals("nc_dummy_id")) {
+ && context.getVariable("serviceAction").equals("assign")) {
AAIResourceUri vnfcURI =
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc("ssc_server_1"));
@@ -47,14 +46,14 @@ public class ProcessVnfc extends AbstractTestAction {
vnfc.setModelVersionId("9e314c37-2258-4572-a399-c0dd7d5f1aec");
vnfc.setModelCustomizationId("2bd95cd4-d7ff-4af0-985d-2adea0339921");
- if (!aaiResourceClient.exists(vnfcURI)) {
- logger.debug("creating VNFC");
- aaiResourceClient.create(vnfcURI, vnfc);
+ if (aaiResourceClient.exists(vnfcURI)) {
+ logger.debug("cleaning up VNFC");
+ aaiResourceClient.delete(vnfcURI);
+ }
+ logger.debug("creating new VNFC");
+ aaiResourceClient.create(vnfcURI, vnfc);
- } else {
- aaiResourceClient.get(vnfcURI);
- }
AAIResourceUri vfModuleURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network()
.genericVnf(context.getVariable("vnfId")).vfModule(context.getVariable("vfModuleId")));
logger.debug("creating VNFC edge to vf module");
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
new file mode 100644
index 0000000000..f4ac519f7a
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.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-ID-Name-Resources")
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/replace_module/stackId/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/zrdm52emccr01_base_resources.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
new file mode 100644
index 0000000000..f6eebeb09e
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java
@@ -0,0 +1,26 @@
+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/stackId/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/zrdm52emccr01_base_resources.json"));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
index e13a23f397..eb306ccd6f 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro1")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_1/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_1/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro1 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro1 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
index 580714ded2..d2551a2fb3 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro2")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_2/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_2/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro2 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro2 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
index 096d2aa312..bb33f2c718 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro3")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_3/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_3/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro3 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro3 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
index b590966e2f..77cc0054cc 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Base-Stack-Resources")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/base_module_id/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/base_module_id/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByBaseStackName extends AbstractSimulatorScenario {
@@ -19,8 +19,8 @@ public class QueryResourcesByBaseStackName extends AbstractSimulatorScenario {
scenario.variable("stackName", "dummy_id");
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResources.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}