Add Flowable#blockingIterable Refaster template

This commit is contained in:
Rick Ossendrijver
2021-12-09 13:34:39 +01:00
committed by Pieter Dirk Soels
parent e6ea9fd37e
commit 05b6aa03df
3 changed files with 21 additions and 0 deletions

View File

@@ -489,6 +489,19 @@ final class RxJavaFlowableToReactorTemplates {
// XXX: final Object blockingFirst(Object)
// XXX: final void blockingForEach(Consumer)
// XXX: final Iterable blockingIterable()
static final class FlowableBlockingIterable<T> {
@BeforeTemplate
Iterable<T> before(Flowable<T> flowable) {
return flowable.blockingIterable();
}
@AfterTemplate
Iterable<T> after(Flowable<T> flowable) {
return RxJava2Adapter.flowableToFlux(flowable).toIterable();
}
}
// XXX: final Iterable blockingIterable(int)
// XXX: final Object blockingLast()
// XXX: final Object blockingLast(Object)

View File

@@ -155,6 +155,10 @@ final class RxJavaFlowableToReactorTemplatesTest implements RefasterTemplateTest
return Flowable.just(1).blockingFirst();
}
Iterable<Integer> testFlowableBlockingIterable() {
return Flowable.just(1).blockingIterable();
}
Flowable<Integer> testFlowableConcatMap() {
return Flowable.just(1).concatMap(e -> Flowable::just);
}

View File

@@ -190,6 +190,10 @@ final class RxJavaFlowableToReactorTemplatesTest implements RefasterTemplateTest
return RxJava2Adapter.flowableToFlux(Flowable.just(1)).blockFirst();
}
Iterable<Integer> testFlowableBlockingIterable() {
return RxJava2Adapter.flowableToFlux(Flowable.just(1)).toIterable();
}
Flowable<Integer> testFlowableConcatMap() {
return RxJava2Adapter.fluxToFlowable(
RxJava2Adapter.flowableToFlux(Flowable.just(1))