From fe9c7fa985a2c2682d6b605dd4ba9353a570d073 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Fri, 20 Sep 2024 10:45:17 +0200 Subject: [PATCH] Add missing ExecutorValidationTest test cases (#957) --- .../pivovarit/collectors/test/ExecutorValidationTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/com/pivovarit/collectors/test/ExecutorValidationTest.java b/src/test/java/com/pivovarit/collectors/test/ExecutorValidationTest.java index e698a566..758d298a 100644 --- a/src/test/java/com/pivovarit/collectors/test/ExecutorValidationTest.java +++ b/src/test/java/com/pivovarit/collectors/test/ExecutorValidationTest.java @@ -12,6 +12,8 @@ import static com.pivovarit.collectors.test.Factory.GenericCollector.executorCollector; import static java.util.stream.Collectors.collectingAndThen; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static java.util.stream.Collectors.toList; + class ExecutorValidationTest { @@ -22,6 +24,11 @@ private static Stream collectingAndThen(ParallelCollectors.parallel(f, e, 4), c -> c.thenApply(Stream::toList).join())), executorCollector("parallel(e, p=1) [batching]", (f, e) -> collectingAndThen(ParallelCollectors.Batching.parallel(f, e, 1), c -> c.thenApply(Stream::toList).join())), executorCollector("parallel(e, p=4) [batching]", (f, e) -> collectingAndThen(ParallelCollectors.Batching.parallel(f, e, 4), c -> c.thenApply(Stream::toList).join())), + executorCollector("parallel(toList(), e)", (f, e) -> collectingAndThen(ParallelCollectors.parallel(f, toList(), e), c -> c.join())), + executorCollector("parallel(toList(), e, p=1)", (f, e) -> collectingAndThen(ParallelCollectors.parallel(f, toList(), e, 1), c -> c.join())), + executorCollector("parallel(toList(), e, p=4)", (f, e) -> collectingAndThen(ParallelCollectors.parallel(f, toList(), e, 4), c -> c.join())), + executorCollector("parallel(toList(), e, p=1) [batching]", (f, e) -> collectingAndThen(ParallelCollectors.Batching.parallel(f, toList(), e, 1), c -> c.join())), + executorCollector("parallel(toList(), e, p=4) [batching]", (f, e) -> collectingAndThen(ParallelCollectors.Batching.parallel(f, toList(), e, 4), c -> c.join())), executorCollector("parallelToStream(e)", (f, e) -> collectingAndThen(ParallelCollectors.parallelToStream(f, e), Stream::toList)), executorCollector("parallelToStream(e, p=1)", (f, e) -> collectingAndThen(ParallelCollectors.parallelToStream(f, e, 1), Stream::toList)), executorCollector("parallelToStream(e, p=4)", (f, e) -> collectingAndThen(ParallelCollectors.parallelToStream(f, e, 4), Stream::toList)),