aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-06 17:32:21 -0400
committerJim Hahn <jrh3@att.com>2021-05-06 17:53:00 -0400
commitccca53bbd25af1230e135587163bcb53e381058c (patch)
tree921e378cdce276092a11261d9d094e8c96f3f5cf /main/src/test
parenta7bf744a50dcb660818a6bc6f265191b3389c13b (diff)
Fix sonars in policy-pap
Fixed: - use "var" instead of actual type - remove unused parameter - remove un-thrown exception from method declaration - call isPresent() before Optional.get() - check empty list before invoking doesNotContain() Issue-ID: POLICY-3285 Change-Id: Ic90dccfd591c102ce29f14084f025b3ca69587dc Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src/test')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java4
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java5
2 files changed, 3 insertions, 6 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java
index 4a386c9c..0ceef772 100644
--- a/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java
+++ b/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
- * Modifications Copyright (C) 2020 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -225,7 +225,7 @@ public class PdpHeartbeatListenerTest extends End2EndBase {
PdpStatusMessageHandler handler = new PdpStatusMessageHandler(params);
PdpUpdate update10 = handler.createPdpUpdateMessage(
status3.getPdpGroup(), new PdpSubGroup(), "pdp_2",
- null, policies, policies, polsUndep);
+ policies, policies, polsUndep);
assertSame(update10.getPolicies(), policies);
assertSame(update10.getPoliciesToBeDeployed(), policies);
assertSame(update10.getPoliciesToBeUndeployed(), polsUndep);
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java
index d85bf737..02f47287 100644
--- a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java
+++ b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java
@@ -236,10 +236,7 @@ public class UpdateReqTest extends CommonRequestBase {
assertTrue(data.reconfigure(msg2));
- List<ToscaConceptIdentifier> dataPols = data.getMessage().getPoliciesToBeDeployed().stream()
- .map(ToscaPolicy::getIdentifier)
- .collect(Collectors.toList());
- assertThat(dataPols).doesNotContainAnyElementsOf(data.getMessage().getPoliciesToBeUndeployed());
+ assertThat(data.getMessage().getPoliciesToBeDeployed()).isEmpty();
// some items only in deploy
policies = new ArrayList<>(update.getPolicies());