@Test public void whenTheDataSourceIsEmpty_ThenThereShouldBeNoNextRecordToRead() { setupEmptyDataSource(); assertThat(stringRecordReader.readRecord()).isNull(); }
@Override public StringRecord readRecord() { Header header = new Header(currentRecordNumber++, getDataSourceName(), LocalDateTime.now()); String payload = scanner.hasNextLine() ? scanner.nextLine() : null; return payload == null ? null : new StringRecord(header, payload); }
StringRecordReader implements RecordReader<String> { @Override public StringRecord readRecord() { Header header = new Header(currentRecordNumber++, getDataSourceName(), LocalDateTime.now()); String payload = scanner.hasNextLine() ? scanner.nextLine() : null; return payload == null ? null : new StringRecord(header, payload); } }
StringRecordReader implements RecordReader<String> { @Override public StringRecord readRecord() { Header header = new Header(currentRecordNumber++, getDataSourceName(), LocalDateTime.now()); String payload = scanner.hasNextLine() ? scanner.nextLine() : null; return payload == null ? null : new StringRecord(header, payload); } StringRecordReader(final String dataSource); }
StringRecordReader implements RecordReader<String> { @Override public StringRecord readRecord() { Header header = new Header(currentRecordNumber++, getDataSourceName(), LocalDateTime.now()); String payload = scanner.hasNextLine() ? scanner.nextLine() : null; return payload == null ? null : new StringRecord(header, payload); } StringRecordReader(final String dataSource); @Override void open(); @Override StringRecord readRecord(); @Override void close(); }
StringRecordReader implements RecordReader<String> { @Override public StringRecord readRecord() { Header header = new Header(currentRecordNumber++, getDataSourceName(), LocalDateTime.now()); String payload = scanner.hasNextLine() ? scanner.nextLine() : null; return payload == null ? null : new StringRecord(header, payload); } StringRecordReader(final String dataSource); @Override void open(); @Override StringRecord readRecord(); @Override void close();  }