From 8d97ad4cf9b468d22e435537a8a9f2946205f35a Mon Sep 17 00:00:00 2001 From: Arindam Mondal Date: Fri, 19 Apr 2019 18:08:21 +0900 Subject: Sonar fix too many method param +) https://sonar.onap.org/issues?projectUuids=AWHFaQXIWid2ybiDeOSb&resolved=false&rules=squid%3AS00107 ++) code format Issue-ID: DMAAP-1174 Change-Id: I162ed1400be2ac059b14f16500bc849f6b10f8be Signed-off-by: arind.mondal --- .../java/org/onap/dmaap/datarouter/node/DeliveryTest.java | 5 ++++- .../java/org/onap/dmaap/datarouter/node/NodeConfigTest.java | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'datarouter-node/src/test/java/org/onap') diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java index efa43e11..08120073 100644 --- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java +++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/DeliveryTest.java @@ -97,7 +97,10 @@ public class DeliveryTest { private DestInfo[] createDestInfoObjects() { DestInfo[] destInfos = new DestInfo[1]; - DestInfo destInfo = new DestInfo("node.datarouternew.com", "spool/s/0/1", "1", "logs/", "/subs/1", "user1", "Basic dXNlcjE6cGFzc3dvcmQx", false, true, false, false, false); + DestInfo destInfo = new DestInfo.DestInfoBuilder().setName("node.datarouternew.com").setSpool("spool/s/0/1").setSubid("1") + .setLogdata("logs/").setUrl("/subs/1").setAuthuser("user1").setAuthentication("Basic dXNlcjE6cGFzc3dvcmQx") + .setMetaonly(false).setUse100(true).setPrivilegedSubscriber(false).setFollowRedirects(false) + .setDecompress(false).createDestInfo(); destInfos[0] = destInfo; return destInfos; } diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java index 7dddd67a..5e357373 100644 --- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java +++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeConfigTest.java @@ -36,7 +36,8 @@ import java.io.Reader; import java.io.StringReader; @RunWith(PowerMockRunner.class) -@SuppressStaticInitializationFor({"org.onap.dmaap.datarouter.node.ProvData", "org.onap.dmaap.datarouter.node.NodeUtils"}) +@SuppressStaticInitializationFor({"org.onap.dmaap.datarouter.node.ProvData", + "org.onap.dmaap.datarouter.node.NodeUtils"}) public class NodeConfigTest { private static NodeConfig nodeConfig; @@ -72,7 +73,7 @@ public class NodeConfigTest { } @Test - public void Given_SubId_Then_Get_Feed_Id_Returns_Correct_Id() { + public void Given_SubId_Then_Get_Feed_Id_Returns_Correct_Id(){ String feedId = nodeConfig.getFeedId("1"); Assert.assertEquals("1", feedId); } @@ -134,13 +135,15 @@ public class NodeConfigTest { @Test public void Given_Same_Ip_Then_Is_Another_Node_Returns_False() { - Boolean isAnotherNode = nodeConfig.isAnotherNode("Basic MTcyLjAuMC40OmtCTmhkWVFvbzhXNUphZ2g4T1N4Zmp6Mzl1ND0=", "172.0.0.1"); + Boolean isAnotherNode = + nodeConfig.isAnotherNode("Basic MTcyLjAuMC40OmtCTmhkWVFvbzhXNUphZ2g4T1N4Zmp6Mzl1ND0=", "172.0.0.1"); Assert.assertFalse(isAnotherNode); } @Test public void Given_Different_Ip_Then_Is_Another_Node_Returns_True() { - Boolean isAnotherNode = nodeConfig.isAnotherNode("Basic MTcyLjAuMC40OmtCTmhkWVFvbzhXNUphZ2g4T1N4Zmp6Mzl1ND0=", "172.0.0.4"); + Boolean isAnotherNode = + nodeConfig.isAnotherNode("Basic MTcyLjAuMC40OmtCTmhkWVFvbzhXNUphZ2g4T1N4Zmp6Mzl1ND0=", "172.0.0.4"); Assert.assertTrue(isAnotherNode); } -- cgit 1.2.3-korg