@Test
public void testGetHaNnHttpAddresses() throws IOException {

  final String LOGICAL_HOST_NAME = "ns1";
  final String NS1_NN1_ADDR      = "ns1-nn1.example.com:8020";
  final String NS1_NN2_ADDR      = "ns1-nn2.example.com:8020";
  Configuration conf = createWebHDFSHAConfiguration(LOGICAL_HOST_NAME, NS1_NN1_ADDR, NS1_NN2_ADDR);
  Map<String, Map<String, InetSocketAddress>> map =
      DFSUtil.getHaNnWebHdfsAddresses(conf, "webhdfs");
  assertEquals(NS1_NN1_ADDR, map.get("ns1").get("nn1").toString());
  assertEquals(NS1_NN2_ADDR, map.get("ns1").get("nn2").toString());
}