AdminService { public SearchResult search(String symbolOrName) throws IOException { final List<UpdatedPair> existingSymbols; final List<LookupInfo> availableSymbols; if (Strings.isNullOrEmpty(symbolOrName)) { existingSymbols = pairService.getAll(); availableSymbols = new ArrayList<>(); } else { existingSymbols = pairService.getAllWithSymbolOrNameContaining(symbolOrName); availableSymbols = lookupService.search(symbolOrName); removeDuplicates(availableSymbols, existingSymbols); } return new SearchResult(existingSymbols, availableSymbols); }  SymbolInfo add(String code, String provider); void delete(String code, String provider); SearchResult search(String symbolOrName);  }
@Test public void testSearch() throws Exception { String symbolOrNameToSearch = ""; String symbol = "UBI.PA"; String name = "Ubi"; String provider = "Provider"; when(lookupService.search(provider)).thenReturn(asList(new LookupInfo(symbol, name, "Paris", "Titres", provider))); when(lookupService.getDetails(symbol, provider)).thenReturn(new LookupDetails(symbol, name, "UBI", "EUR", "EPA", provider)); adminService.search(symbolOrNameToSearch); }