@Test
public void databaseIsUsedIfDataIsPresent() {
ExternalISBNDataService databaseService = mock(ExternalISBNDataService.class);
ExternalISBNDataService webService = mock(ExternalISBNDataService.class);
when(databaseService.lookup("0140177396")).thenReturn(new Book("0140177396","abc","abc"));
StockManager stockManager = new StockManager();
stockManager.setWebService(webService);
stockManager.setDatabaseService(databaseService);
String isbn = "0140177396";
String locatorCode = stockManager.getLocatorCode(isbn);
verify(databaseService).lookup("0140177396");
verify(webService, never()).lookup(anyString());
}