aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java2
-rw-r--r--src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java26
2 files changed, 1 insertions, 27 deletions
diff --git a/src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java b/src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java
index 4d51bb27c..26db6b013 100644
--- a/src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java
+++ b/src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java
@@ -94,7 +94,7 @@ public class LoopControllerTestItCase {
public void testUpdateOperationalPolicies() {
saveTestLoopToDb();
String policy = "[{\"name\":\"OPERATIONAL_CLholmes31_v1_0_vFW_PG_T10_k8s-holmes-rules\","
- + "\"configurationsJson\":{\"guard_policies\":{},"
+ + "\"configurationsJson\":{"
+ "\"operational_policy\":{\"controlLoop\":{\"trigger_policy\":\"unique-policy-id-1-modifyConfig\","
+ "\"timeout\":\"3600\",\"abatement\":\"false\","
+ "\"controlLoopName\":\"LOOP_CLholmes31_v1_0_vFW_PG_T10_k8s-holmes-rules\"},"
diff --git a/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java b/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java
index 58a432d34..cef82e501 100644
--- a/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java
+++ b/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java
@@ -59,30 +59,4 @@ public class OperationalPolicyPayloadTest {
assertThat(LegacyOperationalPolicy.createPolicyPayloadYamlLegacy(jsonConfig.get("operational_policy")))
.isEqualTo(ResourceFileUtil.getResourceAsString("tosca/operational-policy-payload-legacy.yaml"));
}
-
- @Test
- public void testGuardPolicyEmptyPayloadConstruction() throws IOException {
- JsonObject jsonConfig = new GsonBuilder().create().fromJson(
- ResourceFileUtil.getResourceAsString("tosca/operational-policy-no-guard-properties.json"),
- JsonObject.class);
- OperationalPolicy policy = new OperationalPolicy("testPolicy", jsonConfig, null, null, null, null, null);
- Map<String, String> guardsMap = policy.createGuardPolicyPayloads();
- assertThat(guardsMap).isEmpty();
- assertThat(guardsMap.entrySet()).isEmpty();
- }
-
- @Test
- public void testGuardPolicyPayloadConstruction() throws IOException {
- JsonObject jsonConfig = new GsonBuilder().create().fromJson(
- ResourceFileUtil.getResourceAsString("tosca/operational-policy-properties.json"), JsonObject.class);
- OperationalPolicy policy = new OperationalPolicy("testPolicy", jsonConfig, null, null, null, null, null);
-
- Map<String, String> guardsMap = policy.createGuardPolicyPayloads();
-
- JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/guard1-policy-payload.json"),
- guardsMap.get("guard.minmax.new"), false);
-
- JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/guard2-policy-payload.json"),
- guardsMap.get("guard.frequency.new"), false);
- }
}