Java SE Unit Testing with JUnit
Unit testing is a critical skill for software developers. This course will teach you how to write and run unit tests for Java with one of the most popular unit testing tools in existence: JUnit.
What you'll learn
A Java developer is expected to be able to unit test their code, and this course will show you how to do that with JUnit. In this course, Java SE Unit Testing with JUnit, you’ll learn how to create JUnit tests and keep them organized. First, you'll discover the many assertions that JUnit provides to validate expected results. Next, you'll explore how to utilize the JUnit lifecycle annotations to manage test setup and teardown, and how to improve your test reports. Finally, you’ll learn how to run your tests from a variety of tools including IDEs, Maven, and continuous delivery products. By the end of this course, you’ll be ready to write great unit tests for your code!
Table of contents
- Using JUnit Assertions 2m
- Asserting Equality and Identity 5m
- Asserting Boolean Values 5m
- Checkpoint 03 - Asserting Equality 0m
- Asserting Collections 5m
- Checkpoint 04 - Asserting Object Identity 0m
- Understanding Common Test Method Structure 4m
- Asserting Expected Exceptions 3m
- Checkpoint 05 - Asserting True and False 0m
- Grouping Assertions with assertAll 4m
- Understanding Test Doubles 2m
- Using Test Doubles 7m
- Checkpoint 06 - Asserting an Exception 0m
- Exercise 02 - Using a Test Double 0m