Skip to content

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 expected attribute.
  • Be able to write JUnit test cases that handle Exceptions using try/catch blocks.

Topics


Up -- Next