### Question:
ElasticsearchItemReader extends AbstractPaginatedDataItemReader<T> implements InitializingBean { @Override public void afterPropertiesSet() throws Exception { state(elasticsearchOperations != null, "An ElasticsearchOperations implementation is required."); state(query != null, "A query is required."); state(targetType != null, "A target type to convert the input into is required."); } ElasticsearchItemReader(ElasticsearchOperations elasticsearchOperations, SearchQuery query, Class<? extends T> targetType); @Override void afterPropertiesSet();  }### Answer:
@Test(expected=IllegalStateException.class) public void shouldFailAssertionOnNullElasticsearchOperations() throws Exception { try { new ElasticsearchItemReader<Object>(null, null, null).afterPropertiesSet(); fail("Assertion should have thrown exception on null ElasticsearchOperations"); }catch(IllegalStateException e) { assertEquals("An ElasticsearchOperations implementation is required.", e.getMessage()); throw e; } }
@Test(expected=IllegalStateException.class) public void shouldFailAssertionOnNullQuery() throws Exception { try { new ElasticsearchItemReader<Object>(elasticsearchOperations, null, null).afterPropertiesSet(); fail("Assertion shold have thrown exception on null Query"); }catch(IllegalStateException e) { assertEquals("A query is required.", e.getMessage()); throw e; } }
@Test(expected=IllegalStateException.class) public void shouldFailAssertionOnNullTargetType() throws Exception { try { new ElasticsearchItemReader<Object>(elasticsearchOperations, query, null).afterPropertiesSet(); fail("Assertion shold have thrown exception on null Target Type"); }catch(IllegalStateException e) { assertEquals("A target type to convert the input into is required.", e.getMessage()); throw e; } }