summaryrefslogtreecommitdiffstats
path: root/main/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/test')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java5
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateDataTest.java15
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployControllerV1.java4
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 {