Skip to content

Commit b527cbf

Browse files
committed
spring-projects#291 - Upgraded to Spring Boot 1.5.6.
Upgraded to Boot 1.5.6. Updated dependencies of reactive projects to latest versions to make sure the APIs of Boot work with the changes in Spring Data Kay RC1. Upgraded all other dependencies to match and got both the Redis and the Cassandra examples to compile again. Disabled Cassandra reactive samples for now as they fail at runtime.
1 parent 013058d commit b527cbf

File tree

13 files changed

+58
-66
lines changed

13 files changed

+58
-66
lines changed

cassandra/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<module>util</module>
2121
<module>example</module>
2222
<module>java8</module>
23-
<module>reactive</module>
23+
<!--<module>reactive</module>-->
2424
</modules>
2525

2626
<dependencies>

cassandra/reactive/pom.xml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<name>Spring Data Cassandra - Reactive features</name>
1313

1414
<properties>
15-
<spring-data-releasetrain.version>Kay-M1</spring-data-releasetrain.version>
16-
<spring.version>5.0.0.M3</spring.version>
17-
<reactor.version>3.0.3.RELEASE</reactor.version>
18-
<rxjava.version>1.2.1</rxjava.version>
19-
<rxjava-reactive-streams.version>1.2.0</rxjava-reactive-streams.version>
15+
<spring-data-releasetrain.version>Kay-RC2</spring-data-releasetrain.version>
16+
<spring.version>5.0.0.RC3</spring.version>
17+
<reactor.version>3.1.0.M3</reactor.version>
18+
<rxjava.version>2.1.3</rxjava.version>
19+
<rxjava-reactive-streams.version>1.2.1</rxjava-reactive-streams.version>
2020
</properties>
2121

2222
<dependencies>
@@ -26,11 +26,6 @@
2626
<artifactId>spring-data-commons</artifactId>
2727
</dependency>
2828

29-
<dependency>
30-
<groupId>org.springframework.data</groupId>
31-
<artifactId>spring-cql</artifactId>
32-
</dependency>
33-
3429
<dependency>
3530
<groupId>org.springframework.data</groupId>
3631
<artifactId>spring-data-cassandra</artifactId>
@@ -42,7 +37,7 @@
4237
</dependency>
4338

4439
<dependency>
45-
<groupId>io.reactivex</groupId>
40+
<groupId>io.reactivex.rxjava2</groupId>
4641
<artifactId>rxjava</artifactId>
4742
<version>${rxjava.version}</version>
4843
</dependency>

cassandra/reactive/src/main/java/example/springdata/cassandra/people/ApplicationConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 the original author or authors.
2+
* Copyright 2016-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
1616
package example.springdata.cassandra.people;
1717

1818
import org.springframework.boot.autoconfigure.SpringBootApplication;
19+
import org.springframework.data.cassandra.config.AbstractReactiveCassandraConfiguration;
1920
import org.springframework.data.cassandra.config.SchemaAction;
20-
import org.springframework.data.cassandra.config.java.AbstractReactiveCassandraConfiguration;
2121
import org.springframework.data.cassandra.repository.config.EnableReactiveCassandraRepositories;
2222

2323
/**

cassandra/reactive/src/main/java/example/springdata/cassandra/people/Person.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 the original author or authors.
2+
* Copyright 2016-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
1919
import lombok.Data;
2020
import lombok.NoArgsConstructor;
2121

22-
import org.springframework.cassandra.core.PrimaryKeyType;
23-
import org.springframework.data.cassandra.mapping.PrimaryKeyColumn;
24-
import org.springframework.data.cassandra.mapping.Table;
22+
import org.springframework.data.cassandra.core.cql.PrimaryKeyType;
23+
import org.springframework.data.cassandra.core.mapping.PrimaryKeyColumn;
24+
import org.springframework.data.cassandra.core.mapping.Table;
2525

2626
/**
2727
* An entity to represent a Person.

cassandra/reactive/src/main/java/example/springdata/cassandra/people/RxJava1PersonRepository.java renamed to cassandra/reactive/src/main/java/example/springdata/cassandra/people/RxJava2PersonRepository.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 the original author or authors.
2+
* Copyright 2016-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,18 +15,18 @@
1515
*/
1616
package example.springdata.cassandra.people;
1717

18-
import rx.Observable;
19-
import rx.Single;
18+
import io.reactivex.Observable;
19+
import io.reactivex.Single;
2020

