### Question:
MonitorUtil { public static String getLocation(ClientContext context) throws KeeperException, InterruptedException { return getLocation( new ZooReader(context.getZooKeepers(), context.getZooKeepersSessionTimeOut()), context); }  static String getLocation(ClientContext context);  }### Answer:
@Test public void testNodeFound() throws Exception { expect(zr.getData("/root" + Constants.ZMONITOR_HTTP_ADDR, null)) .andReturn("http: replay(zr, context); assertEquals("http: }
@Test public void testNoNodeFound() throws Exception { expect(zr.getData("/root" + Constants.ZMONITOR_HTTP_ADDR, null)) .andThrow(new NoNodeException()); replay(zr, context); assertNull(MonitorUtil.getLocation(zr, context)); }