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
index
1810817
..
5e35737
100644
(file)
--- 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)
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;
public class NodeConfigTest {
private static NodeConfig nodeConfig;
@@
-72,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);
}
@@
-134,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);
}
@@
-193,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);
}
@@
-210,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);
}