DATAES-909 - Polishing.

This commit is contained in:
Peter-Josef Meisch 2020-08-20 06:27:50 +02:00
parent 0208bffc0a
commit a62e8af14f
No known key found for this signature in database
GPG Key ID: DE108246970C7708
3 changed files with 8 additions and 7 deletions

View File

@ -15,7 +15,6 @@
*/ */
package org.springframework.data.elasticsearch.core; package org.springframework.data.elasticsearch.core;
import org.springframework.data.elasticsearch.core.query.UpdateResponse;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono; 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.BulkOptions;
import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.Query;
import org.springframework.data.elasticsearch.core.query.UpdateQuery; import org.springframework.data.elasticsearch.core.query.UpdateQuery;
import org.springframework.data.elasticsearch.core.query.UpdateResponse;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
@ -103,8 +103,8 @@ public interface ReactiveDocumentOperations {
} }
/** /**
* Index entities in the given {@literal index}. If the {@literal index} is * Index entities in the given {@literal index}. If the {@literal index} is {@literal null} or empty the index name
* {@literal null} or empty the index name provided via entity metadata is used. * provided via entity metadata is used.
* *
* @param entities must not be {@literal null}. * @param entities must not be {@literal null}.
* @param index the target index, must not be {@literal null} * @param index the target index, must not be {@literal null}
@ -129,8 +129,8 @@ public interface ReactiveDocumentOperations {
<T> Flux<T> saveAll(Mono<? extends Collection<? extends T>> entities, Class<T> clazz); <T> Flux<T> saveAll(Mono<? extends Collection<? extends T>> entities, Class<T> clazz);
/** /**
* Index entities in the given {@literal index}. If the {@literal index} is * Index entities in the given {@literal index}. If the {@literal index} is {@literal null} or empty the index name
* {@literal null} or empty the index name provided via entity metadata is used. * provided via entity metadata is used.
* *
* @param entities must not be {@literal null}. * @param entities must not be {@literal null}.
* @param index the target index, must not be {@literal null} * @param index the target index, must not be {@literal null}

View File

@ -528,6 +528,7 @@ public class ReactiveElasticsearchTemplate implements ReactiveElasticsearchOpera
@Override @Override
public Mono<UpdateResponse> update(UpdateQuery updateQuery, IndexCoordinates index) { public Mono<UpdateResponse> update(UpdateQuery updateQuery, IndexCoordinates index) {
Assert.notNull(updateQuery, "UpdateQuery must not be null"); Assert.notNull(updateQuery, "UpdateQuery must not be null");
Assert.notNull(index, "Index must not be null"); Assert.notNull(index, "Index must not be null");

View File

@ -977,8 +977,8 @@ public class ReactiveElasticsearchTemplateTests {
.as(StepVerifier::create) // .as(StepVerifier::create) //
.expectNextMatches(foundEntity -> foundEntity.getMessage().equals("updated")) // .expectNextMatches(foundEntity -> foundEntity.getMessage().equals("updated")) //
.verifyComplete(); .verifyComplete();
} }
@Test // DATAES-908 @Test // DATAES-908
void shouldFillVersionOnSaveOne() { void shouldFillVersionOnSaveOne() {
VersionedEntity saved = template.save(new VersionedEntity()).block(); VersionedEntity saved = template.save(new VersionedEntity()).block();