Skip to content

Commit

Permalink
Extend MonoFlux Refaster rule
Browse files Browse the repository at this point in the history
  • Loading branch information
werli committed Nov 18, 2022
1 parent 5bdb906 commit d03eae3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ Flux<S> after(Flux<T> flux) {
static final class MonoFlux<T> {
@BeforeTemplate
Flux<T> before(Mono<T> mono) {
return Flux.concat(mono);
return Refaster.anyOf(Flux.concat(mono), mono.flatMapMany(Flux::just));
}

@AfterTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ ImmutableSet<Flux<Integer>> testFluxMapNotNull() {
Flux.just(1).switchMap(n -> Mono.fromSupplier(() -> n * 2)));
}

Flux<String> testMonoFlux() {
return Flux.concat(Mono.just("foo"));
ImmutableSet<Flux<String>> testMonoFlux() {
return ImmutableSet.of(Flux.concat(Mono.just("foo")), Mono.just("bar").flatMapMany(Flux::just));
}

ImmutableSet<Mono<Optional<String>>> testMonoCollectToOptional() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ ImmutableSet<Flux<Integer>> testFluxMapNotNull() {
Flux.just(1).mapNotNull(n -> n * 2));
}

Flux<String> testMonoFlux() {
return Mono.just("foo").flux();
ImmutableSet<Flux<String>> testMonoFlux() {
return ImmutableSet.of(Mono.just("foo").flux(), Mono.just("bar").flux());
}

ImmutableSet<Mono<Optional<String>>> testMonoCollectToOptional() {
Expand Down

0 comments on commit d03eae3

Please sign in to comment.