All Courses are 33% off until December 2nd

Days
Hours
Minutes
Seconds

Learn Mockito

Enhance your unit tests through practical mocking

Learn Mocking with Mockito

Unit testing is an essential practice in development that ensures the individual components of an application work as expected.

To test these components in isolation, we need to simulate or mock the external services they rely on.

Mockito stands out among mocking libraries for Java, due to huge popularity and adoption and its simple and intuitive API, while also having a very robust set of features. 

In this course, we’ll start by exploring the basic concepts of mocks and stubs, how to create these using Mockito, and how to verify interactions in tests. 

Then, we’ll look into more advanced techniques like working with spies, conditional stubbing, testing exceptions, BDD with Mockito and more.

The essential guide for learning Mockito. The 3 modules cover the basic concepts and setup, and how to get started with defining mocks and verifying expected behavior.

Beyond the basics, you’ll also learn how to use stubbing, work with spies and partial mocks, test exceptions, use BDDMockito, and avoid common mistakes.

Everything you need to create robust unit tests with Mockito.

1. Introduction to Unit Testing and Mockito

6 LESSONS ~ 3.5 HOURS

  1. Introduction to Unit Testing and Mocking Concepts
  2. The Project We’re Testing
  3. The Basics of Creating and Managing Mock Objects
  4. Creating Mock Objects Using Annotations (preview lesson)
  5. Stubbing Methods for Controlled Behavior
  6. Verifying Interactions with Mocks

2. Advanced Mockito Techniques

5 LESSONS ~ 2 HOURS

  1. Working With Spies and Partial Mocks (preview lesson)
  2. Advanced Stubbing Techniques
  3. Exception Handling in Unit Tests
  4. Advanced Cases
  5. Integrating Mockito with Spring Boot (upcoming)

3. Testing Practices and Methodologies

2 LESSONS ~ 1 HOUR

  1. Behavior-Driven Development (BDD) with Mockito
  2. Common Pitfalls with Mockito

The lessons in this course are text-based, with a full project backing each one.

Access this course through Baeldung All Access

Our Full Course Library 

IntelliJ Idea Ultimate (6 months free)

JProfiler (6 months free)

All Upcoming Courses (Roadmap)

Certificates of Completion

Multiple-Choice questions in Each Lesson 

Pro Access

Yearly or the Lifetime access

Do you have a team who would benefit from taking the course?

20-Day Money Back Guarantee

I believe strongly in the quality of the course material to teach you the fundamentals of the library. I’ve put a lot of work and care into the material and hope you’re going to use it and to develop and maintain your applications.

I confidently back all courses with a 20-Day Money Back Guarantee. I want you to dive in deep and experience the full wealth of this resource without hesitation.

If the material isn’t a good fit, just contact me within 20 days of purchase, and ask for a full refund for any single course package.