/** * asserts that a multiple output task has generated the given number of output files * * @return * @throws IOException */ public TaskTestContext assertOutputSize(int size) throws IOException { if (size == 0) { return assertEmptyMultipleOutput(); } requireMultipleOutputs(); String[] files = fileOutput.list(); assertEquals("An unexpected number of output files has been created: " + StringUtils.join(files, ","), size, files.length); assertEquals("Some output file is hidden", size, Files.list(fileOutput.toPath()).filter(p -> { if (IS_OS_WINDOWS) { try { return !(Boolean) Files.getAttribute(p, "dos:hidden"); } catch (Exception e) { e.printStackTrace(); } return false; } return true; }).count()); return this; }