summaryrefslogtreecommitdiffstats
path: root/models-tosca/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'models-tosca/src/test/java')
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyFilterTest.java17
1 files changed, 17 insertions, 0 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 84a0df00b..f7c9c7ef0 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
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -187,6 +188,22 @@ public class ToscaPolicyFilterTest {
}
@Test
+ public void testFilterVersionPrefix() {
+ // null pattern
+ ToscaPolicyFilter filter = ToscaPolicyFilter.builder().versionPrefix(null).build();
+ List<ToscaPolicy> filteredList = filter.filter(policyList);
+ assertEquals(17, filteredList.size());
+
+ filter = ToscaPolicyFilter.builder().versionPrefix("1.").build();
+ filteredList = filter.filter(policyList);
+ assertEquals(17, filteredList.size());
+
+ filter = ToscaPolicyFilter.builder().versionPrefix("100.").build();
+ filteredList = filter.filter(policyList);
+ assertEquals(0, filteredList.size());
+ }
+
+ @Test
public void testFilterTypeVersion() {
ToscaPolicyFilter filter = ToscaPolicyFilter.builder().type("onap.policies.controlloop.Operational").build();
List<ToscaPolicy> filteredList = filter.filter(policyList);