Sometimes our tests depends on certain conditions.
It might be anything - an external service shoulde up and running, a specific environmental variable’s value, specific date or/and time…
We already know how to skip tests conditionally in TestNG - How to skip TestNG tests based on condition
In JUnit we can do it easily with Assume
Conditionally skip/execute tests. Examples
Skip test if external service is unavailable
Skip test on Friday
Skip tests in Production
Skip tests if it’s raining
You may also find these posts interesting: