summaryrefslogtreecommitdiffstats
path: root/feature-state-management/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-08-25 17:05:37 -0400
committerJim Hahn <jrh3@att.com>2020-08-25 18:47:23 -0400
commit72cf248dced4e272e69a8c48f5ee24c9d345f41d (patch)
treeb09ed0f9b7ee7aac6493119d950d78d50ae08da1 /feature-state-management/src
parent5c71b5a62f4208030b3c3cd18b3f42398a0a86e5 (diff)
Address more sonars in drools-pdp
Addressed the following sonars: - either log or rethrow - call "remove()" for thread-local-storage - use assertEquals - only one method call in exception test - swap arguments in assertEquals - add assertion to assertThatThrownBy() - explain @Ignore Also addressed eclipse warnings: - unused fields and methods Issue-ID: POLICY-2616 Change-Id: I6590c0d2b103885bc933014d48bf5fd92401cd80 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-state-management/src')
-rw-r--r--feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java b/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
index 347e8c90..33bfaedc 100644
--- a/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
+++ b/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
@@ -20,6 +20,7 @@
package org.onap.policy.drools.statemanagement.test;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -143,8 +144,8 @@ public class StateManagementTest {
logger.debug("avail = {}", avail);
logger.debug("standby = {}", standby);
- assertTrue("Admin state not unlocked after initialization", admin.equals(StateManagement.UNLOCKED));
- assertTrue("Operational state not enabled after initialization", oper.equals(StateManagement.ENABLED));
+ assertEquals("Admin state not unlocked after initialization", StateManagement.UNLOCKED, admin);
+ assertEquals("Operational state not enabled after initialization", StateManagement.ENABLED, oper);
try {
stateManagementFeature.disableFailed();
@@ -164,8 +165,8 @@ public class StateManagementTest {
logger.debug("avail = {}", avail);
logger.debug("standby = {}", standby);
- assertTrue("Operational state not disabled after disableFailed()", oper.equals(StateManagement.DISABLED));
- assertTrue("Availability status not failed after disableFailed()", avail.equals(StateManagement.FAILED));
+ assertEquals("Operational state not disabled after disableFailed()", StateManagement.DISABLED, oper);
+ assertEquals("Availability status not failed after disableFailed()", StateManagement.FAILED, avail);
try {
@@ -185,7 +186,7 @@ public class StateManagementTest {
logger.debug("avail = {}", avail);
logger.debug("standby = {}", standby);
- assertTrue("Standby status not coldstandby after promote()", standby.equals(StateManagement.COLD_STANDBY));
+ assertEquals("Standby status not coldstandby after promote()", StateManagement.COLD_STANDBY, standby);
/* *************Repository Audit Test. ************* */
logger.debug("\n\ntestStateManagementOperation: Repository Audit\n\n");