sul-dlss / wasapi-downloader

Java application to download WARCs from WASAPI
Other
6 stars 4 forks source link

tests: refactor TestWasapiDownloader_DownloadAndValidateFile for readability #105

Open ndushay opened 7 years ago

ndushay commented 7 years ago

refactor to WasapiDownloader.getWasapiCrawlSelector() method

(e.g. instead of inline, make this a private method:

List<Integer> desiredCrawlIds = new ArrayList<Integer>();
desiredCrawlIds.add(Integer.valueOf("666"));
PowerMockito.when(mockCrawlSelector.getSelectedCrawlIds(0)).thenReturn(desiredCrawlIds);
PowerMockito.whenNew(WasapiCrawlSelector.class).withArguments(wasapiRespList).thenReturn(mockCrawlSelector)

maybe something similar with