summaryrefslogtreecommitdiffstats
path: root/models-provider/src/test
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2019-12-06 15:07:03 +0000
committerGerrit Code Review <gerrit@onap.org>2019-12-06 15:07:03 +0000
commit3c98ef789246de51d6f1495b7232167d351ca44f (patch)
treee8ac2a06bcad934d8e9b301bc5f064e4d09f4ee3 /models-provider/src/test
parentdfc7c87b5f94087d209a2b9f7e2dc6d9a9dce1a8 (diff)
parent19093bbdec52fbe97fa404670aba4af12dc750e0 (diff)
Merge "Add new Operational Policy Type"
Diffstat (limited to 'models-provider/src/test')
-rw-r--r--models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyPersistenceTest.java9
-rw-r--r--models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java8
2 files changed, 17 insertions, 0 deletions
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyPersistenceTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyPersistenceTest.java
index 1f577ae21..8e0dcb31c 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyPersistenceTest.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyPersistenceTest.java
@@ -209,6 +209,15 @@ public class PolicyPersistenceTest {
databaseProvider.createPolicyTypes(toscaServiceTemplatePolicyType);
yamlObject = new Yaml().load(
+ ResourceUtils.getResourceAsString("policytypes/onap.policies.controlloop.operational.Common.yaml"));
+ yamlAsJsonString = new StandardCoder().encode(yamlObject);
+
+ toscaServiceTemplatePolicyType = standardCoder.decode(yamlAsJsonString, ToscaServiceTemplate.class);
+
+ assertNotNull(toscaServiceTemplatePolicyType);
+ databaseProvider.createPolicyTypes(toscaServiceTemplatePolicyType);
+
+ yamlObject = new Yaml().load(
ResourceUtils.getResourceAsString("policytypes/onap.policies.controlloop.guard.FrequencyLimiter.yaml"));
yamlAsJsonString = new StandardCoder().encode(yamlObject);
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java
index 9012d84b1..1aedcaf83 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java
@@ -177,6 +177,14 @@ public class PolicyToscaPersistenceTest {
databaseProvider.createPolicyTypes(toscaServiceTemplatePolicyType);
yamlObject = new Yaml().load(
+ ResourceUtils.getResourceAsString("policytypes/onap.policies.controlloop.operational.Common.yaml"));
+ yamlAsJsonString = new StandardCoder().encode(yamlObject);
+
+ toscaServiceTemplatePolicyType = standardCoder.decode(yamlAsJsonString, ToscaServiceTemplate.class);
+
+ assertNotNull(toscaServiceTemplatePolicyType);
+ databaseProvider.createPolicyTypes(toscaServiceTemplatePolicyType);
+ yamlObject = new Yaml().load(
ResourceUtils.getResourceAsString("policytypes/onap.policies.controlloop.guard.FrequencyLimiter.yaml"));
yamlAsJsonString = new StandardCoder().encode(yamlObject);