JpaRecordReader implements RecordReader<T> { public void setMaxResults(final int maxResults) { checkArgument(maxResults >= 1, "max results parameter must be >= 1"); this.maxResults = maxResults; } JpaRecordReader(final EntityManagerFactory entityManagerFactory, final String query, final Class<T> type); @Override void open(); @Override GenericRecord<T> readRecord(); @Override void close(); void setMaxResults(final int maxResults); static final int DEFAULT_MAX_RESULT; }
@Test(expected = IllegalArgumentException.class) public void maxResultsParameterMustBeGreaterThanOrEqualToOne() { jpaRecordReader.setMaxResults(0); }