Add the testFlowableCombineLatest

This commit is contained in:
Rick Ossendrijver
2021-08-27 13:11:29 +02:00
parent 256a4b6cac
commit 704705e47b
3 changed files with 15 additions and 1 deletions

View File

@@ -699,7 +699,7 @@ public final class RxJavaToReactorTemplates {
}
@SuppressWarnings("IllegalCatch")
static <T, U, R>
public static <T, U, R>
java.util.function.BiFunction<? super T, ? super U, ? extends R> toJdkBiFunction(
io.reactivex.functions.BiFunction<? super T, ? super U, ? extends R> biFunction) {
return (t, u) -> {

View File

@@ -30,6 +30,11 @@ final class RxJavaToReactorTemplatesTest implements RefasterTemplateTestCase {
return Flux.just(2).as(RxJava2Adapter::fluxToFlowable).as(RxJava2Adapter::flowableToFlux);
}
// XXX: Can this be done with Flowable<Integer> instead of Flowable<Object>
Flowable<Integer> testFlowableCombineLatest() {
return Flowable.combineLatest(Flowable.just(1), Flowable.just(2), Integer::sum);
}
// XXX: Discuss with Stephan, look at the Publisher which is of type Flowable, that won't work...
Flowable<Integer> testFlowableConcatWithPublisher() {
return Flowable.just(1).concatWith(Flowable.just(2));

View File

@@ -27,6 +27,15 @@ final class RxJavaToReactorTemplatesTest implements RefasterTemplateTestCase {
return Flux.just(2);
}
// XXX: Can this be done with Flowable<Integer> instead of Flowable<Object>
Flowable<Integer> testFlowableCombineLatest() {
return RxJava2Adapter.fluxToFlowable(
Flux.combineLatest(
Flowable.just(1),
Flowable.just(2),
RxJavaToReactorTemplates.RxJava2ReactorMigrationUtil.toJdkBiFunction(Integer::sum)));
}
// XXX: Discuss with Stephan, look at the Publisher which is of type Flowable, that won't work...
Flowable<Integer> testFlowableConcatWithPublisher() {
return Flowable.just(1)