Skip to content

Glossary: Java Beyond the Basics

assertThrows

A JUnit check that some code, passed as a lambda, throws a given kind of exception. It fails if nothing or a different exception is thrown.

Where the book teaches it

Related terms

Class literalLambdaassertEquals