Skip to content

Commit

Permalink
Extend MonoThen Refaster rule (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsamehsalah authored Feb 24, 2025
1 parent 86b2d92 commit db53631
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,11 @@ 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),
Mono.whenDelayError(mono));
}

@AfterTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,11 @@ 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")),
Mono.whenDelayError(Mono.just("qux")));
}

ImmutableSet<Mono<Void>> testFluxThen() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,11 @@ 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(),
Mono.just("qux").then());
}

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

0 comments on commit db53631

Please sign in to comment.