2121
import org.springframework.data.cassandra.repository.Query;
22-
import org.springframework.data.repository.reactive.RxJava1CrudRepository;
22+
import org.springframework.data.repository.reactive.RxJava2CrudRepository;
2323

2424
/**
2525
* Repository interface to manage {@link Person} instances.
2626
*
2727
* @author Mark Paluch
2828
*/
29-
public interface RxJava1PersonRepository extends RxJava1CrudRepository<Person, String> {
29+
public interface RxJava2PersonRepository extends RxJava2CrudRepository<Person, String> {
3030

3131
/**
3232
* Derived query selecting by {@code lastname}.

cassandra/reactive/src/test/java/example/springdata/cassandra/people/ReactiveCassandraTemplateIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 the original author or authors.
2+
* Copyright 2016-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,7 +77,7 @@ public void shouldInsertAndCountData() throws Exception {
7777
.last() //
7878
.flatMap(v -> template.count(Person.class)) //
7979
.doOnNext(System.out::println) //
80-
.doOnComplete(countDownLatch::countDown) //
80+
.doOnSuccess(it -> countDownLatch.countDown()) //
8181
.doOnError(throwable -> countDownLatch.countDown()) //
8282
.subscribe();
8383

cassandra/reactive/src/test/java/example/springdata/cassandra/people/ReactivePersonRepositoryIntegrationTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 the original author or authors.
2+
* Copyright 2016-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public class ReactivePersonRepositoryIntegrationTest {
5252
public void setUp() {
5353

5454
repository.deleteAll() //
55-
.thenMany(repository.save(Flux.just(new Person("Walter", "White", 50), //
55+
.thenMany(repository.saveAll(Flux.just(new Person("Walter", "White", 50), //
5656
new Person("Skyler", "White", 45), //
5757
new Person("Saul", "Goodman", 42), //
5858
new Person("Jesse", "Pinkman", 27))))
@@ -70,12 +70,12 @@ public void shouldInsertAndCountData() throws Exception {
7070

7171
repository.count() //
7272
.doOnNext(System.out::println) //
73-
.thenMany(repository.save(Flux.just(new Person("Hank", "Schrader", 43), //
73+
.thenMany(repository.saveAll(Flux.just(new Person("Hank", "Schrader", 43), //
7474
new Person("Mike", "Ehrmantraut", 62)))) //
7575
.last() //
7676
.flatMap(v -> repository.count()) //
7777
.doOnNext(System.out::println) //
78-
.doOnComplete(countDownLatch::countDown) //
78+
.doOnSuccess(it -> countDownLatch.countDown()) //
7979
.doOnError(throwable -> countDownLatch.countDown()) //
8080
.subscribe();
8181

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 the original author or authors.
2+
* Copyright 2016-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,9 +18,9 @@
1818
import static org.assertj.core.api.Assertions.*;
1919

2020
import example.springdata.cassandra.util.CassandraKeyspace;
21-
import rx.Completable;
22-
import rx.Observable;
23-
import rx.Single;
21+
import io.reactivex.Completable;
22+
import io.reactivex.Flowable;
23+
import io.reactivex.Single;
2424

2525
import java.util.List;
2626
import java.util.concurrent.CountDownLatch;
@@ -35,32 +35,32 @@
3535
import org.springframework.test.context.junit4.SpringRunner;
3636

3737
/**
38-
* Integration test for {@link RxJava1PersonRepository} using RxJava1 types. Note that
38+
* Integration test for {@link RxJava2PersonRepository} using RxJava1 types. Note that
3939
* {@link ReactiveCassandraOperations} is only available using Project Reactor types as the native Template API
4040
* implementation does not come in multiple reactive flavors.
4141
*
4242
* @author Mark Paluch
4343
*/
4444
@RunWith(SpringRunner.class)
4545
@SpringBootTest
46-
public class RxJava1PersonRepositoryIntegrationTest {
46+
public class RxJava2PersonRepositoryIntegrationTest {
4747

4848
@ClassRule public final static CassandraKeyspace CASSANDRA_KEYSPACE = CassandraKeyspace.onLocalhost();
4949

50-
@Autowired RxJava1PersonRepository repository;
50+
@Autowired RxJava2PersonRepository repository;
5151
@Autowired ReactiveCassandraOperations operations;
5252

5353
@Before
5454
public void setUp() throws Exception {
5555

5656
Completable deleteAll = repository.deleteAll();
5757

58-
Observable<Person> save = repository.save(Observable.just(new Person("Walter", "White", 50), //
58+
Flowable<Person> save = repository.saveAll(Flowable.just(new Person("Walter", "White", 50), //
5959
new Person("Skyler", "White", 45), //
6060
new Person("Saul", "Goodman", 42), //
6161
new Person("Jesse", "Pinkman", 27)));
6262

63-
deleteAll.andThen(save).toBlocking().last();
63+
deleteAll.andThen(save).blockingLast();
6464
}
6565

6666
/**
@@ -73,10 +73,10 @@ public void shouldInsertAndCountData() throws Exception {
7373

7474
repository.count() //
7575
.doOnSuccess(System.out::println) //
76-
.toObservable() //
77-
.switchMap(count -> repository.save(Observable.just(new Person("Hank", "Schrader", 43), //
76+
.toFlowable() //
77+
.switchMap(count -> repository.saveAll(Flowable.just(new Person("Hank", "Schrader", 43), //
7878
new Person("Mike", "Ehrmantraut", 62)))) //
79-
.last() //
79+
.lastElement() //
8080
.toSingle() //
8181
.flatMap(v -> repository.count()) //
8282
.doOnSuccess(System.out::println) //
@@ -98,7 +98,7 @@ public void shouldPerformConversionBeforeResultProcessing() throws Exception {
9898

9999
repository.findAll() //
100100
.doOnNext(System.out::println) //
101-
.doOnCompleted(countDownLatch::countDown) //
101+
.doOnEach(it -> countDownLatch.countDown()) //
102102
.doOnError(throwable -> countDownLatch.countDown()) //
103103
.subscribe();
104104

@@ -113,8 +113,7 @@ public void shouldQueryDataWithQueryDerivation() {
113113

114114
List<Person> whites = repository.findByLastname("White") //
115115
.toList() //
116-
.toBlocking() //
117-
.last();
116+
.blockingGet();
118117

119118
assertThat(whites).hasSize(2);
120119
}
@@ -126,8 +125,7 @@ public void shouldQueryDataWithQueryDerivation() {
126125
public void shouldQueryDataWithStringQuery() {
127126

128127
Person heisenberg = repository.findByFirstnameAndLastname("Walter", "White") //
129-
.toBlocking() //
130-
.value();
128+
.blockingGet();
131129

132130
assertThat(heisenberg).isNotNull();
133131
}
@@ -140,8 +138,7 @@ public void shouldQueryDataWithDeferredQueryDerivation() {
140138

141139
List<Person> whites = repository.findByLastname(Single.just("White")) //
142140
.toList() //
143-
.toBlocking() //
144-
.single();
141+
.blockingGet();
145142

146143
assertThat(whites).hasSize(2);
147144
}
@@ -153,7 +150,7 @@ public void shouldQueryDataWithDeferredQueryDerivation() {
153150
public void shouldQueryDataWithMixedDeferredQueryDerivation() {
154151

155152
Person heisenberg = repository.findByFirstnameAndLastname(Single.just("Walter"), "White") //
156-
.toBlocking().value();
153+
.blockingGet();
157154

158155
assertThat(heisenberg).isNotNull();
159156
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<parent>
1313
<groupId>org.springframework.boot</groupId>
1414
<artifactId>spring-boot-starter-parent</artifactId>
15-
<version>1.5.4.RELEASE</version>
15+
<version>1.5.6.RELEASE</version>
1616
</parent>
1717

1818
<modules>

redis/reactive/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
</parent>
1414

1515
<properties>
16-
<spring-data-releasetrain.version>Kay-M1</spring-data-releasetrain.version>
17-
<spring.version>5.0.0.M3</spring.version>
18-
<reactor.version>3.0.3.RELEASE</reactor.version>
19-
<lettuce.version>5.0.0.Beta1</lettuce.version>
16+
<spring-data-releasetrain.version>Kay-RC2</spring-data-releasetrain.version>
17+
<spring.version>5.0.0.RC3</spring.version>
18+
<reactor.version>3.1.0.M3</reactor.version>
19+
<lettuce.version>5.0.0.RC1</lettuce.version>
2020
</properties>
2121

2222
<dependencies>
@@ -32,8 +32,8 @@
3232
</dependency>
3333

3434
<dependency>
35-
<groupId>biz.paluch.redis</groupId>
36-
<artifactId>lettuce</artifactId>
35+
<groupId>io.lettuce</groupId>
36+
<artifactId>lettuce-core</artifactId>
3737
<version>${lettuce.version}</version>
3838
</dependency>
3939

0 commit comments

Comments
 (0)