summaryrefslogtreecommitdiffstats
path: root/models-tosca/src/test/java/org
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-08-19 11:18:39 -0400
committerPamela Dragosh <pdragosh@research.att.com>2020-08-19 11:18:44 -0400
commit00892263e921f6ed14e895e5ab6bf642cc499072 (patch)
tree177c6c404a89ad569fc4d12f3a8964ced360d8e2 /models-tosca/src/test/java/org
parentca3827f43ada2b160f6966d205ca97d4402a0935 (diff)
Upgrade new tcagen2 policy type
The old cdap policy type is deprecated by DCAE. Thus, we are simply replacing with the new tcagen2 policy type. Issue-ID: POLICY-2772 Change-Id: I1442340729b5f820f2e265b9b86f6f6f84f49bca Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'models-tosca/src/test/java/org')
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyFilterTest.java2
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeFilterTest.java4
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java4
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java4
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java2
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java6
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java8
7 files changed, 15 insertions, 15 deletions
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyFilterTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyFilterTest.java
index dd19c6c15..01c5ff813 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyFilterTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyFilterTest.java
@@ -254,7 +254,7 @@ public class ToscaPolicyFilterTest {
filteredList = filter.filter(policyList);
assertEquals(3, filteredList.size());
- filter = ToscaPolicyFilter.builder().type("onap.policies.monitoring.cdap.tca.hi.lo.app").build();
+ filter = ToscaPolicyFilter.builder().type("onap.policies.monitoring.tcagen2").build();
filteredList = filter.filter(policyList);
assertEquals(3, filteredList.size());
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeFilterTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeFilterTest.java
index 82f100e89..cba6078b1 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeFilterTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeFilterTest.java
@@ -72,7 +72,7 @@ public class ToscaPolicyTypeFilterTest {
"policytypes/onap.policies.controlloop.guard.common.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"
+ "policytypes/onap.policies.monitoring.tcagen2.yaml"
};
// @formatter:on
@@ -171,7 +171,7 @@ public class ToscaPolicyTypeFilterTest {
List<ToscaPolicyType> filteredList = filter.filter(typeList);
assertEquals(1, filteredList.size());
- filter = ToscaPolicyTypeFilter.builder().name("onap.policies.monitoring.cdap.tca.hi.lo.app").build();
+ filter = ToscaPolicyTypeFilter.builder().name("onap.policies.monitoring.tcagen2").build();
filteredList = filter.filter(typeList);
assertEquals(1, filteredList.size());
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
index efb5bf037..969e24003 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
@@ -411,7 +411,7 @@ public class AuthorativeToscaProviderPolicyTest {
@Test
public void testEntityMaps() throws CoderException, PfModelException {
Object yamlObject = new Yaml().load(
- ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml"));
+ ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml"));
String yamlAsJsonString = new StandardCoder().encode(yamlObject);
ToscaServiceTemplate toscaServiceTemplatePolicyType =
@@ -453,7 +453,7 @@ public class AuthorativeToscaProviderPolicyTest {
private void createPolicyTypes() throws CoderException, PfModelException {
Object yamlObject = new Yaml().load(
- ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml"));
+ ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml"));
String yamlAsJsonString = new StandardCoder().encode(yamlObject);
ToscaServiceTemplate toscaServiceTemplatePolicyType =
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java
index a1a080df0..cd35f710a 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java
@@ -56,7 +56,7 @@ public class ToscaServiceTemplateMappingTest {
@Test
public void testPlainToscaPolicies() throws Exception {
String policyTypeInputJson =
- ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml");
+ ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
ToscaServiceTemplate plainPolicyTypes =
yamlJsonTranslator.fromYaml(policyTypeInputJson, ToscaServiceTemplate.class);
@@ -85,7 +85,7 @@ public class ToscaServiceTemplateMappingTest {
public void testPlainToscaPolicyTypes() throws Exception {
Yaml yaml = new Yaml();
String inputYaml =
- ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml");
+ ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
Object yamlObject = yaml.load(inputYaml);
String yamlAsJsonString = standardCoder.encode(yamlObject);
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
index 92c0f8286..c597cd4f6 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
@@ -842,7 +842,7 @@ public class SimpleToscaProviderTest {
private void createPolicyTypes() throws CoderException, PfModelException {
Object yamlObject = new Yaml()
- .load(ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml"));
+ .load(ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml"));
String yamlAsJsonString = new StandardCoder().encode(yamlObject);
ToscaServiceTemplate toscaServiceTemplatePolicyType =
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java
index fb01d5e8c..a4b3de36c 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java
@@ -61,7 +61,7 @@ public class MonitoringPolicySerializationTest {
private static final String TOPOLOGY_TEMPLATE = "topology_template";
- private static final String TCA_POLICY = "tca_policy";
+ private static final String TCA_POLICY = "tca.policy";
private static final String PROPERTIES2 = "properties";
@@ -75,7 +75,7 @@ public class MonitoringPolicySerializationTest {
private static final String POLICY1 = "onap.restart.tca";
- private static final String TYPE1 = "onap.policies.monitoring.cdap.tca.hi.lo.app";
+ private static final String TYPE1 = "onap.policies.monitoring.tcagen2";
private static final String METADATA = "metadata";
@@ -96,7 +96,7 @@ public class MonitoringPolicySerializationTest {
@Test
public void testDeserialization() throws Exception {
String policyTypeInputJson =
- ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml");
+ ResourceUtils.getResourceAsString("policytypes/onap.policies.monitoring.tcagen2.yaml");
ToscaServiceTemplate plainPolicyTypes =
yamlJsonTranslator.fromYaml(policyTypeInputJson, ToscaServiceTemplate.class);
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java
index 8061d1a0e..14d3a1980 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java
@@ -73,7 +73,7 @@ public class MonitoringPolicyTypeSerializationTest {
private static final Logger LOGGER = LoggerFactory.getLogger(MonitoringPolicyTypeSerializationTest.class);
- private static final String MONITORING_TCA_YAML = "policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml";
+ private static final String MONITORING_TCA_YAML = "policytypes/onap.policies.monitoring.tcagen2.yaml";
private static final String MONITORING_COLLECTORS_YAML =
"policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml";
@@ -159,15 +159,15 @@ public class MonitoringPolicyTypeSerializationTest {
firstPolicyType.getValue().getDescription());
Entry<PfConceptKey, JpaToscaPolicyType> secondPolicyType = policyTypesIter.next();
- assertEquals("onap.policies.monitoring.cdap.tca.hi.lo.app", secondPolicyType.getKey().getName());
+ assertEquals("onap.policies.monitoring.tcagen2", secondPolicyType.getKey().getName());
assertEquals(VERSION_100, secondPolicyType.getKey().getVersion());
assertEquals(MONITORING, secondPolicyType.getValue().getDerivedFrom().getName());
assertTrue(secondPolicyType.getValue().getProperties().size() == 1);
JpaToscaProperty property = secondPolicyType.getValue().getProperties().values().iterator().next();
- assertEquals("onap.policies.monitoring.cdap.tca.hi.lo.app", property.getKey().getParentKeyName());
+ assertEquals("onap.policies.monitoring.tcagen2", property.getKey().getParentKeyName());
assertEquals(VERSION_100, property.getKey().getParentKeyVersion());
- assertEquals("tca_policy", property.getKey().getLocalName());
+ assertEquals("tca.policy", property.getKey().getLocalName());
assertEquals(TCA, property.getType().getName());
assertEquals("TCA Policy JSON", property.getDescription());