Expected Exceptions using JUnit
We will learn the Expected Exception Rules with a JUnit Testing example.
JUnit allows us to define custom rules which can provide greater control over what happens during the flow of test execution.
In a sense, custom rules provide a capability similar to aspect-oriented programming in that they provide a way to automatically attach a cross-cutting concern to a set of tests.
JUnit provides a few useful rules out of the box, meaning we don’t have to code them ourselves.
The ...
Access this course and 1400+ top-rated courses and projects.