mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Extend MonoIdentity Refaster rule (#465)
By flagging expressions of the form `mono.flux().next()`.
This commit is contained in:
@@ -369,7 +369,7 @@ final class ReactorRules {
|
||||
static final class MonoIdentity<T> {
|
||||
@BeforeTemplate
|
||||
Mono<T> before(Mono<T> mono) {
|
||||
return mono.switchIfEmpty(Mono.empty());
|
||||
return Refaster.anyOf(mono.switchIfEmpty(Mono.empty()), mono.flux().next());
|
||||
}
|
||||
|
||||
@BeforeTemplate
|
||||
|
||||
@@ -116,7 +116,10 @@ final class ReactorRulesTest implements RefasterRuleCollectionTestCase {
|
||||
}
|
||||
|
||||
ImmutableSet<Mono<?>> testMonoIdentity() {
|
||||
return ImmutableSet.of(Mono.just(1).switchIfEmpty(Mono.empty()), Mono.<Void>empty().then());
|
||||
return ImmutableSet.of(
|
||||
Mono.just(1).switchIfEmpty(Mono.empty()),
|
||||
Mono.just(2).flux().next(),
|
||||
Mono.<Void>empty().then());
|
||||
}
|
||||
|
||||
ImmutableSet<Flux<Integer>> testFluxSwitchIfEmptyOfEmptyPublisher() {
|
||||
|
||||
@@ -121,7 +121,7 @@ final class ReactorRulesTest implements RefasterRuleCollectionTestCase {
|
||||
}
|
||||
|
||||
ImmutableSet<Mono<?>> testMonoIdentity() {
|
||||
return ImmutableSet.of(Mono.just(1), Mono.<Void>empty());
|
||||
return ImmutableSet.of(Mono.just(1), Mono.just(2), Mono.<Void>empty());
|
||||
}
|
||||
|
||||
ImmutableSet<Flux<Integer>> testFluxSwitchIfEmptyOfEmptyPublisher() {
|
||||
|
||||
Reference in New Issue
Block a user