SearchServerService implements DomainService { public Observable<Server> searchServer() { return networkActionProvider.searchServer(); } @Inject  SearchServerService(NetworkActionProvider networkActionProvider); Observable<Server> searchServer(); Observable<Server> searchServer(NetworkAddress networkAddress);  }
@Test public void shouldSearchServer() throws Exception { searchServerService.searchServer(); verify(mockNetworkActionProvider, times(1)).searchServer(); verifyNoMoreInteractions(mockNetworkActionProvider); }
@Test public void shouldSearchServerForNetworkAddress() throws Exception { NetworkAddress mockNetworkAddress = mock(NetworkAddress.class); searchServerService.searchServer(mockNetworkAddress); verify(mockNetworkActionProvider, times(1)).searchServer(mockNetworkAddress); verifyNoMoreInteractions(mockNetworkActionProvider); }