diff options
author | Jim Hahn <jrh3@att.com> | 2020-04-16 10:21:15 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-04-16 11:08:55 -0400 |
commit | d3f7c6e9cf6bad3fc295fd35283e1d79e6166f3d (patch) | |
tree | 940d3517bb8b917b9c9da987a4a16acac295f9f9 /models-tosca/src/test/java | |
parent | 85841e358763f6d71a3b2ac27d3fd39dc60667c0 (diff) |
Add version to example yaml files
Determined that some of the yaml files were not suitable for use
in the CSITs, because they were missing the "version" property.
Added it where needed. Also added type_version where it was missing,
as well.
Issue-ID: POLICY-2491
Change-Id: I47bf0ec2b99d29580390a6e90512dfd903b042d6
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-tosca/src/test/java')
-rw-r--r-- | models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyFilterTest.java | 29 |
1 files changed, 7 insertions, 22 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 a02147cdd..933221c98 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 @@ -60,17 +60,13 @@ public class ToscaPolicyFilterTest { // @formatter:off private static final String[] policyResourceNames = { "policies/vCPE.policies.optimization.input.tosca.yaml", - "policies/vCPE.policy.monitoring.input.tosca.json", "policies/vCPE.policy.monitoring.input.tosca.yaml", "policies/vCPE.policy.operational.input.tosca.yaml", - "policies/vDNS.policy.monitoring.input.tosca.json", "policies/vDNS.policy.monitoring.input.tosca.yaml", "policies/vDNS.policy.operational.input.tosca.yaml", "policies/vDNS.policy.guard.frequencylimiter.input.tosca.yaml", "policies/vDNS.policy.guard.minmaxvnfs.input.tosca.yaml", - "policies/vFirewall.policy.monitoring.input.tosca.json", "policies/vFirewall.policy.monitoring.input.tosca.yaml", - "policies/vFirewall.policy.operational.input.tosca.json", "policies/vFirewall.policy.operational.input.tosca.yaml" }; // @formatter:on @@ -151,7 +147,7 @@ public class ToscaPolicyFilterTest { assertEquals(VERSION_100, filteredList.get(7).getVersion()); assertEquals(VERSION_100, filteredList.get(12).getVersion()); - assertEquals(23, policyList.size()); + assertEquals(22, policyList.size()); assertEquals(22, filteredList.size()); // @@ -177,8 +173,6 @@ public class ToscaPolicyFilterTest { assertThat(policy.getVersion()).isEqualTo("2.0.0"); } else if ("operational.modifyconfig".equals(policy.getName())) { assertThat(policy.getVersion()).isEqualTo("3.4.5"); - } else if ("operational.scaleout".equals(policy.getName())) { - assertThat(policy.getVersion()).isEqualTo(VERSION_000); } else { assertThat(policy.getVersion()).isEqualTo(VERSION_100); } @@ -202,23 +196,14 @@ public class ToscaPolicyFilterTest { // // Assert that the correct versions are returned // - policyList.forEach(policy -> { - // - // Should we fix this to be 1.0.0?? - // - if ("operational.scaleout".equals(policy.getName())) { - assertThat(policy.getVersion()).isEqualTo(VERSION_000); - } else { - assertThat(policy.getVersion()).isEqualTo(VERSION_100); - } - }); + policyList.forEach(policy -> assertThat(policy.getVersion()).isEqualTo(VERSION_100)); } @Test public void testFilterNameVersion() { ToscaPolicyFilter filter = ToscaPolicyFilter.builder().name("operational.modifyconfig").build(); List<ToscaPolicy> filteredList = filter.filter(policyList); - assertEquals(2, filteredList.size()); + assertEquals(1, filteredList.size()); filter = ToscaPolicyFilter.builder().name("guard.frequency.scaleout").build(); filteredList = filter.filter(policyList); @@ -238,7 +223,7 @@ public class ToscaPolicyFilterTest { filter = ToscaPolicyFilter.builder().name("operational.modifyconfig").version(VERSION_100).build(); filteredList = filter.filter(policyList); - assertEquals(2, filteredList.size()); + assertEquals(1, filteredList.size()); } @Test @@ -246,11 +231,11 @@ public class ToscaPolicyFilterTest { // null pattern ToscaPolicyFilter filter = ToscaPolicyFilter.builder().versionPrefix(null).build(); List<ToscaPolicy> filteredList = filter.filter(policyList); - assertEquals(23, filteredList.size()); + assertEquals(22, filteredList.size()); filter = ToscaPolicyFilter.builder().versionPrefix("1.").build(); filteredList = filter.filter(policyList); - assertEquals(21, filteredList.size()); + assertEquals(22, filteredList.size()); filter = ToscaPolicyFilter.builder().versionPrefix("100.").build(); filteredList = filter.filter(policyList); @@ -269,7 +254,7 @@ public class ToscaPolicyFilterTest { filter = ToscaPolicyFilter.builder().type("onap.policies.controlloop.operational.common.Drools").build(); filteredList = filter.filter(policyList); - assertEquals(4, filteredList.size()); + assertEquals(3, filteredList.size()); filter = ToscaPolicyFilter.builder().type("onap.policies.monitoring.cdap.tca.hi.lo.app").build(); filteredList = filter.filter(policyList); |