diff options
Diffstat (limited to 'main/src/test/java')
-rw-r--r-- | main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java | 16 | ||||
-rw-r--r-- | main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java index 653f467e..0ae718d1 100644 --- a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java +++ b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java @@ -171,6 +171,22 @@ public class TestPolicyProvider { }).hasMessage("policy with ID dummy:dummy and type dummy:dummy does not exist"); assertThatCode(() -> { + String policyTypeString = ResourceUtils.getResourceAsString(POLICY_TYPE_RESOURCE); + ToscaServiceTemplate policyTypeServiceTemplate = + standardCoder.decode(policyTypeString, ToscaServiceTemplate.class); + policyTypeProvider.createPolicyType(policyTypeServiceTemplate); + }).doesNotThrowAnyException(); + + assertThatCode(() -> { + String policyString = ResourceUtils.getResourceAsString(POLICY_RESOURCE); + ToscaServiceTemplate policyServiceTemplate = + standardCoder.decode(policyString, ToscaServiceTemplate.class); + ToscaServiceTemplate serviceTemplate = policyProvider + .createPolicy("onap.policies.monitoring.cdap.tca.hi.lo.app", "1.0.0", policyServiceTemplate); + assertFalse(serviceTemplate.getToscaTopologyTemplate().getPolicies().get(0).isEmpty()); + }).doesNotThrowAnyException(); + + assertThatCode(() -> { ToscaServiceTemplate serviceTemplate = policyProvider.deletePolicy( "onap.policies.monitoring.cdap.tca.hi.lo.app", "1.0.0", "onap.restart.tca", "1.0.0"); assertFalse(serviceTemplate.getToscaTopologyTemplate().getPolicies().get(0).isEmpty()); diff --git a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java index 9dc77267..03d49332 100644 --- a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java +++ b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java @@ -129,6 +129,14 @@ public class TestPolicyTypeProvider { public void testDeletePolicyType() { assertThatCode(() -> { + String policyTypeString = ResourceUtils.getResourceAsString(POLICY_TYPE_RESOURCE); + ToscaServiceTemplate policyTypeServiceTemplate = + standardCoder.decode(policyTypeString, ToscaServiceTemplate.class); + ToscaServiceTemplate serviceTemplate = policyTypeProvider.createPolicyType(policyTypeServiceTemplate); + assertFalse(serviceTemplate.getPolicyTypes().get(0).isEmpty()); + }).doesNotThrowAnyException(); + + assertThatCode(() -> { String policyString = ResourceUtils.getResourceAsString(POLICY_RESOURCE); ToscaServiceTemplate policyServiceTemplate = standardCoder.decode(policyString, ToscaServiceTemplate.class); |