Description
class CSVParserSpecification extends Specification { def "TEst CSVParser"() { setup: URL url = new URL("https://....../csv_with_28_lines_header_plus_ 27_records"); BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); def CSVParser parser = CSVFormat.RFC4180.withFirstRecordAsHeader().withIgnoreEmptyLines().withTrim().parse(reader); when: def count = 0 for (CSVRecord record: parser) { println("Processing " + parser.getCurrentLineNumber()) count++ } println(count); parser.close() then: count == 27 } }