diff options
author | xuegao <xg353y@intl.att.com> | 2020-04-21 18:05:44 +0200 |
---|---|---|
committer | xuegao <xg353y@intl.att.com> | 2020-04-22 10:12:34 +0200 |
commit | c4f54bf8f8520cb270ad3d7f8c91e12a951f138a (patch) | |
tree | bb16683a68e5b1cdcd2bcfb59cc7518ef8cfbbf8 /src/test/java/org | |
parent | 334ad564f969cb9d3ba1e47f5722ea43c71ee63f (diff) |
Guard policy clean up
Remove guard policy related code, so that it will not be shown or
created in the legacy policy UI.
Issue-ID: CLAMP-825
Change-Id: I6c654fef9fd9df810fd48600c91ffef96db371cd
Signed-off-by: xuegao <xg353y@intl.att.com>
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/onap/clamp/loop/LoopControllerTestItCase.java | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java | 26 |
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); - } } |