aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-02-07 15:20:23 +0000
committerliamfallon <liam.fallon@est.tech>2021-02-07 15:20:28 +0000
commit0b0fd8d7c890a75ee1fe829c68b92cf670a4a29f (patch)
treeaf4541fb9f4735055db79b69fb68fc1b6265eb8e /main/src/test/java
parentfdaa8dc48d80d14177d9c955160e7534be505192 (diff)
Make filters on TOSCA entities generic
The classes PolicyTypeFilter and PolicyFilter only work on Policy types and policies. However they just filter on name/version/type/typeversion so there is no reason that the filters could not be applied to other entities. This commit adapts the PolicyTypeFilter to EntityFilter and PolicyFilter to TypedEntityFilter, so the filters can be applied to collections of any ToscaEntity class. Issue-ID: POLICY-2995 Change-Id: Ibf12c757758d31ec3075119c56243e0abcf259bf Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'main/src/test/java')
-rw-r--r--main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java
index 9b2f3b85..95f93865 100644
--- a/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java
+++ b/main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java
@@ -3,7 +3,7 @@
* ONAP Policy API
* ================================================================================
* Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021 Nordix Foundation.
* Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -117,11 +117,11 @@ public class TestPolicyTypeProvider {
assertThatThrownBy(() -> {
policyTypeProvider.fetchPolicyTypes("dummy", null);
- }).hasMessage("policy types for filter ToscaPolicyTypeFilter(name=dummy, version=null) do not exist");
+ }).hasMessage("policy types for filter ToscaEntityFilter(name=dummy, version=null) do not exist");
assertThatThrownBy(() -> {
policyTypeProvider.fetchPolicyTypes("dummy", "dummy");
- }).hasMessage("policy types for filter ToscaPolicyTypeFilter(name=dummy, version=dummy) do not exist");
+ }).hasMessage("policy types for filter ToscaEntityFilter(name=dummy, version=dummy) do not exist");
}
@Test
@@ -129,7 +129,7 @@ public class TestPolicyTypeProvider {
assertThatThrownBy(() -> {
policyTypeProvider.fetchLatestPolicyTypes("dummy");
- }).hasMessage("policy types for filter ToscaPolicyTypeFilter(name=dummy, version=LATEST) do not exist");
+ }).hasMessage("policy types for filter ToscaEntityFilter(name=dummy, version=LATEST) do not exist");
}
@Test