Skip to content

Commit

Permalink
Include a rule to rewrite Mono.just(null) to Mono.empty()
Browse files Browse the repository at this point in the history
Should never happen in practice, but it's not a compile time error.
  • Loading branch information
werli authored and rickie committed Dec 6, 2022
1 parent e05a3fb commit f54d023
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 @@ -64,7 +64,7 @@ Mono<T> after(Supplier<? extends T> supplier) {
static final class MonoEmpty<T> {
@BeforeTemplate
Mono<T> before() {
return Mono.justOrEmpty(null);
return Refaster.anyOf(Mono.just(null), Mono.justOrEmpty(null));
}

@AfterTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ ImmutableSet<Mono<?>> testMonoFromSupplier() {
Mono.fromCallable(this::toString));
}

Mono<String> testMonoEmpty() {
return Mono.justOrEmpty(null);
ImmutableSet<Mono<String>> testMonoEmpty() {
return ImmutableSet.of(Mono.just(null), Mono.justOrEmpty(null));
}

ImmutableSet<Mono<Integer>> testMonoJustOrEmpty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ ImmutableSet<Mono<?>> testMonoFromSupplier() {
Mono.fromSupplier(this::toString));
}

Mono<String> testMonoEmpty() {
return Mono.empty();
ImmutableSet<Mono<String>> testMonoEmpty() {
return ImmutableSet.of(Mono.empty(), Mono.empty());
}

ImmutableSet<Mono<Integer>> testMonoJustOrEmpty() {
Expand Down

0 comments on commit f54d023

Please sign in to comment.