@Test public void testCheckFilesExistsWithPairsWhenThereAreSomeSearchResultButOneRequestDoesntHavePair() { List<String> list = new ArrayList<>(); list.add("src/test/resources/first_testreq.txt"); list.add("src/test/resources/second_testreq.txt"); List<List<String>> expected = new ArrayList<>(); List<String> pair = new ArrayList<>(); pair.add("src/test/resources/first_testreq.txt"); pair.add("src/test/resources/first_testresp.txt"); expected.add(pair); pair = new ArrayList<>(); pair.add("src/test/resources/second_testreq.txt"); pair.add("src/test/resources/second_testresp.txt" + ERROR_POSTFIX); expected.add(pair); List<List<String>> result = underTest.checkFilesExistsWithPairs(list); Assert.assertEquals(result, expected); }
public List<List<String>> checkFilesExistsWithPairs(final List<String> searchResult) { List<List<String>> result = new ArrayList<>(); for (String actualFile : searchResult) { List<String> actualPair = new ArrayList<>(); markFileIfNotExists(actualFile, actualPair); String pairFile = getPair(actualFile); markFileIfNotExists(pairFile, actualPair); result.add(actualPair); } return result; }
FileChecker { public List<List<String>> checkFilesExistsWithPairs(final List<String> searchResult) { List<List<String>> result = new ArrayList<>(); for (String actualFile : searchResult) { List<String> actualPair = new ArrayList<>(); markFileIfNotExists(actualFile, actualPair); String pairFile = getPair(actualFile); markFileIfNotExists(pairFile, actualPair); result.add(actualPair); } return result; } }
FileChecker { public List<List<String>> checkFilesExistsWithPairs(final List<String> searchResult) { List<List<String>> result = new ArrayList<>(); for (String actualFile : searchResult) { List<String> actualPair = new ArrayList<>(); markFileIfNotExists(actualFile, actualPair); String pairFile = getPair(actualFile); markFileIfNotExists(pairFile, actualPair); result.add(actualPair); } return result; }  }
FileChecker { public List<List<String>> checkFilesExistsWithPairs(final List<String> searchResult) { List<List<String>> result = new ArrayList<>(); for (String actualFile : searchResult) { List<String> actualPair = new ArrayList<>(); markFileIfNotExists(actualFile, actualPair); String pairFile = getPair(actualFile); markFileIfNotExists(pairFile, actualPair); result.add(actualPair); } return result; }  List<List<String>> checkFilesExistsWithPairs(final List<String> searchResult); }
FileChecker { public List<List<String>> checkFilesExistsWithPairs(final List<String> searchResult) { List<List<String>> result = new ArrayList<>(); for (String actualFile : searchResult) { List<String> actualPair = new ArrayList<>(); markFileIfNotExists(actualFile, actualPair); String pairFile = getPair(actualFile); markFileIfNotExists(pairFile, actualPair); result.add(actualPair); } return result; }  List<List<String>> checkFilesExistsWithPairs(final List<String> searchResult);  }