November 2024
Intermediate to advanced
300 pages
7h 12m
English
Occasionally, you’ll want to keep a specific test from getting executed, usually because it’s failing. Maybe you don’t have the time to fix it at the moment and want to focus on getting other tests to pass first—during which time, other test failures will be a distraction.
You might have other legitimate reasons to avoid running a certain test. Maybe you’re waiting on an answer from the business about a specific unit behavior.
You can temporarily comment out tests, of course, but the better answer is to mark the test methods in question with the @Disabled annotation. JUnit will bypass executing any such marked test methods. You can similarly mark a test class as @Disabled, in which case JUnit will run ...
Read now
Unlock full access