From a62e8af14ff9f0356fd46682608f178070163462 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 20 Aug 2020 06:27:50 +0200 Subject: [PATCH] DATAES-909 - Polishing. --- .../elasticsearch/core/ReactiveDocumentOperations.java | 10 +++++----- .../core/ReactiveElasticsearchTemplate.java | 1 + .../core/ReactiveElasticsearchTemplateTests.java | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java index 8bc4e006c..4e4789825 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java @@ -15,7 +15,6 @@ */ package org.springframework.data.elasticsearch.core; -import org.springframework.data.elasticsearch.core.query.UpdateResponse; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -27,6 +26,7 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.query.BulkOptions; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.UpdateQuery; +import org.springframework.data.elasticsearch.core.query.UpdateResponse; import org.springframework.util.Assert; /** @@ -103,8 +103,8 @@ public interface ReactiveDocumentOperations { } /** - * Index entities in the given {@literal index}. If the {@literal index} is - * {@literal null} or empty the index name provided via entity metadata is used. + * Index entities in the given {@literal index}. If the {@literal index} is {@literal null} or empty the index name + * provided via entity metadata is used. * * @param entities must not be {@literal null}. * @param index the target index, must not be {@literal null} @@ -129,8 +129,8 @@ public interface ReactiveDocumentOperations { Flux saveAll(Mono> entities, Class clazz); /** - * Index entities in the given {@literal index}. If the {@literal index} is - * {@literal null} or empty the index name provided via entity metadata is used. + * Index entities in the given {@literal index}. If the {@literal index} is {@literal null} or empty the index name + * provided via entity metadata is used. * * @param entities must not be {@literal null}. * @param index the target index, must not be {@literal null} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java index 86d541f7c..0064f03ef 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java @@ -528,6 +528,7 @@ public class ReactiveElasticsearchTemplate implements ReactiveElasticsearchOpera @Override public Mono update(UpdateQuery updateQuery, IndexCoordinates index) { + Assert.notNull(updateQuery, "UpdateQuery must not be null"); Assert.notNull(index, "Index must not be null"); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateTests.java index c66b5f511..a757c0844 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplateTests.java @@ -977,8 +977,8 @@ public class ReactiveElasticsearchTemplateTests { .as(StepVerifier::create) // .expectNextMatches(foundEntity -> foundEntity.getMessage().equals("updated")) // .verifyComplete(); - } - + } + @Test // DATAES-908 void shouldFillVersionOnSaveOne() { VersionedEntity saved = template.save(new VersionedEntity()).block();