Course info
Aug 2, 2019
1h 23m
Your 10-day individual free trial includes:

Expert-led courses

Keep up with the pace of change with thousands of expert-led, in-depth courses.

Writing unit tests is difficult if the dependencies between your application classes make it difficult to draw a boundary between what you want to test and the rest of the codebase. In this course, Getting Started with Mockito, you will gain the ability to focus on the thing you’re trying to test without having to worry about the rest of the codebase. First, you will learn how to use mock objects instead of real dependencies. Next, you will discover how to configure mocked methods, including return values and exception throwing. Finally, you will explore the concept of partial mocks and how to use them to test tricky situations. When you are finished with this course, you will have the skills and knowledge of mocking with Mockito needed to test your Java applications by creating, configuring, and using mocks in your unit tests.

About the author
About the author

Nicolae has been a Software Engineer since 2013, focusing on Java and web stacks. Nicolae holds a degree in Computer Science and enjoys teaching, traveling and motorsports.

More from the author
Exploring Java Machine Learning Environments
1h 35m
Feb 17, 2021
SharePoint Framework Development with PnP
1h 18m
Dec 30, 2020
More courses by Nicolae Caprarescu
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone, my name is Nicolae Caprarescu, and welcome to my course, Getting Started with Mockito. I'm a freelance software developer with experience in both the corporate and the startup worlds. Automated tests are the key to creating high-quality software. In this course, you'll learn how to easily isolate the thing you're trying to test from the rest of the code base. You do so by using Mockito, the leading Java mocking framework. Some of the major topics that we will cover include test doubles and mocking at an abstract level; creating, configuring, and verifying mocks; using partial mocks; and resolving situations where testing is difficult, such as testing code that deals with time or code that you can't change. By the end of this course, you'll have the Mockito skills needed to easily test your Java applications. Before beginning this course, you should be familiar with writing object-oriented Java code and with testing with JUnit 5. I hope you'll join me on this journey to learn how to easily write great unit tests with the Getting Started with Mockito course, at Pluralsight.