import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.dmaap.datarouter.node.config.NodeConfig;
+import org.onap.dmaap.datarouter.node.config.ProvData;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
import org.powermock.modules.junit4.PowerMockRunner;
@RunWith(PowerMockRunner.class)
-@SuppressStaticInitializationFor({"org.onap.dmaap.datarouter.node.ProvData",
- "org.onap.dmaap.datarouter.node.NodeUtils"})
+@SuppressStaticInitializationFor({"org.onap.dmaap.datarouter.node.config.ProvData"})
+@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class NodeConfigTest {
private static NodeConfig nodeConfig;
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);
}
@Test
public void Given_Different_Ip_Then_Is_Another_Node_Returns_True() {
Boolean isAnotherNode =
- nodeConfig.isAnotherNode("Basic MTcyLjAuMC40OmtCTmhkWVFvbzhXNUphZ2g4T1N4Zmp6Mzl1ND0=", "172.0.0.4");
+ nodeConfig.isAnotherNode("Basic MTcyLjAuMC40OjlKOEFMUEhWQ2FpZ3FnZFpMMlRMYVRKSE1QQS8wNjdjR2JhV2RaUU1XSG1MNk5KbEtBVmpPbWtoZTR6ZmVlYjJzbElNMVR0REc2b0tYb0dLSDRMa1BBPT0=", "172.0.0.4");
Assert.assertTrue(isAnotherNode);
}
@Test
public void Validate_Get_MyAuth_Returns_Correct_Auth() {
String auth = nodeConfig.getMyAuth();
- Assert.assertEquals("Basic TmFtZTp6Z04wMFkyS3gybFppbXltNy94ZDhuMkdEYjA9", auth);
+ Assert.assertEquals("Basic TmFtZTo3YTRsQkxqMENQQ3lEbVVPaUI5Tks3b0pSeGROVUxqZzNNUHpkcEFYNHcvN09DNVR5S1hhWFA0MGR5aHhzbm90bXM4d1BGeXdHVlQ3MTJhcldXSFR1dz09", auth);
}
}