summaryrefslogtreecommitdiffstats
path: root/models-provider/src/test
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-09-05 21:10:46 +0000
committerliamfallon <liam.fallon@est.tech>2019-09-05 21:10:46 +0000
commitb0e460abe43d40528da4856f2f3d5ee162ac1830 (patch)
tree6cbacdbe977abab77e2b65d9e62d650d1433c21e /models-provider/src/test
parentff4c8525a70ef5b514d803b5093b91e45564f973 (diff)
Repair policy types in TOSCA service template
Changed policy types from a list of maps to a map. Changed data types from a list of maps to a map. Made all knock on changes to adapters and tests. Updated Issue ID. Added onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml policy type that is required to be preloaded in policy-api. Issue-ID: POLICY-2047 Change-Id: Ic8e809eab248fd7242f0e565fa2e3da75bcfbdeb Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-provider/src/test')
-rw-r--r--models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java
index 7b7690009..2ccf215c9 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java
@@ -22,6 +22,7 @@ package org.onap.policy.models.provider.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.google.gson.GsonBuilder;
@@ -62,16 +63,22 @@ public class PolicyTypePersistenceTest {
// @formatter:off
private String[] policyTypeResourceNames = {
- "policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml",
- "policytypes/onap.policies.optimization.AffinityPolicy.yaml",
+ "policytypes/onap.policies.controlloop.Operational.yaml",
"policytypes/onap.policies.optimization.DistancePolicy.yaml",
- "policytypes/onap.policies.optimization.HpaPolicy.yaml",
- "policytypes/onap.policies.optimization.OptimizationPolicy.yaml",
+ "policytypes/onap.policies.optimization.VnfPolicy.yaml",
"policytypes/onap.policies.optimization.PciPolicy.yaml",
- "policytypes/onap.policies.optimization.QueryPolicy.yaml",
- "policytypes/onap.policies.optimization.SubscriberPolicy.yaml",
+ "policytypes/onap.policies.optimization.OptimizationPolicy.yaml",
+ "policytypes/onap.policies.controlloop.guard.Blacklist.yaml",
+ "policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml",
+ "policytypes/onap.policies.optimization.HpaPolicy.yaml",
"policytypes/onap.policies.optimization.Vim_fit.yaml",
- "policytypes/onap.policies.optimization.VnfPolicy.yaml",
+ "policytypes/onap.policies.optimization.SubscriberPolicy.yaml",
+ "policytypes/onap.policies.optimization.AffinityPolicy.yaml",
+ "policytypes/onap.policies.optimization.QueryPolicy.yaml",
+ "policytypes/onap.policies.controlloop.guard.MinMax.yaml",
+ "policytypes/onap.policies.controlloop.guard.FrequencyLimiter.yaml",
+ "policytypes/onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml",
+ "policytypes/onap.policies.Optimization.yaml",
"policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml"
};
// @formatter:on
@@ -141,7 +148,7 @@ public class PolicyTypePersistenceTest {
ToscaServiceTemplate serviceTemplate = standardCoder.decode(policyTypeString, ToscaServiceTemplate.class);
assertNotNull(serviceTemplate);
- ToscaPolicyType inPolicyType = serviceTemplate.getPolicyTypes().get(0).values().iterator().next();
+ ToscaPolicyType inPolicyType = serviceTemplate.getPolicyTypes().values().iterator().next();
databaseProvider.createPolicyTypes(serviceTemplate);
databaseProvider.updatePolicyTypes(serviceTemplate);
@@ -162,7 +169,7 @@ public class PolicyTypePersistenceTest {
assertEquals(inPolicyType.getName(), policyTypeList.get(0).getName());
policyTypeList = databaseProvider.getFilteredPolicyTypeList(ToscaPolicyTypeFilter.builder().build());
- assertEquals(2, policyTypeList.size());
+ assertTrue(policyTypeList.size() <= 3);
assertEquals(inPolicyType.getName(), policyTypeList.get(0).getName());
for (ToscaPolicyType policyType: databaseProvider.getPolicyTypeList(null, null)) {