AvroItemReader implements ItemReader { @Override public synchronized String read() throws Exception { if (this.dataFileReader.hasNext()) { this.record = this.dataFileReader.next(this.record); logger.info(record.toString()); return this.record.toString(); } else { return null; } } AvroItemReader(File inputFile); @Override synchronized String read();  }
@Test public void testRead() throws Exception { this.expectedOutputStream.forEach((String s) -> { try { assertEquals(itemReader.read(), s); } catch (Exception e) { e.printStackTrace(); } }); assertNull(itemReader.read()); }