Learn how to write effective tests in Java using JUnit and Mockito to build robust, reliable applications with confidence.
Overview
Syllabus
- Foundations of Testing
- Start by exploring automated software testing and the typical pitfalls it helps avoid. Then, gain hands-on experience with Java's JUnit 5 library and learn to structure and write unit tests.
- Testing with Dependencies
- Examine how software components interact and rely on each other, and see how integration testing verifies these interactions by testing a class alongside its dependencies. This chapter then introduces mocking as a method to simulate dependencies and focus testing on the logic being evaluated.
- Further techniques and annotations
- Explore multiple ways to make testing less verbose. One way to do so is parameterizing tests; another is using the @BeforeEach annotation. Finally, it presents a new way to think about testing.
Taught by
Maria Milusheva