summaryrefslogtreecommitdiffstats
path: root/policy-management/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-02-19 16:56:06 -0500
committerJim Hahn <jrh3@att.com>2018-02-20 09:59:15 -0500
commita45f8909871dc1ddb75845f067a602951afc8d11 (patch)
treefa72aff7ceede971d4e6922f62a503a8ee8924d5 /policy-management/src/test
parent1708e9a45cb88571613c10b68d392811b2b3f0f4 (diff)
Sonar fixes to drools-pdp
Fixed most of the instances of the following sonar issues: Moved array designator Used diamond operator Changed System.out/err to use a logger Changed several Thread.sleep() in test code to a single sleep() Useless assignments Replaced comparison with "" to string.isEmpty() Merged if's Replaced ArrayList with List in method returns Reordered type modifiers Reordered constructor methods Defined constants for literals, or replaced them with method calls Removed "throws Xxx" for subclasses of RuntimeException Combined identical "catch" blocks Re-interrupted the current thread after catching an InterruptedException Removed tests against the literal "false" Fix indentation of new makeTopicOperError() method. Fix exception variable name in new methods, logNoUebEncoder() and logNoDmaapEncoder(). Change-Id: Iddae5210553662f733b67333b372dec8c3fe2c94 Issue-ID: POLICY-336 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-management/src/test')
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java18
1 files changed, 10 insertions, 8 deletions
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 e3dd7c54..c7113cd4 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
@@ -20,16 +20,13 @@
package org.onap.policy.drools.protocol.coders;
-import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
+
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -47,6 +44,11 @@ import org.onap.policy.drools.utils.Triple;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
/**
* ProtocolCoder Toolset JUNITs
*/
@@ -157,7 +159,8 @@ public class ProtocolCoderToolsetTest {
decode(protocolFilter, coderToolset, triple, tripleEncoded);
}
- private void decode(JsonProtocolFilter protocolFilter, ProtocolCoderToolset coderToolset,
+ @SuppressWarnings("unchecked")
+ private void decode(JsonProtocolFilter protocolFilter, ProtocolCoderToolset coderToolset,
Triple<String, String, String> triple, String tripleEncoded) {
Triple<String, String, String> tripleDecoded = null;
@@ -273,9 +276,8 @@ public class ProtocolCoderToolsetTest {
droolsControllerConfig.put(PolicyProperties.PROPERTY_NOOP_SINK_TOPICS + "." +
JUNIT_PROTOCOL_CODER_TOPIC + PolicyProperties.PROPERTY_TOPIC_EVENTS_SUFFIX,
Triple.class.getCanonicalName());
-
- DroolsController droolsController =
- DroolsController.factory.build(droolsControllerConfig, null, noopTopics);
+
+ DroolsController.factory.build(droolsControllerConfig, null, noopTopics);
}
private JsonProtocolFilter createFilterSet() {