DubboMonitor implements Monitor { @Override public List<URL> lookup(URL query) { return monitorService.lookup(query); } DubboMonitor(Invoker<MonitorService> monitorInvoker, MonitorService monitorService); void send(); @Override void collect(URL url); @Override List<URL> lookup(URL query); @Override URL getUrl(); @Override boolean isAvailable(); @Override void destroy();  }
@Test public void testLookUp() { Invoker invoker = mock(Invoker.class); MonitorService monitorService = mock(MonitorService.class); URL queryUrl = URL.valueOf("dubbo: given(invoker.getUrl()).willReturn(queryUrl); DubboMonitor dubboMonitor = new DubboMonitor(invoker, monitorService); dubboMonitor.lookup(queryUrl); verify(monitorService).lookup(eq(queryUrl)); }