LoggingBulkProcessorListener implements BulkProcessor.Listener { @Override public void beforeBulk(long executionId, BulkRequest request) { if(log.isDebugEnabled()) { log.debug("ExecutionId = {}, Actions = {}, Estimated Size = {}", executionId, request.numberOfActions(), request.estimatedSizeInBytes()); } } LoggingBulkProcessorListener(); @Override void beforeBulk(long executionId, BulkRequest request); @Override void afterBulk(long executionId, BulkRequest request, BulkResponse response); @Override void afterBulk(long executionId, BulkRequest request, Throwable failure);  }
@Test public void before_bulk_does_not_throw_when_called() throws Exception { TestUtils.assertDoesNotThrow(() -> listener.beforeBulk(1, new BulkRequest())); }