mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Extend MonoFlux Refaster rule (#358)
This commit is contained in:
@@ -559,7 +559,8 @@ final class ReactorRules {
|
||||
static final class MonoFlux<T> {
|
||||
@BeforeTemplate
|
||||
Flux<T> before(Mono<T> mono) {
|
||||
return Flux.concat(mono);
|
||||
return Refaster.anyOf(
|
||||
mono.flatMapMany(Mono::just), mono.flatMapMany(Flux::just), Flux.concat(mono));
|
||||
}
|
||||
|
||||
@AfterTemplate
|
||||
|
||||
@@ -178,8 +178,11 @@ final class ReactorRulesTest implements RefasterRuleCollectionTestCase {
|
||||
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(
|
||||
Mono.just("foo").flatMapMany(Mono::just),
|
||||
Mono.just("bar").flatMapMany(Flux::just),
|
||||
Flux.concat(Mono.just("baz")));
|
||||
}
|
||||
|
||||
ImmutableSet<Mono<Optional<String>>> testMonoCollectToOptional() {
|
||||
|
||||
@@ -180,8 +180,9 @@ final class ReactorRulesTest implements RefasterRuleCollectionTestCase {
|
||||
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(), Mono.just("baz").flux());
|
||||
}
|
||||
|
||||
ImmutableSet<Mono<Optional<String>>> testMonoCollectToOptional() {
|
||||
|
||||
Reference in New Issue
Block a user