So far in this book, we have not talked much about handling exceptions with JUnit 5. As programmers, we know exceptions will happen and we must verify that exceptions get thrown when expected. In this chapter, you’ll learn how to use various ways supported by JUnit 5 to work with exceptions. We will end the chapter by talking about JUnit 5 support of repeated test execution. Repeated test execution is helpful when you have to work with flaky tests. A test is flaky when it exhibits both a passing and a ...
© Shekhar Gulati, Rahul Sharma 2017
Shekhar Gulati and Rahul Sharma, Java Unit Testing with JUnit 5, https://doi.org/10.1007/978-1-4842-3015-2_5
5. Testing Exceptions
Shekhar Gulati1 and Rahul Sharma2
(1)Gurgaon, Haryana, India
(2)Delhi, Delhi, India
Get Java Unit Testing with JUnit 5: Test Driven Development with JUnit 5 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.