-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ParallelismValidation tests (#958)
- Loading branch information
Showing
3 changed files
with
40 additions
and
18 deletions.
There are no files selected for viewing
19 changes: 1 addition & 18 deletions
19
src/test/java/com/pivovarit/collectors/test/BasicParallelismTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/test/java/com/pivovarit/collectors/test/ParallelismValidationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.pivovarit.collectors.test; | ||
|
||
import org.junit.jupiter.api.DynamicTest; | ||
import org.junit.jupiter.api.TestFactory; | ||
|
||
import java.util.stream.Stream; | ||
|
||
import static com.pivovarit.collectors.test.Factory.allBounded; | ||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
|
||
class ParallelismValidationTest { | ||
|
||
@TestFactory | ||
Stream<DynamicTest> shouldRejectInvalidRejectedExecutionHandlerFactory() { | ||
return allBounded() | ||
.map(c -> DynamicTest.dynamicTest(c.name(), () -> { | ||
assertThatThrownBy(() -> c.factory() | ||
.collector(i -> i, -1)) | ||
.isInstanceOf(IllegalArgumentException.class); | ||
})); | ||
} | ||
} |