Indicates that a test case should be skipped. Throwing this exception allows to skip a test case dynamically at runtime. This is useful if a test case relies on some assumption that may not be true in all environments. Note that this only works if the appropriate test runner is configured.
It should also be noted that there are alternative techniques that may be more appropriate in some use cases:
- Simply return from the test method if the expectation about the runtime environment is not met. This is simpler, but has the disadvantage that the test case is counted as successful instead of skipped.
- Using a Maven profile to exclude tests. This is more appropriate e.g. to exclude test cases that apply only to some Java versions.
@see AllTestsWithRuntimeIgnore
@see JUnit38ClassRunnerWithRuntimeIgnore