Skip to content

Commit

Permalink
Refaster redundant Mono#when statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsamehsalah committed Feb 20, 2025
1 parent 3beadee commit 418fc05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ Flux<T> after(Mono<T> mono) {
static final class MonoThen<T> {
@BeforeTemplate
Mono<@Nullable Void> before(Mono<T> mono) {
return Refaster.anyOf(mono.ignoreElement().then(), mono.flux().then());
return Refaster.anyOf(mono.ignoreElement().then(), mono.flux().then(), Mono.when(mono));
}

@AfterTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,10 @@ ImmutableSet<Flux<String>> testMonoFlux() {
}

ImmutableSet<Mono<Void>> testMonoThen() {
return ImmutableSet.of(Mono.just("foo").ignoreElement().then(), Mono.just("bar").flux().then());
return ImmutableSet.of(
Mono.just("foo").ignoreElement().then(),
Mono.just("bar").flux().then(),
Mono.when(Mono.just("baz")));
}

ImmutableSet<Mono<Void>> testFluxThen() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ ImmutableSet<Flux<String>> testMonoFlux() {
}

ImmutableSet<Mono<Void>> testMonoThen() {
return ImmutableSet.of(Mono.just("foo").then(), Mono.just("bar").then());
return ImmutableSet.of(
Mono.just("foo").then(), Mono.just("bar").then(), Mono.just("baz").then());
}

ImmutableSet<Mono<Void>> testFluxThen() {
Expand Down

0 comments on commit 418fc05

Please sign in to comment.