About this course
This course covers the de-facto standard mocking library for JVM applications: Mockito.
Learn how to effectively make use of Mockito to create and instruct mocks for your tests. After working with this course, you'll be able to create mocks, stub method calls, and verify method invocations using Mockito.
Please note that this is not a course on unit testing Java applications. Instead, this course explains all the essential features of Mockito using hands-on examples. Get more information here.
Answering the question: "Why do we actually need mocks for our tests?"
You'll learn all different ways to create mocks and get a basic understanding of how Mockito internally creates them.
Without stubbing, mocks are just an empty shell. You'll learn how to instruct your mock's behavior (ArgumentMatchers, BDD vs. non-BDD style, stubbing void methods, etc.).
Inspect the actual interaction of your mocks and verify how your mocks were used during your test.
The final module covers several advanced topics: @Spy vs. @Mock, @MockBean vs. @Mock, mocking static methods, deep stubbing, etc.
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.