Hands-On Mocking With Mockito

5 Modules 27 Lessons Easy

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.


Course Structure

3 Lessons

Introduction To Mockito

Answering the question: "Why do we actually need mocks for our tests?"

4 Lessons

Creating Mocks With Mockito

You'll learn all different ways to create mocks and get a basic understanding of how Mockito internally creates them.

3 Lessons

Verifying The Interaction Of A Mock

Inspect the actual interaction of your mocks and verify how your mocks were used during your test.

6 Lessons

Miscellaneous & Advanced Topics

The final module covers several advanced topics: @Spy vs. @Mock, @MockBean vs. @Mock, mocking static methods, deep stubbing, etc.