aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators
diff options
context:
space:
mode:
authorPiyush Garg <piyush.garg1@amdocs.com>2018-08-29 15:40:53 +0530
committerPiyush Garg <piyush.garg1@amdocs.com>2018-08-31 20:48:21 +0000
commit0b6288e180c1d33bba88b3df5e03442c57058db9 (patch)
tree072c9c553f9ac7a4874ce97101be5c6e211d547e /controlloop/common/simulators
parent8279af376b435e1d7dd118a1955c5681edf3b847 (diff)
Added support for VF Module Delete recipe
Enhanced SOActorServiceProvider to support VF Module Delete Recipe. Added SOOperationType enum to map the policy recipe with the SO API that we want to call for a recipe. vf module id from non-base vf module is used to construct the delete request url and same will be deleted. Updated SOManager so that it sends request to SO based on the SOOperationType enum value. Enhanced RESTManager to add support for the http delete using new class HttpDeleteWithBody (to allow pass the payload to the SO delete VF module API). Change-Id: I15b678ed9ebc85dfa7cb62bbf23e41c0fe6e4c69 Issue-ID: POLICY-1079 Signed-off-by: Piyush Garg <piyush.garg1@amdocs.com>
Diffstat (limited to 'controlloop/common/simulators')
-rw-r--r--controlloop/common/simulators/src/test/java/org/onap/policy/simulators/GuardSimulatorTest.java12
-rw-r--r--controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java2
-rw-r--r--controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java6
3 files changed, 10 insertions, 10 deletions
diff --git a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/GuardSimulatorTest.java b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/GuardSimulatorTest.java
index cebf5f7fe..3768b1b32 100644
--- a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/GuardSimulatorTest.java
+++ b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/GuardSimulatorTest.java
@@ -60,16 +60,16 @@ public class GuardSimulatorTest {
Pair<Integer, String> response =
new RESTManager().post(url, "testUname", "testPass", null, "application/json", request);
assertNotNull(response);
- assertNotNull(response.a);
- assertNotNull(response.b);
- assertEquals("{\"decision\": \"PERMIT\", \"details\": \"Decision Permit. OK!\"}", response.b);
+ assertNotNull(response.first);
+ assertNotNull(response.second);
+ assertEquals("{\"decision\": \"PERMIT\", \"details\": \"Decision Permit. OK!\"}", response.second);
request = makeRequest("test_actor_id", "test_op_id", "test_target", "denyGuard");
response = new RESTManager().post(url, "testUname", "testPass", null, "application/json", request);
assertNotNull(response);
- assertNotNull(response.a);
- assertNotNull(response.b);
- assertEquals("{\"decision\": \"DENY\", \"details\": \"Decision Deny. You asked for it\"}", response.b);
+ assertNotNull(response.first);
+ assertNotNull(response.second);
+ assertEquals("{\"decision\": \"DENY\", \"details\": \"Decision Deny. You asked for it\"}", response.second);
}
private static String makeRequest(String actor, String recipe, String target, String clName) {
diff --git a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java
index 4fce837b9..772dd7f2c 100644
--- a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java
+++ b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java
@@ -142,7 +142,7 @@ public class SoSimulatorTest {
"http://localhost:6667/serviceInstantiation/v7/12345/vnfs/12345/vfModules/scaleOut", "username",
"password", new HashMap<>(), "application/json", request);
assertNotNull(httpDetails);
- final SOResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, SOResponse.class);
+ final SOResponse response = Serialization.gsonPretty.fromJson(httpDetails.second, SOResponse.class);
assertNotNull(response);
}
}
diff --git a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java
index 8a7afb959..0e083bb6c 100644
--- a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java
+++ b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java
@@ -63,8 +63,8 @@ public class VfcSimulatorTest {
new RESTManager().post("http://localhost:6668/api/nslcm/v1/ns/1234567890/heal", "username", "password",
new HashMap<String, String>(), "application/json", "Some Request Here");
assertNotNull(httpDetails);
- assertTrue(httpDetails.a == 202);
- final VFCResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, VFCResponse.class);
+ assertTrue(httpDetails.first == 202);
+ final VFCResponse response = Serialization.gsonPretty.fromJson(httpDetails.second, VFCResponse.class);
assertNotNull(response);
}
@@ -73,7 +73,7 @@ public class VfcSimulatorTest {
final Pair<Integer, String> httpDetails = new RESTManager().get("http://localhost:6668/api/nslcm/v1/jobs/1234",
"username", "password", new HashMap<String, String>());
assertNotNull(httpDetails);
- final VFCResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, VFCResponse.class);
+ final VFCResponse response = Serialization.gsonPretty.fromJson(httpDetails.second, VFCResponse.class);
assertNotNull(response);
}
}