diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java index 1db342f5166..059663fa406 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java @@ -1312,7 +1312,7 @@ StepVerifier.Step after(StepVerifier.Step step, T object) { } } - /** Avoid collecting when verifying only the given element is in the given {@link Flux}. */ + /** Avoid value collection when verifying that a {@link Flux} emits exactly one value. */ static final class FluxAsStepVerifierExpectNext { @BeforeTemplate StepVerifier.Step> before(Flux flux, T object) { @@ -1321,13 +1321,6 @@ StepVerifier.Step> before(Flux flux, T object) { .assertNext(list -> assertThat(list).containsExactly(object)); } - @BeforeTemplate - StepVerifier.Step> before2(Flux flux, T object) { - return flux.collect(toImmutableSet()) - .as(StepVerifier::create) - .assertNext(set -> assertThat(set).containsExactly(object)); - } - @AfterTemplate StepVerifier.Step after(Flux flux, T object) { return flux.as(StepVerifier::create).expectNext(object); diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestInput.java index b46bcf55736..0dbe004c049 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestInput.java @@ -1,7 +1,6 @@ package tech.picnic.errorprone.refasterrules; import static com.google.common.collect.ImmutableList.toImmutableList; -import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.collect.MoreCollectors.toOptional; import static java.util.Comparator.reverseOrder; import static java.util.function.Function.identity; @@ -419,18 +418,12 @@ ImmutableSet> testStepVerifierStepExpectNext() { StepVerifier.create(Mono.just("baz")).expectNextMatches("qux"::equals)); } - ImmutableSet testFluxAsStepVerifierExpectNext() { - return ImmutableSet.of( - Flux.just(1) - .collect(toImmutableList()) - .as(StepVerifier::create) - .assertNext(list -> assertThat(list).containsExactly(2)) - .verifyComplete(), - Flux.just(3) - .collect(toImmutableSet()) - .as(StepVerifier::create) - .assertNext(set -> assertThat(set).containsExactly(4)) - .verifyComplete()); + Duration testFluxAsStepVerifierExpectNext() { + return Flux.just(1) + .collect(toImmutableList()) + .as(StepVerifier::create) + .assertNext(list -> assertThat(list).containsExactly(2)) + .verifyComplete(); } Duration testStepVerifierLastStepVerifyComplete() { diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestOutput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestOutput.java index 4793b9b012d..634b4777c35 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestOutput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/ReactorRulesTestOutput.java @@ -409,10 +409,8 @@ ImmutableSet> testStepVerifierStepExpectNext() { StepVerifier.create(Mono.just("baz")).expectNext("qux")); } - ImmutableSet testFluxAsStepVerifierExpectNext() { - return ImmutableSet.of( - Flux.just(1).as(StepVerifier::create).expectNext(2).verifyComplete(), - Flux.just(3).as(StepVerifier::create).expectNext(4).verifyComplete()); + Duration testFluxAsStepVerifierExpectNext() { + return Flux.just(1).as(StepVerifier::create).expectNext(2).verifyComplete(); } Duration testStepVerifierLastStepVerifyComplete() {