@Test
public void testInternalNameService() throws Exception {

  Configuration conf = new Configuration();
  conf.set(DFSConfigKeys.DFS_NAMESERVICES, "ns1,ns2,ns3");
  addNN(conf, "ns1", "mock1:8020");
  addNN(conf, "ns2", "mock1:8020");
  addNN(conf, "ns3", "mock1:8020");
  conf.set(DFSConfigKeys.DFS_INTERNAL_NAMESERVICES_KEY, "ns1");
  bpm.refreshNamenodes(conf);
  assertEquals("create #1\n", log.toString());
  @SuppressWarnings("unchecked")
  Map<String, BPOfferService> map = (Map<String, BPOfferService>) Whitebox
          .getInternalState(bpm, "bpByNameserviceId");
  Assert.assertFalse(map.containsKey("ns2"));
  Assert.assertFalse(map.containsKey("ns3"));
  Assert.assertTrue(map.containsKey("ns1"));
  log.setLength(0);
}