Skip to content

Commit

Permalink
Merge #3303 into 3.5.1
Browse files Browse the repository at this point in the history
Signed-off-by: OlegDokuka <[email protected]>
  • Loading branch information
Oleh Dokuka committed Nov 30, 2022
2 parents 56f8e1f + a8d4cbd commit 69450bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.stream.IntStream;

import org.assertj.core.api.Assertions;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
import org.reactivestreams.Subscription;
import reactor.core.CoreSubscriber;
Expand Down Expand Up @@ -148,13 +147,9 @@ public void useIterableOncePerSubscriber() {
AtomicInteger calls = new AtomicInteger();

Flux.range(1, 5)
.concatMapIterable(v -> new Iterable<String>() {
@NotNull
@Override
public Iterator<String> iterator() {
calls.incrementAndGet();
return Arrays.asList("hello " + v).iterator();
}
.concatMapIterable(v -> (Iterable<String>) () -> {
calls.incrementAndGet();
return Arrays.asList("hello " + v).iterator();
})
.as(StepVerifier::create)
.expectNext("hello 1", "hello 2", "hello 3", "hello 4", "hello 5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import org.assertj.core.api.Assertions;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.mockito.Mockito;
Expand Down Expand Up @@ -54,13 +53,9 @@ public class FluxIterableTest {
//https://github.com/reactor/reactor-core/issues/3295
public void useIterableOncePerSubscriber() {
AtomicInteger calls = new AtomicInteger();
Iterable<String> strings = new Iterable<String>() {
@NotNull
@Override
public Iterator<String> iterator() {
calls.incrementAndGet();
return Arrays.asList("hello").iterator();
}
Iterable<String> strings = () -> {
calls.incrementAndGet();
return Arrays.asList("hello").iterator();
};
StepVerifier.create(Flux.fromIterable(strings))
.expectNext("hello")
Expand Down

0 comments on commit 69450bb

Please sign in to comment.