From c01d5ca4f36b21eb4a08db16498a25a3f28351e2 Mon Sep 17 00:00:00 2001 From: Krishnakumar Jinka Date: Mon, 3 Dec 2018 09:38:51 +0900 Subject: Fix sonar issue in droolspdf Modify protocol coder to fix sonar issue about method params too many. Using existing builder. Address review comments, replace modified with modification Issue-ID: POLICY-1251 Change-Id: I67bd753f346108865404b733e7cf6008c2012766 Signed-off-by: krisjinka --- .../protocol/coders/ProtocolCoderToolsetTest.java | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'policy-management/src/test/java/org/onap') 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 28168178..d28f1e52 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 @@ -105,9 +105,14 @@ public class ProtocolCoderToolsetTest { * @param protocolFilter protocol filter */ public void testGsonToolset(JsonProtocolFilter protocolFilter) { - GsonProtocolCoderToolset gsonToolset = new GsonProtocolCoderToolset(JUNIT_PROTOCOL_CODER_TOPIC, CONTROLLER_ID, - this.releaseId.getGroupId(), this.releaseId.getArtifactId(), Triple.class.getCanonicalName(), - protocolFilter, null, 12345678); + GsonProtocolCoderToolset gsonToolset = new GsonProtocolCoderToolset( + EventProtocolParams.builder().topic(JUNIT_PROTOCOL_CODER_TOPIC) + .groupId(this.releaseId.getGroupId()) + .artifactId(this.releaseId.getArtifactId()) + .eventClass(Triple.class.getCanonicalName()) + .protocolFilter(protocolFilter) + .customGsonCoder(null) + .modelClassLoaderHash(12345678), CONTROLLER_ID); Assert.assertNotNull(gsonToolset.getEncoder()); Assert.assertNotNull(gsonToolset.getDecoder()); @@ -130,9 +135,15 @@ public class ProtocolCoderToolsetTest { * @param protocolFilter protocol filter */ public void testJacksonToolset(JsonProtocolFilter protocolFilter) { - JacksonProtocolCoderToolset jacksonToolset = new JacksonProtocolCoderToolset(JUNIT_PROTOCOL_CODER_TOPIC, - CONTROLLER_ID, this.releaseId.getGroupId(), this.releaseId.getArtifactId(), - Triple.class.getCanonicalName(), protocolFilter, null, 12345678); + JacksonProtocolCoderToolset jacksonToolset = new JacksonProtocolCoderToolset( + EventProtocolParams.builder() + .topic(JUNIT_PROTOCOL_CODER_TOPIC) + .groupId(this.releaseId.getGroupId()) + .artifactId(this.releaseId.getArtifactId()) + .eventClass(Triple.class.getCanonicalName()) + .protocolFilter(protocolFilter) + .customJacksonCoder(null) + .modelClassLoaderHash(12345678), CONTROLLER_ID); jacksonToolset.getEncoder().setVisibility(PropertyAccessor.FIELD, Visibility.ANY); jacksonToolset.getDecoder().setVisibility(PropertyAccessor.FIELD, Visibility.ANY); -- cgit 1.2.3-korg