summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorGervais-Martial Ngueko <gervais-martial.ngueko@intl.att.com>2020-04-03 10:09:00 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-03 10:09:00 +0000
commit6aabb329d28fb5d5e4baf3fd0432b31249ee06d0 (patch)
treeb722107d7c8c18c34c9160797fdc20398eb08827 /src/test
parent0cde2b5f4b7d769dec74667d963138e858588ef3 (diff)
parente47a29578a2287a96ae13d1867925feab53a6526 (diff)
Merge "Fix the pdp payload"
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/loop/PolicyComponentTest.java6
-rw-r--r--src/test/resources/tosca/pdp-group-policy-payload.json10
2 files changed, 16 insertions, 0 deletions
diff --git a/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java b/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java
index 1c9b10189..432de6065 100644
--- a/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java
+++ b/src/test/java/org/onap/clamp/loop/PolicyComponentTest.java
@@ -263,6 +263,10 @@ public class PolicyComponentTest {
new Gson().fromJson("{\"configtype\":\"json\"}", JsonObject.class), null, "pdpGroup1", "pdpSubgroup1");
loopTest.addMicroServicePolicy(microServicePolicy);
+ MicroServicePolicy microServicePolicy2 = new MicroServicePolicy("configPolicyTest2", policyModel1, true,
+ new Gson().fromJson("{\"configtype\":\"json\"}", JsonObject.class), null, "pdpGroup2", "pdpSubgroup1");
+ loopTest.addMicroServicePolicy(microServicePolicy2);
+
PolicyModel policyModel2 = new PolicyModel("onap.policies.controlloop.Operational", null, "1.0.0");
OperationalPolicy opPolicy =
new OperationalPolicy("opPolicy", new Gson().fromJson("{\"configtype\":\"json\"}", JsonObject.class),
@@ -280,5 +284,7 @@ public class PolicyComponentTest {
String expectedRes = ResourceFileUtil.getResourceAsString("tosca/pdp-group-policy-payload.json");
assertThat(payload).isEqualTo(expectedRes);
+
+ assertThat(PolicyComponent.listPolicyNamesPdpGroup(loopTest)).containsExactlyInAnyOrder("opPolicy","configPolicyTest","configPolicyTest2");
}
}
diff --git a/src/test/resources/tosca/pdp-group-policy-payload.json b/src/test/resources/tosca/pdp-group-policy-payload.json
index 4ea746dea..c81440e73 100644
--- a/src/test/resources/tosca/pdp-group-policy-payload.json
+++ b/src/test/resources/tosca/pdp-group-policy-payload.json
@@ -27,6 +27,16 @@
"version": "1.0.0"
}
]
+ },
+ {
+ "pdpType": "pdpSubgroup1",
+ "action": "POST",
+ "policies": [
+ {
+ "name": "configPolicyTest2",
+ "version": "1.0.0"
+ }
+ ]
}
]
}