#297 - Upgraded to Boot 2.0 and Spring Data Kay.
Bumped version number to 2.0. Upgraded to Spring Boot 2.0. Stuff disabled in the meantime: - Cassandra: needs API adaptions in configuration - JPA > Security: test fails with weird Hibernate error - Redis > Reactive: API updates needed - Solr: configration updates necessary adjust versions Updated elastic search to the new version. Fixed the reactor version to Bismuth-BUILD-SNAPSHOT. This probably should be undone when boot references the proper bom.
This commit is contained in:
@@ -18,8 +18,8 @@ package example.springdata.mongodb.people;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.data.mongodb.repository.InfiniteStream;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.mongodb.repository.Tailable;
|
||||
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
|
||||
|
||||
/**
|
||||
@@ -70,6 +70,6 @@ public interface ReactivePersonRepository extends ReactiveCrudRepository<Person,
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@InfiniteStream
|
||||
@Tailable
|
||||
Flux<Person> findWithTailableCursorBy();
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ package example.springdata.mongodb.people;
|
||||
import rx.Observable;
|
||||
import rx.Single;
|
||||
|
||||
import org.springframework.data.mongodb.repository.InfiniteStream;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.data.mongodb.repository.Tailable;
|
||||
import org.springframework.data.repository.reactive.RxJava1CrudRepository;
|
||||
|
||||
/**
|
||||
@@ -70,6 +70,6 @@ public interface RxJava1PersonRepository extends RxJava1CrudRepository<Person, S
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@InfiniteStream
|
||||
@Tailable
|
||||
Observable<Person> findWithTailableCursorBy();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class ReactiveMongoTemplateIntegrationTest {
|
||||
.last() //
|
||||
.flatMap(v -> template.count(new Query(), Person.class)) //
|
||||
.doOnNext(System.out::println) //
|
||||
.doOnComplete(countDownLatch::countDown) //
|
||||
.doOnSuccess(it -> countDownLatch.countDown()) //
|
||||
.doOnError(throwable -> countDownLatch.countDown()) //
|
||||
.subscribe();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ package example.springdata.mongodb.people;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import reactor.core.Cancellation;
|
||||
import reactor.core.Disposable;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ReactivePersonRepositoryIntegrationTest {
|
||||
.block();
|
||||
|
||||
repository
|
||||
.save(Flux.just(new Person("Walter", "White", 50), //
|
||||
.saveAll(Flux.just(new Person("Walter", "White", 50), //
|
||||
new Person("Skyler", "White", 45), //
|
||||
new Person("Saul", "Goodman", 42), //
|
||||
new Person("Jesse", "Pinkman", 27))) //
|
||||
@@ -74,12 +74,12 @@ public class ReactivePersonRepositoryIntegrationTest {
|
||||
|
||||
repository.count() //
|
||||
.doOnNext(System.out::println) //
|
||||
.thenMany(repository.save(Flux.just(new Person("Hank", "Schrader", 43), //
|
||||
.thenMany(repository.saveAll(Flux.just(new Person("Hank", "Schrader", 43), //
|
||||
new Person("Mike", "Ehrmantraut", 62)))) //
|
||||
.last() //
|
||||
.flatMap(v -> repository.count()) //
|
||||
.doOnNext(System.out::println) //
|
||||
.doOnComplete(countDownLatch::countDown) //
|
||||
.doOnSuccess(it -> countDownLatch.countDown()) //
|
||||
.doOnError(throwable -> countDownLatch.countDown()) //
|
||||
.subscribe();
|
||||
|
||||
@@ -109,7 +109,7 @@ public class ReactivePersonRepositoryIntegrationTest {
|
||||
@Test
|
||||
public void shouldStreamDataWithTailableCursor() throws Exception {
|
||||
|
||||
Cancellation cancellation = repository.findWithTailableCursorBy() //
|
||||
Disposable disposable = repository.findWithTailableCursorBy() //
|
||||
.doOnNext(System.out::println) //
|
||||
.doOnComplete(() -> System.out.println("Complete")) //
|
||||
.doOnTerminate(() -> System.out.println("Terminated")) //
|
||||
@@ -123,7 +123,7 @@ public class ReactivePersonRepositoryIntegrationTest {
|
||||
repository.save(new Person("Mike", "Ehrmantraut", 62)).subscribe();
|
||||
Thread.sleep(100);
|
||||
|
||||
cancellation.dispose();
|
||||
disposable.dispose();
|
||||
|
||||
repository.save(new Person("Gus", "Fring", 53)).subscribe();
|
||||
Thread.sleep(100);
|
||||
|
||||
@@ -59,7 +59,7 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
.block();
|
||||
|
||||
repository
|
||||
.save(Observable.just(new Person("Walter", "White", 50), //
|
||||
.saveAll(Observable.just(new Person("Walter", "White", 50), //
|
||||
new Person("Skyler", "White", 45), //
|
||||
new Person("Saul", "Goodman", 42), //
|
||||
new Person("Jesse", "Pinkman", 27))) //
|
||||
@@ -75,11 +75,13 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
|
||||
CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
|
||||
Observable<Person> people = Observable.just(new Person("Hank", "Schrader", 43), //
|
||||
new Person("Mike", "Ehrmantraut", 62));
|
||||
|
||||
repository.count() //
|
||||
.doOnSuccess(System.out::println) //
|
||||
.toObservable() //
|
||||
.switchMap(count -> repository.save(Observable.just(new Person("Hank", "Schrader", 43), //
|
||||
new Person("Mike", "Ehrmantraut", 62)))) //
|
||||
.switchMap(count -> repository.saveAll(people)) //
|
||||
.last() //
|
||||
.toSingle() //
|
||||
.flatMap(v -> repository.count()) //
|
||||
|
||||
Reference in New Issue
Block a user