diff options
author | Jim Hahn <jrh3@att.com> | 2019-04-05 09:03:15 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-04-05 09:03:15 -0400 |
commit | 457c9b19c058877ca59c9b0826d22f3f97392daf (patch) | |
tree | 0ba8edbec3f194d7a8643a3bd450268de129e9c4 /main/src/test/java | |
parent | 0621ae5c8a1dfcfa81b678ae6cc8679b88f58cc4 (diff) |
Fixes per latest models updates
Changes made per the scrum call on 4/4 moved things around. In
addition, filter classes were added to the tosca provider. Both
of these necessitated changes to policy/pap so that things compile.
Change-Id: Iba4c52b650dab0f8d242b06be3fede42dd5b7264
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src/test/java')
3 files changed, 9 insertions, 15 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java index 91d7d435..8f064035 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java @@ -42,7 +42,6 @@ import java.util.List; import java.util.Map; import java.util.Queue; import java.util.function.Consumer; - import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -55,9 +54,9 @@ import org.onap.policy.models.pdp.concepts.PdpMessage; import org.onap.policy.models.pdp.concepts.PdpStateChange; import org.onap.policy.models.pdp.concepts.PdpStatus; import org.onap.policy.models.pdp.concepts.PdpUpdate; -import org.onap.policy.models.pdp.concepts.ToscaPolicyIdentifier; import org.onap.policy.models.pdp.enums.PdpState; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier; import org.onap.policy.pap.main.PapConstants; import org.onap.policy.pap.main.comm.PdpModifyRequestMap.ModifyReqData; import org.onap.policy.pap.main.parameters.PdpModifyRequestMapParams; @@ -585,7 +584,7 @@ public class PdpModifyRequestMapTest { return cng; } - + /** * Converts a ToscaPolicy list to ToscaPolicyIdentifier list. * diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateDataTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateDataTest.java index 127843a0..352b92df 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateDataTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateDataTest.java @@ -29,13 +29,13 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.Arrays; import java.util.List; - +import java.util.stream.Collectors; import org.junit.Before; import org.junit.Test; import org.onap.policy.models.pdp.concepts.PdpStatus; import org.onap.policy.models.pdp.concepts.PdpUpdate; -import org.onap.policy.models.pdp.concepts.ToscaPolicyIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier; import org.onap.policy.pap.main.comm.TimerManager; import org.onap.policy.pap.main.parameters.PdpModifyRequestMapParams; import org.onap.policy.pap.main.parameters.PdpParameters; @@ -123,7 +123,7 @@ public class UpdateDataTest { @Test public void testUpdateDataCheckResponse_MismatchedPolicies() { ArrayList<ToscaPolicyIdentifier> policies = - new ArrayList<>(convertToscaPolicyToToscaPolicyIndentifier(update.getPolicies())); + new ArrayList<>(convertToscaPolicyToToscaPolicyIndentifier(update.getPolicies())); policies.set(0, new ToscaPolicyIdentifier(DIFFERENT, "10.0.0")); response.setPolicies(policies); @@ -184,7 +184,7 @@ public class UpdateDataTest { // do nothing } } - + /** * Converts a ToscaPolicy list to ToscaPolicyIdentifier list. * @@ -192,10 +192,7 @@ public class UpdateDataTest { * @return the ToscaPolicyIdentifier list */ private List<ToscaPolicyIdentifier> convertToscaPolicyToToscaPolicyIndentifier(List<ToscaPolicy> toscaPolicies) { - final List<ToscaPolicyIdentifier> toscaPolicyIdentifiers = new ArrayList<>(); - for (final ToscaPolicy toscaPolicy : toscaPolicies) { - toscaPolicyIdentifiers.add(new ToscaPolicyIdentifier(toscaPolicy.getName(), toscaPolicy.getVersion())); - } - return toscaPolicyIdentifiers; + return toscaPolicies.stream().map(policy -> new ToscaPolicyIdentifier(policy.getName(), policy.getVersion())) + .collect(Collectors.toList()); } } diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployControllerV1.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployControllerV1.java index 18e17b09..09e91a99 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployControllerV1.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployControllerV1.java @@ -25,18 +25,16 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import java.util.Arrays; - import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - import org.junit.Test; import org.onap.policy.models.pap.concepts.PdpDeployPolicies; import org.onap.policy.models.pap.concepts.PdpGroupDeployResponse; import org.onap.policy.models.pdp.concepts.PdpGroup; import org.onap.policy.models.pdp.concepts.PdpSubGroup; -import org.onap.policy.models.pdp.concepts.ToscaPolicyIdentifierOptVersion; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifierOptVersion; public class TestPdpGroupDeployControllerV1 extends CommonPapRestServer { |