© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
M. IndenJava Challengeshttps://doi.org/10.1007/978-1-4842-7395-1_13

Short Introduction to JUnit 5

Michael Inden1  
(1)
Zurich, Switzerland
 

JUnit is a framework written in Java that supports the creation and automation of test cases. It is easy to learn and takes a lot of work of writing and managing test cases. In particular, only the logic for the test cases themselves needs to be implemented. Thereby the framework supports various methods with which test assertions can be set up and evaluated.

1 Writing and Running Tests

1.1 Example: A First Unit Test

To test an application class, a corresponding test class is usually written. Often you start to validate the ...

Get Java Challenges: 100+ Proven Tasks that Will Prepare You for Anything 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.