diff options
author | Determe, Sebastien (sd378r) <sebastien.determe@intl.att.com> | 2019-05-28 11:54:27 +0200 |
---|---|---|
committer | Determe, Sebastien (sd378r) <sebastien.determe@intl.att.com> | 2019-05-28 11:54:27 +0200 |
commit | 785b17789adc4817e129fcd389d91046b195044a (patch) | |
tree | 5a7acac8b2f868215880b3b7fc77e6781293f30f /src/test/java | |
parent | ef9aed4b3a69128fa10feaa9ab787a57ef6772d7 (diff) |
Fix the op policy payload
Fix the operational policy payload as it was not the one expected by
policy engine + rollback staging plugin
Issue-ID: CLAMP-395
Change-Id: I7b690eb02f50617b7aa402266c13aafa82f5b59b
Signed-off-by: Determe, Sebastien (sd378r) <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java | 13 |
1 files changed, 11 insertions, 2 deletions
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 caed3ba9..8972e511 100644 --- a/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java +++ b/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java @@ -33,6 +33,7 @@ import java.util.Map; import org.junit.Test; import org.onap.clamp.clds.util.ResourceFileUtil; +import org.onap.clamp.policy.operational.LegacyOperationalPolicy; import org.onap.clamp.policy.operational.OperationalPolicy; import org.skyscreamer.jsonassert.JSONAssert; @@ -43,15 +44,23 @@ public class OperationalPolicyPayloadTest { JsonObject jsonConfig = new GsonBuilder().create().fromJson( ResourceFileUtil.getResourceAsString("tosca/operational-policy-properties.json"), JsonObject.class); OperationalPolicy policy = new OperationalPolicy("testPolicy", null, jsonConfig); + assertThat(policy.createPolicyPayloadYaml()) .isEqualTo(ResourceFileUtil.getResourceAsString("tosca/operational-policy-payload.yaml")); - assertThat(policy.createPolicyPayloadYamlLegacy()) - .isEqualTo(ResourceFileUtil.getResourceAsString("tosca/operational-policy-payload-legacy.yaml")); + assertThat(policy.createPolicyPayload()) .isEqualTo(ResourceFileUtil.getResourceAsString("tosca/operational-policy-payload.json")); } @Test + public void testLegacyOperationalPolicyPayloadConstruction() throws IOException { + JsonObject jsonConfig = new GsonBuilder().create().fromJson( + ResourceFileUtil.getResourceAsString("tosca/operational-policy-properties.json"), JsonObject.class); + 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"), |