From 3ecc2cf6cb382e367f9454b61c036ded74c10be8 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 12 Apr 2017 15:02:54 +0200 Subject: [PATCH] DATACOUCH-293 - Adapt to API changes in Reactor 3.1. Related ticket: spring-projects/spring-data-build#333 --- .../support/SimpleReactiveCouchbaseRepository.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java b/src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java index e6a8af30..09b61cb3 100644 --- a/src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java +++ b/src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java @@ -41,6 +41,7 @@ import reactor.core.publisher.Mono; * Reactive repository base implementation for Couchbase. * * @author Subhashni Balakrishnan + * @author Mark Paluch * @since 3.0 */ public class SimpleReactiveCouchbaseRepository implements ReactiveCouchbaseRepository { @@ -131,8 +132,8 @@ public class SimpleReactiveCouchbaseRepository imple @Override public Mono findOne(Mono mono) { Assert.notNull(mono, "The given mono must not be null!"); - return mono.then( - id -> findOne(id)); + return mono.flatMap( + this::findOne); } @SuppressWarnings("unchecked") @@ -145,8 +146,8 @@ public class SimpleReactiveCouchbaseRepository imple @SuppressWarnings("unchecked") @Override public Mono exists(Mono mono) { - return mono.then( - id -> exists(id)); + return mono.flatMap( + this::exists); } @SuppressWarnings("unchecked")