JUnit Assertions & Execution
Learn to use JUnit's assertion methods to validate test outcomes and run tests effectively within your IDE.
What are Assertions?
Assertions are the checks that decide pass or fail: they verify a condition is true, and if it isn’t, the test fails and flags the problem.
Checking for Equality
assertEquals() is the workhorse: pass it the expected value and the actual value, and the test passes only when they match.
All lessons in this course
- Introduction to Unit Testing
- Basic JUnit 5 Annotations
- JUnit Assertions & Execution
- Organizing Tests with @DisplayName and Nesting