Sometime you want to ignore some test depends on environment settings. Now both JUnit 4 and JUnit 5 support the concept of assumptions.
Unit Test like this:
1 |
|
With Gradle, pass in parameter like this:
1 | $ gradle test -Pruntest=false |
References
- Assumptions and Conditional Test Execution with JUnit 4 and 5, https://reflectoring.io/conditional-junit4-junit5-tests/