Testing Exceptions with JUnit
This chapter focuses on using JUnit to test that methods throw Exceptions when expected.
Objectives¶
- Be able to write JUnit test cases that handle Exceptions using JUnit's
expectedattribute. - Be able to write JUnit test cases that handle Exceptions using try/catch blocks.