ElasticSearchIndexer { public Mono<BulkResponse> delete(List<DocumentId> ids, RoutingKey routingKey) { BulkRequest request = new BulkRequest(); ids.forEach(id -> request.add( new DeleteRequest(aliasName.getValue()) .type(NodeMappingFactory.DEFAULT_MAPPING_NAME) .id(id.asString()) .routing(routingKey.asString()))); return client.bulk(request, RequestOptions.DEFAULT) .onErrorResume(ValidationException.class, exception -> { LOGGER.warn("Error while deleting index", exception); return Mono.empty(); }); } ElasticSearchIndexer(ReactorElasticSearchClient client,
                                WriteAliasName aliasName); @VisibleForTesting  ElasticSearchIndexer(ReactorElasticSearchClient client,
                                WriteAliasName aliasName,
                                int batchSize); Mono<IndexResponse> index(DocumentId id, String content, RoutingKey routingKey); Mono<BulkResponse> update(List<UpdatedRepresentation> updatedDocumentParts, RoutingKey routingKey); Mono<BulkResponse> delete(List<DocumentId> ids, RoutingKey routingKey); Mono<Void> deleteAllMatchingQuery(QueryBuilder queryBuilder, RoutingKey routingKey); Mono<GetResponse> get(DocumentId id, RoutingKey routingKey);  }
@Test void deleteMessagesShouldNotThrowWhenEmptyList() { assertThatCode(() -> testee.delete(ImmutableList.of(), ROUTING).block()) .doesNotThrowAnyException(); }