aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2020-03-23 15:59:49 -0500
committerjhh <jorge.hernandez-herrero@att.com>2020-03-23 16:19:50 -0500
commitb58962e1d627087579ca5e2842980c0a380f496c (patch)
tree31a4056cb84a95b892621dd7a1eae0793c870122
parentef5768de060c6cbf10b06569e00617b052dc7e61 (diff)
Add version to compliant operational policies
Issue-ID: POLICY-2356 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I5636ec4e92ff87fdefb9a6372a150ad021aeec16 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.json3
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json3
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyFilterTest.java14
3 files changed, 11 insertions, 9 deletions
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.json b/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.json
index bb90bbd43..4a9b2a96b 100644
--- a/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.json
+++ b/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.json
@@ -6,6 +6,7 @@
"operational.scaleout": {
"type": "onap.policies.controlloop.operational.common.Drools",
"type_version": "1.0.0",
+ "version": "1.0.0",
"metadata": {
"policy-id": "operational.scaleout"
},
@@ -52,4 +53,4 @@
}
]
}
-} \ No newline at end of file
+}
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json b/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json
index 2d7f1c958..063921afd 100644
--- a/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json
@@ -6,6 +6,7 @@
"operational.modifyconfig": {
"type": "onap.policies.controlloop.operational.common.Drools",
"type_version": "1.0.0",
+ "version": "1.0.0",
"metadata": {
"policy-id": "operational.modifyconfig"
},
@@ -44,4 +45,4 @@
}
]
}
-} \ No newline at end of file
+}
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 9ee3ec8bb..a02147cdd 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
@@ -151,7 +151,7 @@ public class ToscaPolicyFilterTest {
assertEquals(VERSION_100, filteredList.get(7).getVersion());
assertEquals(VERSION_100, filteredList.get(12).getVersion());
- assertEquals(22, policyList.size());
+ assertEquals(23, policyList.size());
assertEquals(22, filteredList.size());
//
@@ -218,7 +218,7 @@ public class ToscaPolicyFilterTest {
public void testFilterNameVersion() {
ToscaPolicyFilter filter = ToscaPolicyFilter.builder().name("operational.modifyconfig").build();
List<ToscaPolicy> filteredList = filter.filter(policyList);
- assertEquals(1, filteredList.size());
+ assertEquals(2, filteredList.size());
filter = ToscaPolicyFilter.builder().name("guard.frequency.scaleout").build();
filteredList = filter.filter(policyList);
@@ -230,7 +230,7 @@ public class ToscaPolicyFilterTest {
filter = ToscaPolicyFilter.builder().version(VERSION_100).build();
filteredList = filter.filter(policyList);
- assertEquals(21, filteredList.size());
+ assertEquals(22, filteredList.size());
filter = ToscaPolicyFilter.builder().name("OSDF_CASABLANCA.SubscriberPolicy_v1").version(VERSION_100).build();
filteredList = filter.filter(policyList);
@@ -238,7 +238,7 @@ public class ToscaPolicyFilterTest {
filter = ToscaPolicyFilter.builder().name("operational.modifyconfig").version(VERSION_100).build();
filteredList = filter.filter(policyList);
- assertEquals(1, filteredList.size());
+ assertEquals(2, filteredList.size());
}
@Test
@@ -246,11 +246,11 @@ public class ToscaPolicyFilterTest {
// null pattern
ToscaPolicyFilter filter = ToscaPolicyFilter.builder().versionPrefix(null).build();
List<ToscaPolicy> filteredList = filter.filter(policyList);
- assertEquals(22, filteredList.size());
+ assertEquals(23, filteredList.size());
filter = ToscaPolicyFilter.builder().versionPrefix("1.").build();
filteredList = filter.filter(policyList);
- assertEquals(20, filteredList.size());
+ assertEquals(21, filteredList.size());
filter = ToscaPolicyFilter.builder().versionPrefix("100.").build();
filteredList = filter.filter(policyList);
@@ -269,7 +269,7 @@ public class ToscaPolicyFilterTest {
filter = ToscaPolicyFilter.builder().type("onap.policies.controlloop.operational.common.Drools").build();
filteredList = filter.filter(policyList);
- assertEquals(3, filteredList.size());
+ assertEquals(4, filteredList.size());
filter = ToscaPolicyFilter.builder().type("onap.policies.monitoring.cdap.tca.hi.lo.app").build();
filteredList = filter.filter(policyList);