Search code examples
javajunittddjunit4

Is there a general way to mark a JUnit test as pending?


Before stepping into the TDD cycle, I like to sketch out the tests that need to be implemented - i.e. write empty test methods with speaking names.

Unfortunately I have not found a way to "paint them yellow" - mark them as pending for JUnit. I can make them either fail or pass. Now I am letting them fail by throwing an Exception, but I'd rather use an equivalent of pending from rspec.

Is there such an option in JUnit or an "adjacent" library?


Solution

  • You can use @Ignore to ignore the test,

    or this library to introduce the @PendingImplementation annotation:

    https://github.com/ttsui/pending

    I don't think there are other ways to achieve this..