diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2019-10-21 13:59:02 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2019-10-21 13:59:23 -0400 |
commit | 5f69582dfaf325a8552ebeaa7cd69f81bc7d478f (patch) | |
tree | c1af7cf77060e2b9e7cd78ac74d5ba3004a0a717 /models-tosca/src/test/java/org | |
parent | d0cca771fa39943a46470240cd0106941056e974 (diff) |
Update optimization policies to have version
These should be version 1.0.0. Add in a no version test.
Issue-ID: POLICY-2066
Change-Id: Ie113c02c37e95b86dbb31247bf7a9fda09f724b1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'models-tosca/src/test/java/org')
2 files changed, 8 insertions, 8 deletions
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 28836a981..d9ffec566 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 @@ -144,19 +144,19 @@ public class ToscaPolicyTypeFilterTest { List<ToscaPolicyType> filteredList = filter.filter(typeList); assertEquals(20, filteredList.size()); assertEquals(VERSION_100, filteredList.get(0).getVersion()); - assertEquals(VERSION_000, filteredList.get(11).getVersion()); + assertEquals(VERSION_100, filteredList.get(11).getVersion()); typeList.get(12).setVersion("2.0.0"); filteredList = filter.filter(typeList); assertEquals(20, filteredList.size()); assertEquals("2.0.0", filteredList.get(11).getVersion()); - assertEquals(VERSION_000, filteredList.get(18).getVersion()); + assertEquals(VERSION_100, filteredList.get(18).getVersion()); typeList.get(12).setVersion(VERSION_100); filteredList = filter.filter(typeList); assertEquals(20, filteredList.size()); assertEquals(VERSION_100, filteredList.get(0).getVersion()); - assertEquals(VERSION_000, filteredList.get(18).getVersion()); + assertEquals(VERSION_100, filteredList.get(18).getVersion()); } @Test @@ -175,12 +175,12 @@ public class ToscaPolicyTypeFilterTest { filter = ToscaPolicyTypeFilter.builder().version(VERSION_000).build(); filteredList = filter.filter(typeList); - assertEquals(9, filteredList.size()); + assertEquals(1, filteredList.size()); filter = ToscaPolicyTypeFilter.builder().name("onap.policies.optimization.Vim_fit").version(VERSION_000) .build(); filteredList = filter.filter(typeList); - assertEquals(1, filteredList.size()); + assertEquals(0, filteredList.size()); filter = ToscaPolicyTypeFilter.builder().name("onap.policies.optimization.Vim_fit").version("0.0.1").build(); filteredList = filter.filter(typeList); diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java index d77b52daa..20b8e5d1e 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java @@ -56,8 +56,8 @@ import org.yaml.snakeyaml.Yaml; */ public class AuthorativeToscaProviderPolicyTypeTest { private static final String VERSION = "version"; - private static final String POLICY_AFFINITY_VERSION0 = "onap.policies.optimization.AffinityPolicy:0.0.0"; - private static final String POLICY_AFFINITY = "onap.policies.optimization.AffinityPolicy"; + private static final String POLICY_AFFINITY_VERSION0 = "onap.policies.NoVersion:0.0.0"; + private static final String POLICY_AFFINITY = "onap.policies.NoVersion"; private static final String MISSING_POLICY_TYPES = "no policy types specified on service template"; private static final String DAO_IS_NULL = "dao is marked @NonNull but is null"; private static final String VERSION_000 = "0.0.0"; @@ -74,7 +74,7 @@ public class AuthorativeToscaProviderPolicyTypeTest { @BeforeClass public static void readPolicyDefinition() { String yamlString = - ResourceUtils.getResourceAsString("policytypes/onap.policies.optimization.AffinityPolicy.yaml"); + ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml"); Object yamlObject = new Yaml().load(yamlString); yamlAsJsonString = new GsonBuilder().setPrettyPrinting().create().toJson(yamlObject); |