@Test void getShouldThrowWhenIdIsNull() { assertThatThrownBy(() -> testee.get(null, ROUTING).block()) .isInstanceOf(NullPointerException.class); }
public Mono<GetResponse> get(DocumentId id, RoutingKey routingKey) { return Mono.fromRunnable(() -> { Preconditions.checkNotNull(id); Preconditions.checkNotNull(routingKey); }) .then(client.get(new GetRequest(aliasName.getValue()) .type(NodeMappingFactory.DEFAULT_MAPPING_NAME) .id(id.asString()) .routing(routingKey.asString()), RequestOptions.DEFAULT)); }
ElasticSearchIndexer { public Mono<GetResponse> get(DocumentId id, RoutingKey routingKey) { return Mono.fromRunnable(() -> { Preconditions.checkNotNull(id); Preconditions.checkNotNull(routingKey); }) .then(client.get(new GetRequest(aliasName.getValue()) .type(NodeMappingFactory.DEFAULT_MAPPING_NAME) .id(id.asString()) .routing(routingKey.asString()), RequestOptions.DEFAULT)); } }
ElasticSearchIndexer { public Mono<GetResponse> get(DocumentId id, RoutingKey routingKey) { return Mono.fromRunnable(() -> { Preconditions.checkNotNull(id); Preconditions.checkNotNull(routingKey); }) .then(client.get(new GetRequest(aliasName.getValue()) .type(NodeMappingFactory.DEFAULT_MAPPING_NAME) .id(id.asString()) .routing(routingKey.asString()), RequestOptions.DEFAULT)); } ElasticSearchIndexer(ReactorElasticSearchClient client,
                                WriteAliasName aliasName); @VisibleForTesting  ElasticSearchIndexer(ReactorElasticSearchClient client,
                                WriteAliasName aliasName,
                                int batchSize); }
ElasticSearchIndexer { public Mono<GetResponse> get(DocumentId id, RoutingKey routingKey) { return Mono.fromRunnable(() -> { Preconditions.checkNotNull(id); Preconditions.checkNotNull(routingKey); }) .then(client.get(new GetRequest(aliasName.getValue()) .type(NodeMappingFactory.DEFAULT_MAPPING_NAME) .id(id.asString()) .routing(routingKey.asString()), RequestOptions.DEFAULT)); } 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); }
ElasticSearchIndexer { public Mono<GetResponse> get(DocumentId id, RoutingKey routingKey) { return Mono.fromRunnable(() -> { Preconditions.checkNotNull(id); Preconditions.checkNotNull(routingKey); }) .then(client.get(new GetRequest(aliasName.getValue()) .type(NodeMappingFactory.DEFAULT_MAPPING_NAME) .id(id.asString()) .routing(routingKey.asString()), RequestOptions.DEFAULT)); } 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);  }