Code Review
/
dmaap
/
datarouter.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Remove major and minor code smells in dr-node
[dmaap/datarouter.git]
/
datarouter-node
/
src
/
test
/
java
/
org
/
onap
/
dmaap
/
datarouter
/
node
/
NodeConfigTest.java
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
old mode 100755
(executable)
new mode 100644
(file)
index
6350e64
..
5e35737
--- 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
@@
-28,6
+28,7
@@
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
import org.powermock.modules.junit4.PowerMockRunner;
import java.io.IOException;
import org.powermock.modules.junit4.PowerMockRunner;
import java.io.IOException;
@@
-35,6
+36,8
@@
import java.io.Reader;
import java.io.StringReader;
@RunWith(PowerMockRunner.class)
import java.io.StringReader;
@RunWith(PowerMockRunner.class)
+@SuppressStaticInitializationFor({"org.onap.dmaap.datarouter.node.ProvData",
+ "org.onap.dmaap.datarouter.node.NodeUtils"})
public class NodeConfigTest {
private static NodeConfig nodeConfig;
public class NodeConfigTest {
private static NodeConfig nodeConfig;
@@
-70,7
+73,7
@@
public class NodeConfigTest {
}
@Test
}
@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);
}
String feedId = nodeConfig.getFeedId("1");
Assert.assertEquals("1", feedId);
}
@@
-132,13
+135,15
@@
public class NodeConfigTest {
@Test
public void Given_Same_Ip_Then_Is_Another_Node_Returns_False() {
@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() {
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);
}
Assert.assertTrue(isAnotherNode);
}
@@
-191,6
+196,7
@@
public class NodeConfigTest {
endpointAddrs.put("172.0.0.1");
auth.put("endpoint_addrs", endpointAddrs);
feed.put("authorization", auth);
endpointAddrs.put("172.0.0.1");
auth.put("endpoint_addrs", endpointAddrs);
feed.put("authorization", auth);
+ feed.put("aaf_instance", "legacy");
feeds.put(feed);
provData.put("feeds", feeds);
}
feeds.put(feed);
provData.put("feeds", feeds);
}
@@
-208,6
+214,9
@@
public class NodeConfigTest {
delivery.put("password", "password1");
delivery.put("use100", true);
subscription.put("delivery", delivery);
delivery.put("password", "password1");
delivery.put("use100", true);
subscription.put("delivery", delivery);
+ subscription.put("privilegedSubscriber", false);
+ subscription.put("follow_redirect", false);
+ subscription.put("decompress", false);
subscriptions.put(subscription);
provData.put("subscriptions", subscriptions);
}
subscriptions.put(subscription);
provData.put("subscriptions", subscriptions);
}