$ mvn test -Dtest=DynamicTestsUsingStreamsTest [INFO] Scanning for projects... [INFO] [INFO] ------< com.logicbig.example:junit-5-dynamic-tests-using-streams >------ [INFO] Building junit-5-dynamic-tests-using-streams 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- resources:3.3.1:resources (default-resources) @ junit-5-dynamic-tests-using-streams --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory D:\example-projects\junit-5\junit-5-dynamic-tests\junit-5-dynamic-tests-using-streams\src\main\resources [INFO] [INFO] --- compiler:3.11.0:compile (default-compile) @ junit-5-dynamic-tests-using-streams --- [INFO] No sources to compile [INFO] [INFO] --- resources:3.3.1:testResources (default-testResources) @ junit-5-dynamic-tests-using-streams --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory D:\example-projects\junit-5\junit-5-dynamic-tests\junit-5-dynamic-tests-using-streams\src\test\resources [INFO] [INFO] --- compiler:3.11.0:testCompile (default-testCompile) @ junit-5-dynamic-tests-using-streams --- [INFO] Changes detected - recompiling the module! :source [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! [INFO] Compiling 1 source file with javac [debug target 17] to target\test-classes [INFO] [INFO] --- surefire:3.5.0:test (default-test) @ junit-5-dynamic-tests-using-streams --- [INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] +--com.logicbig.example.DynamicTestsUsingStreamsTest - 0.099 ss [INFO] | +-- [OK] streamBasedTests() number 1 - 0.014 ss [INFO] | +-- [OK] streamBasedTests() number 2 - 0.003 ss [INFO] | '-- [OK] streamBasedTests() number 3 - 0.001 ss [INFO] [INFO] Results: [INFO] [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.634 s [INFO] Finished at: 2025-12-27T23:51:56+08:00 [INFO] ------------------------------------------------------------------------
Output Analysis
The output shows that each stream element is transformed into a dynamic test and executed independently, confirming the lazy and scalable nature of stream-based dynamic tests.
Example Project
Dependencies and Technologies Used:
junit-jupiter-engine 6.0.1 (Module "junit-jupiter-engine" of JUnit) Version Compatibility: 5.0.0 - 6.0.1Version List
×
Version compatibilities of junit-jupiter-engine with this example: