JdbcRecordReader implements RecordReader<ResultSet> { @Override public JdbcRecord readRecord() { if (hasNextRecord()) { Header header = new Header(++currentRecordNumber, dataSourceName, LocalDateTime.now()); return new JdbcRecord(header, resultSet); } else { return null; } } JdbcRecordReader(final DataSource dataSource, final String query); @Override void open(); @Override JdbcRecord readRecord(); @Override void close(); void setMaxRows(final int maxRows); void setFetchSize(final int fetchSize); void setQueryTimeout(final int queryTimeout);  }
@Test public void testReadRecord() throws Exception { jdbcRecordReader.open(); JdbcRecord actual = jdbcRecordReader.readRecord(); assertThat(actual).isNotNull(); assertThat(actual.getHeader().getNumber()).isEqualTo(1); ResultSet payload = actual.getPayload(); assertThat(payload.getInt(1)).isEqualTo(1); assertThat(payload.getString(2)).isEqualTo("foo"); assertThat(payload.getString(3)).isEqualTo("easy batch rocks! #EasyBatch"); }