Permalink
Browse files

Update to reactor-core 2.5.0-M4

  • Loading branch information...
sdeleuze committed Jun 9, 2016
1 parent 3f8c252 commit 3a1e82a7f64dafe6d513065500065a191abcd6c7
View
@@ -7,3 +7,4 @@ target/
.project
.classpath
.settings/
.gradle/
View
@@ -20,7 +20,7 @@
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>2.5.0.M3</version>
<version>2.5.0.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
@@ -36,7 +36,7 @@
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.1.1</version>
<version>1.1.5</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -46,6 +46,10 @@
<id>spring-milestone-repository</id>
<url>http://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshot-repository</id>
<url>http://repo.spring.io/snapshot</url>
</repository>
</repositories>
<build>
@@ -18,9 +18,8 @@
@Test
public void empty() {
Flux<String> flux = emptyFlux();
TestSubscriber<String> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.assertValueCount(0)
.assertComplete();
}
@@ -35,9 +34,8 @@ public void empty() {
@Test
public void fromValues() {
Flux<String> flux = fooBarFluxFromValues();
TestSubscriber<String> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.assertValues("foo", "bar")
.assertComplete();
}
@@ -52,9 +50,8 @@ public void fromValues() {
@Test
public void fromList() {
Flux<String> flux = fooBarFluxFromList();
TestSubscriber<String> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.assertValues("foo", "bar")
.assertComplete();
}
@@ -69,9 +66,8 @@ public void fromList() {
@Test
public void error() {
Flux<String> flux = errorFlux();
TestSubscriber<String> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.assertError(IllegalStateException.class)
.assertNotComplete();
}
@@ -86,9 +82,8 @@ public void error() {
@Test
public void neverTerminates() {
Flux<String> flux = neverTerminatedFlux();
TestSubscriber<String> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.assertNotTerminated();
}
@@ -102,9 +97,8 @@ public void neverTerminates() {
@Test
public void countEachSecond() {
Flux<Long> flux = counter();
TestSubscriber<Long> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.assertNotTerminated()
.awaitAndAssertNextValues(0L, 1L, 2L);
}
@@ -18,9 +18,8 @@
@Test
public void empty() {
Mono<String> mono = emptyMono();
TestSubscriber<String> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(mono)
TestSubscriber
.subscribe(mono)
.assertValueCount(0)
.assertComplete();
}
@@ -35,9 +34,8 @@ public void empty() {
@Test
public void fromValue() {
Mono<String> mono = fooMono();
TestSubscriber<String> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(mono)
TestSubscriber
.subscribe(mono)
.assertValues("foo")
.assertComplete();
}
@@ -52,9 +50,8 @@ public void fromValue() {
@Test
public void error() {
Mono<String> mono = errorMono();
TestSubscriber<String> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(mono)
TestSubscriber
.subscribe(mono)
.assertError(IllegalStateException.class)
.assertNotComplete();
}
@@ -22,9 +22,8 @@
@Test
public void transformMono() {
Mono<User> mono = repository.findFirst();
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(capitalizeOne(mono))
TestSubscriber
.subscribe(capitalizeOne(mono))
.await()
.assertValues(new User("SWHITE", "SKYLER", "WHITE"))
.assertComplete();
@@ -40,9 +39,8 @@ public void transformMono() {
@Test
public void transformFlux() {
Flux<User> flux = repository.findAll();
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(capitalizeMany(flux))
TestSubscriber
.subscribe(capitalizeMany(flux))
.await()
.assertValues(
new User("SWHITE", "SKYLER", "WHITE"),
@@ -62,9 +60,8 @@ public void transformFlux() {
@Test
public void asyncTransformFlux() {
Flux<User> flux = repository.findAll();
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(asyncCapitalizeMany(flux))
TestSubscriber
.subscribe(asyncCapitalizeMany(flux))
.await()
.assertValues(
new User("SWHITE", "SKYLER", "WHITE"),
@@ -26,9 +26,8 @@
@Test
public void mergeWithInterleave() {
Flux<User> flux = mergeFluxWithInterleave(repository1.findAll(), repository2.findAll());
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.await()
.assertValues(MARIE, MIKE, User.SKYLER, User.JESSE, User.WALTER, User.SAUL)
.assertComplete();
@@ -44,9 +43,8 @@ public void mergeWithInterleave() {
@Test
public void mergeWithNoInterleave() {
Flux<User> flux = mergeFluxWithNoInterleave(repository1.findAll(), repository2.findAll());
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.await()
.assertValues(User.SKYLER, User.JESSE, User.WALTER, User.SAUL, MARIE, MIKE)
.assertComplete();
@@ -64,9 +62,8 @@ public void multipleMonoToFlux() {
Mono<User> skylerMono = repository1.findFirst();
Mono<User> marieMono = repository2.findFirst();
Flux<User> flux = createFluxFromMultipleMono(skylerMono, marieMono);
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.await()
.assertValues(User.SKYLER, MARIE)
.assertComplete();
@@ -21,15 +21,14 @@
@Test
public void requestNoValue() {
Flux<User> flux = repository.findAll();
TestSubscriber<User> testSubscriber = createSubscriber();
TestSubscriber<User> testSubscriber = createSubscriber(flux);
testSubscriber
.bindTo(flux)
.await()
.assertNoValues();
}
// TODO Create a TestSubscriber that requests initially no value
TestSubscriber<User> createSubscriber() {
TestSubscriber<User> createSubscriber(Flux<User> flux) {
return null;
}
@@ -38,9 +37,8 @@ public void requestNoValue() {
@Test
public void requestValueOneByOne() {
Flux<User> flux = repository.findAll();
TestSubscriber<User> testSubscriber = createSubscriber();
TestSubscriber<User> testSubscriber = createSubscriber(flux);
testSubscriber
.bindTo(flux)
.assertValueCount(0);
requestOne(testSubscriber);
testSubscriber
@@ -70,9 +68,8 @@ void requestOne(TestSubscriber<User> testSubscriber) {
@Test
public void experimentWithLog() {
Flux<User> flux = fluxWithLog();
TestSubscriber<User> testSubscriber = createSubscriber();
TestSubscriber<User> testSubscriber = createSubscriber(flux);
testSubscriber
.bindTo(flux)
.assertValueCount(0);
requestOne(testSubscriber);
testSubscriber
@@ -103,9 +100,8 @@ public void experimentWithLog() {
@Test
public void experimentWithDoOn() {
Flux<User> flux = fluxWithDoOnPrintln();
TestSubscriber<User> testSubscriber = createSubscriber();
TestSubscriber<User> testSubscriber = createSubscriber(flux);
testSubscriber
.bindTo(flux)
.assertValueCount(0);
requestOne(testSubscriber);
testSubscriber
@@ -26,9 +26,8 @@ public void zipFirstNameAndLastName() {
Flux<String> firstnameFlux = Flux.just(User.SKYLER.getFirstname(), User.JESSE.getFirstname(), User.WALTER.getFirstname(), User.SAUL.getFirstname());
Flux<String> lastnameFlux = Flux.just(User.SKYLER.getLastname(), User.JESSE.getLastname(), User.WALTER.getLastname(), User.SAUL.getLastname());
Flux<User> userFlux = userFluxFromStringFlux(usernameFlux, firstnameFlux, lastnameFlux);
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(userFlux)
TestSubscriber
.subscribe(userFlux)
.assertValues(User.SKYLER, User.JESSE, User.WALTER, User.SAUL);
}
@@ -44,19 +43,17 @@ public void fastestMono() {
ReactiveRepository<User> repository1 = new ReactiveUserRepository(MARIE);
ReactiveRepository<User> repository2 = new ReactiveUserRepository(250, MIKE);
Mono<User> mono = useFastestMono(repository1.findFirst(), repository2.findFirst());
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(mono)
TestSubscriber
.subscribe(mono)
.await()
.assertValues(MARIE)
.assertComplete();
repository1 = new ReactiveUserRepository(250, MARIE);
repository2 = new ReactiveUserRepository(MIKE);
mono = useFastestMono(repository1.findFirst(), repository2.findFirst());
testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(mono)
TestSubscriber
.subscribe(mono)
.await()
.assertValues(MIKE)
.assertComplete();
@@ -74,19 +71,17 @@ public void fastestFlux() {
ReactiveRepository<User> repository1 = new ReactiveUserRepository(MARIE, MIKE);
ReactiveRepository<User> repository2 = new ReactiveUserRepository(250);
Flux<User> flux = useFastestFlux(repository1.findAll(), repository2.findAll());
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.await()
.assertValues(MARIE, MIKE)
.assertComplete();
repository1 = new ReactiveUserRepository(250, MARIE, MIKE);
repository2 = new ReactiveUserRepository();
flux = useFastestFlux(repository1.findAll(), repository2.findAll());
testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.await()
.assertValues(User.SKYLER, User.JESSE, User.WALTER, User.SAUL)
.assertComplete();
@@ -103,9 +98,8 @@ public void fastestFlux() {
public void end() {
ReactiveRepository<User> repository = new ReactiveUserRepository();
Mono<Void> end = endOfFlux(repository.findAll());
TestSubscriber<Void> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(end)
TestSubscriber
.subscribe(end)
.assertNotTerminated()
.await()
.assertNoValues()
@@ -122,16 +116,14 @@ public void end() {
@Test
public void monoWithValueInsteadOfError() {
Mono<User> mono = betterCallSaulForBogusMono(Mono.error(new IllegalStateException()));
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(mono)
TestSubscriber
.subscribe(mono)
.assertValues(User.SAUL)
.assertComplete();
mono = betterCallSaulForBogusMono(Mono.just(User.SKYLER));
testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(mono)
TestSubscriber
.subscribe(mono)
.assertValues(User.SKYLER)
.assertComplete();
}
@@ -146,16 +138,14 @@ public void monoWithValueInsteadOfError() {
@Test
public void fluxWithValueInsteadOfError() {
Flux<User> flux = betterCallSaulForBogusFlux(Flux.error(new IllegalStateException()));
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.assertValues(User.SAUL)
.assertComplete();
flux = betterCallSaulForBogusFlux(Flux.just(User.SKYLER, User.WALTER));
testSubscriber = new TestSubscriber<>();
testSubscriber
.bindTo(flux)
TestSubscriber
.subscribe(flux)
.assertValues(User.SKYLER, User.WALTER)
.assertComplete();
}
Oops, something went wrong.

0 comments on commit 3a1e82a

Please sign in to comment.