#297 - Upgraded samples for Spring Data for Cassandra to Kay.

Adapt to changed API. Migrate tests to use AssertJ. Re-enable Cassandra examples. Adapt Cassandra examples to relocated packages. Adapt reactive Cassandra examples to removed insert(Publisher) method.

Exclude the reporter-config3 library from cassandra-all as it pulls in an outdated hibernate-validator version 4.3.0 that conflicts with Spring Boot's Hibernate Validator baseline and it's not required during tests because we don't publish any metrics.
This commit is contained in:
Mark Paluch
2017-05-05 11:40:49 +02:00
committed by Oliver Gierke
parent 5d34f0a00d
commit d319758bef
27 changed files with 132 additions and 171 deletions

View File

@@ -73,13 +73,13 @@ public class ReactiveCassandraTemplateIntegrationTest {
template.count(Person.class) //
.doOnNext(System.out::println) //
.thenMany(template.insert(Flux.just(new Person("Hank", "Schrader", 43), //
new Person("Mike", "Ehrmantraut", 62)))) //
.thenMany(Flux.just(new Person("Hank", "Schrader", 43), //
new Person("Mike", "Ehrmantraut", 62)))
.flatMap(template::insert) //
.last() //
.flatMap(v -> template.count(Person.class)) //
.doOnNext(System.out::println) //
.doOnSuccess(it -> countDownLatch.countDown()) //
.doOnError(throwable -> countDownLatch.countDown()) //
.doOnTerminate((i, t) -> countDownLatch.countDown()) //
.subscribe();
countDownLatch.await();

View File

@@ -75,8 +75,7 @@ public class ReactivePersonRepositoryIntegrationTest {
.last() //
.flatMap(v -> repository.count()) //
.doOnNext(System.out::println) //
.doOnSuccess(it -> countDownLatch.countDown()) //
.doOnError(throwable -> countDownLatch.countDown()) //
.doOnTerminate((l, t) -> countDownLatch.countDown()) //
.subscribe();
countDownLatch.await();

View File

@@ -55,7 +55,7 @@ public class RxJava2PersonRepositoryIntegrationTest {
Completable deleteAll = repository.deleteAll();
Flowable<Person> save = repository.saveAll(Flowable.just(new Person("Walter", "White", 50), //
Observable<Person> save = repository.saveAll(Observable.just(new Person("Walter", "White", 50), //
new Person("Skyler", "White", 45), //
new Person("Saul", "Goodman", 42), //
new Person("Jesse", "Pinkman", 27)));
@@ -73,15 +73,14 @@ public class RxJava2PersonRepositoryIntegrationTest {
repository.count() //
.doOnSuccess(System.out::println) //
.toFlowable() //
.switchMap(count -> repository.saveAll(Flowable.just(new Person("Hank", "Schrader", 43), //
.toObservable() //
.switchMap(count -> repository.saveAll(Observable.just(new Person("Hank", "Schrader", 43), //
new Person("Mike", "Ehrmantraut", 62)))) //
.lastElement() //
.toSingle() //
.flatMap(v -> repository.count()) //
.doOnSuccess(System.out::println) //
.doAfterTerminate(countDownLatch::countDown) //
.doOnError(throwable -> countDownLatch.countDown()) //
.subscribe();
countDownLatch.await();