aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--feature-distributed-locking/pom.xml9
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java35
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java3
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java82
-rw-r--r--feature-session-persistence/pom.xml9
-rw-r--r--feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java31
-rw-r--r--policy-core/pom.xml7
-rw-r--r--policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java5
-rw-r--r--policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java3
-rw-r--r--policy-management/pom.xml6
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java6
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java4
-rw-r--r--policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java24
-rw-r--r--pom.xml6
14 files changed, 126 insertions, 104 deletions
diff --git a/feature-distributed-locking/pom.xml b/feature-distributed-locking/pom.xml
index f657c39e..f6b83551 100644
--- a/feature-distributed-locking/pom.xml
+++ b/feature-distributed-locking/pom.xml
@@ -3,13 +3,14 @@
ONAP Policy Engine - Drools PDP
================================================================================
Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2020 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -99,12 +100,12 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
- <version>2.1.1</version>
+ <version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
- <version>2.4.2</version>
+ <version>2.8.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java
index c3b2ac82..b82f2e1d 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Bucket.java
@@ -66,6 +66,7 @@ import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.slf4j.Logger;
@@ -179,6 +180,7 @@ public class Bucket {
private static final String QP_KEYWORD = "keyword";
private static final String QP_DEST = "dest";
private static final String QP_TTL = "ttl";
+ private static final String OWNED_STR = "Owned";
// BACKUP data (only buckets for where we are the owner, or a backup)
@@ -579,7 +581,7 @@ public class Bucket {
* @throws IOException when error occurred
*/
public static void bucketMessage(
- final PrintStream out, final String keyword, String message) throws IOException {
+ final PrintStream out, final String keyword, String message) {
if (keyword == null) {
out.println("'keyword' is mandatory");
@@ -1149,6 +1151,7 @@ public class Bucket {
* on any server.
* Each instance of this class corresponds to a 'Bucket' instance.
*/
+ @EqualsAndHashCode
private static class TestBucket implements Comparable<TestBucket> {
// bucket number
int index;
@@ -1326,6 +1329,7 @@ public class Bucket {
* around a 'TestServer' instance, as it would be if another specific
* server failed.
*/
+ @EqualsAndHashCode
private static class AdjustedTestServer
implements Comparable<AdjustedTestServer> {
TestServer server;
@@ -1529,15 +1533,12 @@ public class Bucket {
* 'needBuckets' TreeSet: those with the fewest buckets allocated are
* at the head of the list.
*/
- Comparator<TestServer> bucketCount = new Comparator<>() {
- @Override
- public int compare(TestServer s1, TestServer s2) {
- int rval = s1.buckets.size() - s2.buckets.size();
- if (rval == 0) {
- rval = Util.uuidComparator.compare(s1.uuid, s2.uuid);
- }
- return rval;
+ Comparator<TestServer> bucketCount = (s1, s2) -> {
+ int rval = s1.buckets.size() - s2.buckets.size();
+ if (rval == 0) {
+ rval = Util.uuidComparator.compare(s1.uuid, s2.uuid);
}
+ return rval;
};
// sort servers according to the order in which they can
@@ -1715,7 +1716,7 @@ public class Bucket {
// populate a 'TreeSet' of 'AdjustedTestServer' instances based
// the failure of 'failedServer'
TreeSet<AdjustedTestServer> adjustedTestServers =
- new TreeSet<AdjustedTestServer>();
+ new TreeSet<>();
for (TestServer server : testServers.values()) {
if (server == failedServer
|| Objects.equals(siteSocketAddress,
@@ -1872,11 +1873,11 @@ public class Bucket {
// dump out 'owned' bucket information
if (ts.buckets.isEmpty()) {
// no buckets owned by this server
- out.printf(format, ts.uuid, "Owned", 0, "");
+ out.printf(format, ts.uuid, OWNED_STR, 0, "");
} else {
// dump out primary buckets information
totalOwner +=
- dumpBucketsSegment(out, format, ts.buckets, ts.uuid.toString(), "Owned");
+ dumpBucketsSegment(out, format, ts.buckets, ts.uuid.toString(), OWNED_STR);
}
// optionally dump out primary buckets information
totalPrimary +=
@@ -1899,7 +1900,7 @@ public class Bucket {
// optionally dump out unassigned owned buckets information
if (dumpBucketsSegment(out, format, nullServer.buckets,
- uuidField, "Owned") != 0) {
+ uuidField, OWNED_STR) != 0) {
uuidField = "";
}
// optionally dump out unassigned primary backup buckets information
@@ -2247,7 +2248,9 @@ public class Bucket {
&& oldOwner.isActive()
&& (delay = getTimeout()) > 0) {
// ignore return value -- 'data' will indicate the result
- dataAvailable.await(delay, TimeUnit.MILLISECONDS);
+ if (!dataAvailable.await(delay, TimeUnit.MILLISECONDS)) {
+ logger.error("CountDownLatch await time reached");
+ }
}
if (lclData == null) {
// no data available -- log an error, and abort
@@ -2282,11 +2285,11 @@ public class Bucket {
} catch (Exception e) {
logger.error("Exception in {}", this, e);
} finally {
- run_cleanup();
+ runCleanup();
}
}
- private void run_cleanup() {
+ private void runCleanup() {
/*
* cleanly leave state -- we want to make sure that messages
* are processed in order, so the queue needs to remain until
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java
index 636fa4d5..2c0a2544 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/RestServerPool.java
@@ -343,8 +343,7 @@ public class RestServerPool {
)
@Produces(MediaType.TEXT_PLAIN)
public String bucketMessage(@QueryParam("keyword") String keyword,
- @QueryParam("message") String message)
- throws IOException {
+ @QueryParam("message") String message) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Bucket.bucketMessage(new PrintStream(bos, true), keyword, message);
return bos.toString(StandardCharsets.UTF_8);
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
index c60683ef..634c15ec 100644
--- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
+++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java
@@ -203,6 +203,9 @@ public class Server implements Comparable<Server> {
// 'pingHosts' error
static final String PINGHOSTS_ERROR = "Server.pingHosts error";
+ // a string for print
+ static final String PRINTOUT_DASHES = "-------";
+
/*==============================*/
/* Comparable<Server> interface */
/*==============================*/
@@ -963,13 +966,11 @@ public class Server implements Comparable<Server> {
if (responseCallback != null) {
responseCallback.exceptionResponse(e);
}
- MainLoop.queueWork(() -> {
- // this runs in the 'MainLoop' thread
+ // this runs in the 'MainLoop' thread
- // the DNS cache may have been out-of-date when this server
- // was first contacted -- fix the problem, if needed
- checkServer();
- });
+ // the DNS cache may have been out-of-date when this server
+ // was first contacted -- fix the problem, if needed
+ MainLoop.queueWork(this::checkServer);
}
});
}
@@ -985,7 +986,7 @@ public class Server implements Comparable<Server> {
sendThreadPool =
new ThreadPoolExecutor(corePoolSize, maximumPoolSize,
keepAliveTime, TimeUnit.MILLISECONDS,
- new LinkedTransferQueue<Runnable>());
+ new LinkedTransferQueue<>());
sendThreadPool.allowCoreThreadTimeOut(true);
}
return sendThreadPool;
@@ -1170,31 +1171,7 @@ public class Server implements Comparable<Server> {
new String(Base64.getEncoder().encode(bos.toByteArray()),
StandardCharsets.UTF_8),
MediaType.APPLICATION_OCTET_STREAM_TYPE);
-
- // loop through hosts
- for (InetSocketAddress host : hosts) {
- HttpClient httpClient = null;
-
- try {
- httpClient = buildClient(host.toString(), host,
- socketAddressToName(host));
- getTarget(httpClient).path("admin").request().post(entity);
- httpClient.shutdown();
- httpClient = null;
- } catch (KeyManagementException | NoSuchAlgorithmException e) {
- out.println(host + ": Unable to create client connection");
- logger.error(PINGHOSTS_ERROR, e);
- } catch (NoSuchFieldException | IllegalAccessException e) {
- out.println(host + ": Unable to get link to target");
- logger.error(PINGHOSTS_ERROR, e);
- } catch (Exception e) {
- out.println(host + ": " + e);
- logger.error(PINGHOSTS_ERROR, e);
- }
- if (httpClient != null) {
- httpClient.shutdown();
- }
- }
+ pingHostsLoop(entity, out, hosts);
} catch (IOException e) {
out.println("Unable to generate 'ping' data: " + e);
logger.error(PINGHOSTS_ERROR, e);
@@ -1214,6 +1191,43 @@ public class Server implements Comparable<Server> {
}
/**
+ * This method is used for pingHosts method to reduce its Cognitive Complexity.
+ *
+ * @param entity for sending out to all hosts
+ * @param out the 'PrintStream' to use for displaying information
+ * @param hosts a collection of 'InetSocketAddress' instances, which are
+ * the hosts to send the information to
+ */
+ static void pingHostsLoop(final Entity<String> entity,
+ final PrintStream out,
+ final Collection<InetSocketAddress> hosts) {
+ // loop through hosts
+ for (InetSocketAddress host : hosts) {
+ HttpClient httpClient = null;
+
+ try {
+ httpClient = buildClient(host.toString(), host,
+ socketAddressToName(host));
+ getTarget(httpClient).path("admin").request().post(entity);
+ httpClient.shutdown();
+ httpClient = null;
+ } catch (KeyManagementException | NoSuchAlgorithmException e) {
+ out.println(host + ": Unable to create client connection");
+ logger.error(PINGHOSTS_ERROR, e);
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ out.println(host + ": Unable to get link to target");
+ logger.error(PINGHOSTS_ERROR, e);
+ } catch (Exception e) {
+ out.println(host + ": " + e);
+ logger.error(PINGHOSTS_ERROR, e);
+ }
+ if (httpClient != null) {
+ httpClient.shutdown();
+ }
+ }
+ }
+
+ /**
* This method may be invoked from any thread:
* Dump out the current 'servers' table in a human-readable table form.
*
@@ -1264,14 +1278,14 @@ public class Server implements Comparable<Server> {
"Count", "Update Time", "Elapsed", "Allowed");
out.printf(format, "", "----", "----------", "----",
"---------------", "----",
- "-----", "-----------", "-------", "-------");
+ "-----", "-----------", PRINTOUT_DASHES, PRINTOUT_DASHES);
// @formatter:on
} else {
// @formatter:off
out.printf(format, "", "UUID", "IP Address", "Port",
"Count", "Update Time", "Elapsed", "Allowed");
out.printf(format, "", "----", "----------", "----",
- "-----", "-----------", "-------", "-------");
+ "-----", "-----------", PRINTOUT_DASHES, PRINTOUT_DASHES);
// @formatter:on
}
diff --git a/feature-session-persistence/pom.xml b/feature-session-persistence/pom.xml
index c81e7b13..afa9e601 100644
--- a/feature-session-persistence/pom.xml
+++ b/feature-session-persistence/pom.xml
@@ -3,13 +3,14 @@
ONAP Policy Engine - Drools PDP
================================================================================
Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2020 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -139,12 +140,12 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
- <version>2.1.1</version>
+ <version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
- <version>2.4.2</version>
+ <version>2.8.0</version>
</dependency>
<dependency>
diff --git a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java
index 8853edf2..3033a7bd 100644
--- a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java
+++ b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java
@@ -22,6 +22,7 @@ package org.onap.policy.drools.persistence;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import java.util.Date;
@@ -36,11 +37,11 @@ public class DroolsSessionEntityTest {
DroolsSessionEntity e2 = makeEnt("mynameA", 2);
// session id is not part of hash code
- assertTrue(entity.hashCode() == e2.hashCode());
+ assertEquals(entity.hashCode(), e2.hashCode());
// diff sess name
e2 = makeEnt("mynameB", 1);
- assertTrue(entity.hashCode() != e2.hashCode());
+ assertNotEquals(entity.hashCode(), e2.hashCode());
}
/** Ensures that hashCode() functions as expected when the getXxx methods are overridden. */
@@ -51,11 +52,11 @@ public class DroolsSessionEntityTest {
DroolsSessionEntity e2 = makeEnt("mynameA", 2);
// session id is not part of hash code
- assertTrue(entity.hashCode() == e2.hashCode());
+ assertEquals(entity.hashCode(), e2.hashCode());
// diff sess name
e2 = makeEnt("mynameB", 1);
- assertTrue(entity.hashCode() != e2.hashCode());
+ assertNotEquals(entity.hashCode(), e2.hashCode());
}
@Test
@@ -103,21 +104,21 @@ public class DroolsSessionEntityTest {
DroolsSessionEntity entity = makeEnt("mynameA", 1);
// diff object type
- assertFalse(entity.equals("hello"));
+ assertNotEquals(entity, "hello");
// reflexive
- assertTrue(entity.equals(entity));
+ assertEquals(entity, entity);
DroolsSessionEntity e2 = makeEnt("mynameA", 2);
// session id is not part of hash code
- assertTrue(entity.equals(e2));
- assertTrue(entity.equals(e2));
+ assertEquals(entity, e2);
+ assertEquals(entity, e2);
// diff sess name
e2 = makeEnt("mynameB", 1);
- assertFalse(entity.equals(e2));
- assertFalse(entity.equals(e2));
+ assertNotEquals(entity, e2);
+ assertNotEquals(entity, e2);
}
/** Ensures that equals() functions as expected when the getXxx methods are overridden. */
@@ -126,18 +127,18 @@ public class DroolsSessionEntityTest {
DroolsSessionEntity entity = makeEnt2("mynameA", 1);
// reflexive
- assertTrue(entity.equals(entity));
+ assertEquals(entity, entity);
DroolsSessionEntity e2 = makeEnt("mynameA", 2);
// session id is not part of hash code
- assertTrue(entity.equals(e2));
- assertTrue(entity.equals(e2));
+ assertEquals(entity, e2);
+ assertEquals(entity, e2);
// diff sess name
e2 = makeEnt("mynameB", 1);
- assertFalse(entity.equals(e2));
- assertFalse(entity.equals(e2));
+ assertNotEquals(entity, e2);
+ assertNotEquals(entity, e2);
}
@Test
diff --git a/policy-core/pom.xml b/policy-core/pom.xml
index 34eeea13..dbba23a0 100644
--- a/policy-core/pom.xml
+++ b/policy-core/pom.xml
@@ -5,13 +5,14 @@
================================================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2019 Bell Canada.
+ Modifications Copyright (C) 2020 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +46,7 @@
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
- <version>1.9.12</version>
+ <version>1.10.8</version>
</dependency>
<dependency>
diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java b/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java
index 928af4de..939de08c 100644
--- a/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java
+++ b/policy-core/src/test/java/org/onap/policy/drools/core/DroolsContainerTest.java
@@ -22,6 +22,7 @@ package org.onap.policy.drools.core;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
@@ -117,7 +118,7 @@ public class DroolsContainerTest {
try {
// fetch the session, and verify that it exists
PolicySession session = container.getPolicySession("session1");
- assertTrue(session != null);
+ assertNotNull(session);
// get all sessions, and verify that this one is the only one
{
@@ -279,7 +280,7 @@ public class DroolsContainerTest {
try {
// fetch the session, and verify that it exists
PolicySession session = container.getPolicySession("session1");
- assertTrue(session != null);
+ assertNotNull(session);
// get all sessions, and verify that this one is the only one
{
diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java b/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java
index 0422b486..7b565f76 100644
--- a/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java
+++ b/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java
@@ -22,6 +22,7 @@ package org.onap.policy.drools.core.jmx;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
@@ -40,7 +41,7 @@ public class PdpJmxTest {
public void testGetInstance() {
jmx = PdpJmx.getInstance();
assertNotNull(jmx);
- assertTrue(PdpJmx.getInstance() == jmx);
+ assertSame(jmx, PdpJmx.getInstance());
}
@Test
diff --git a/policy-management/pom.xml b/policy-management/pom.xml
index 92d8d92b..fb96fd7b 100644
--- a/policy-management/pom.xml
+++ b/policy-management/pom.xml
@@ -4,7 +4,7 @@
ONAP Policy Engine - Drools PDP
================================================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2020 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -222,7 +222,7 @@
<artifactId>gson-javatime-serialisers</artifactId>
<version>1.1.1</version>
</dependency>
-
+
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
@@ -231,7 +231,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
- <version>4.1</version>
+ <version>4.4</version>
</dependency>
<!-- if we don't explicitly specify the version here, we seem to end up
diff --git a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java
index 7a5ed2c0..6b497fa3 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java
@@ -176,9 +176,9 @@ public class ProtocolCoderToolsetTest {
tripleDecoded = (Triple<String, String, String>) coderToolset.decode(tripleEncoded);
- Assert.assertTrue(tripleDecoded.first().equals(triple.first()));
- Assert.assertTrue(tripleDecoded.second().equals(triple.second()));
- Assert.assertTrue(tripleDecoded.third().equals(triple.third()));
+ Assert.assertEquals(tripleDecoded.first(), triple.first());
+ Assert.assertEquals(tripleDecoded.second(), triple.second());
+ Assert.assertEquals(tripleDecoded.third(), triple.third());
coderFilters.getFilter().setRule("[?($.third =~ /.*v3.*/)]");
}
diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
index a999c718..f4876a95 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineManagerTest.java
@@ -519,7 +519,7 @@ public class PolicyEngineManagerTest {
verify(prov1).beforeConfigure(mgr, properties);
verify(prov2).beforeConfigure(mgr, properties);
- assertTrue(mgr.getProperties() == properties);
+ assertSame(properties, mgr.getProperties());
assertEquals(sources, mgr.getSources());
assertEquals(sinks, mgr.getSinks());
@@ -553,7 +553,7 @@ public class PolicyEngineManagerTest {
(prov, flag) -> when(prov.afterConfigure(mgr)).thenReturn(flag),
() -> mgr.configure(properties),
prov -> verify(prov).beforeConfigure(mgr, properties),
- () -> assertTrue(mgr.getProperties() == properties),
+ () -> assertSame(properties, mgr.getProperties()),
prov -> verify(prov).afterConfigure(mgr));
}
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java
index 7f04b163..b62c9530 100644
--- a/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java
+++ b/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java
@@ -31,32 +31,32 @@ public class TripleTest {
Triple<String, String, String> triple =
new Triple<>("one", "two", "three");
- Assert.assertTrue("one".equals(triple.first()));
- Assert.assertTrue("one".equals(triple.getFirst()));
+ Assert.assertEquals("one", triple.first());
+ Assert.assertEquals("one", triple.getFirst());
- Assert.assertTrue("two".equals(triple.second()));
- Assert.assertTrue("two".equals(triple.getSecond()));
+ Assert.assertEquals("two", triple.second());
+ Assert.assertEquals("two", triple.getSecond());
- Assert.assertTrue("three".equals(triple.third()));
- Assert.assertTrue("three".equals(triple.getThird()));
+ Assert.assertEquals("three", triple.third());
+ Assert.assertEquals("three", triple.getThird());
triple.first("I");
- Assert.assertTrue("I".equals(triple.first()));
+ Assert.assertEquals("I", triple.first());
triple.setFirst("1");
- Assert.assertTrue("1".equals(triple.first()));
+ Assert.assertEquals("1", triple.first());
triple.second("2");
- Assert.assertTrue("2".equals(triple.second()));
+ Assert.assertEquals("2", triple.second());
triple.setSecond("II");
- Assert.assertTrue("II".equals(triple.second()));
+ Assert.assertEquals("II", triple.second());
triple.third("3");
- Assert.assertTrue("3".equals(triple.third()));
+ Assert.assertEquals("3", triple.third());
triple.setThird("III");
- Assert.assertTrue("III".equals(triple.third()));
+ Assert.assertEquals("III", triple.third());
}
} \ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 9c8abdb8..20975704 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
ONAP Policy Engine - Drools PDP
================================================================================
Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2020 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -86,12 +86,12 @@
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
- <version>2.0.1</version>
+ <version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.hk2.external</groupId>
<artifactId>javax.inject</artifactId>
- <version>2.4.0-b31</version>
+ <version>2.5.0-b62</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>