MesosZKFormatter extends AbstractZKFormatter { public String format(String zkUrl) { parser.validateZkUrl(zkUrl); return zkUrl; } MesosZKFormatter(ZKAddressParser parser); String format(String zkUrl);  }
@Test public void testFormat() { String zkUrl = "zk: when(parser.validateZkUrl(zkUrl)).thenReturn(Collections.singletonList( new ZKAddress("zookeeper:2181") )); String format = formatter.format(zkUrl); assertEquals("zk: }
@Test public void testFormat_nestedPath() { String zkUrl = "zk: when(parser.validateZkUrl(zkUrl)).thenReturn(Collections.singletonList( new ZKAddress("zookeeper:2181") )); String format = formatter.format(zkUrl); assertEquals("zk: }
@Test public void testFormat_threeNodes() { String zkUrl = "zk: when(parser.validateZkUrl(zkUrl)).thenReturn(asList( new ZKAddress("zookeeper1:2181"), new ZKAddress("zookeeper2:2181"), new ZKAddress("zookeeper3:2181") )); String format = formatter.format(zkUrl); assertEquals("zk: }