@Test public void shouldWriteItemWhenNoTransactionIsActive() throws Exception { IndexQueryBuilder builder = new IndexQueryBuilder(); builder.withObject(dummyDocument); List<IndexQuery> items = asList(builder.build()); writer.write(items); verify(elasticsearchOperations).index(items.iterator().next()); }
@Override public void write(List<? extends IndexQuery> items) throws Exception { if(isActualTransactionActive()) { addToBuffer(items); }else { writeItems(items); } }
ElasticsearchItemWriter implements ItemWriter<IndexQuery>, InitializingBean { @Override public void write(List<? extends IndexQuery> items) throws Exception { if(isActualTransactionActive()) { addToBuffer(items); }else { writeItems(items); } } }
ElasticsearchItemWriter implements ItemWriter<IndexQuery>, InitializingBean { @Override public void write(List<? extends IndexQuery> items) throws Exception { if(isActualTransactionActive()) { addToBuffer(items); }else { writeItems(items); } } ElasticsearchItemWriter(ElasticsearchOperations elasticsearchOperations); }
ElasticsearchItemWriter implements ItemWriter<IndexQuery>, InitializingBean { @Override public void write(List<? extends IndexQuery> items) throws Exception { if(isActualTransactionActive()) { addToBuffer(items); }else { writeItems(items); } } ElasticsearchItemWriter(ElasticsearchOperations elasticsearchOperations); void setDelete(boolean delete); @Override void afterPropertiesSet(); @Override void write(List<? extends IndexQuery> items); }
ElasticsearchItemWriter implements ItemWriter<IndexQuery>, InitializingBean { @Override public void write(List<? extends IndexQuery> items) throws Exception { if(isActualTransactionActive()) { addToBuffer(items); }else { writeItems(items); } } ElasticsearchItemWriter(ElasticsearchOperations elasticsearchOperations); void setDelete(boolean delete); @Override void afterPropertiesSet(); @Override void write(List<? extends IndexQuery> items);  }