ExcelSheetItemReader extends AbstractItemCountingItemStreamItemReader<T> implements
        IndexedResourceAwareItemStreamReader<T>,
        InitializingBean,
        ResourceAwareItemReaderItemStream<T>,
        ResourceAwareItemStreamReader<T> { @Override public T read() throws Exception { T result = null; if (!noInput) { result = super.read(); if (result == null) { noInput = true; } } return result; }  @Override void afterPropertiesSet(); @Override T read(); @Override int getCurrentIndex(); boolean isEof(); @Override void setResource(Resource resource); void setRowMapper(RowMapper<? extends T> rowMapper); void setRowsToSkip(int rowsToSkip); void setSheetIndex(int sheetIndex);  }
@Test public void testRead() throws Exception { reader.open(new ExecutionContext()); List<ExcelRow> result = new ArrayList<>(); for (ExcelRow row = reader.read(); row != null; row = reader.read()) { result.add(row); } Assert.assertTrue(result.stream().anyMatch( row -> "515".equals(row.getEffectiveTrainLine1().getName()) )); reader.close(); }
@Test(expected = ReaderNotOpenException.class) public void testReaderNotOpenException() throws Exception { reader.read(); }