-
Course
- Core Tech
Getting Started with Mockito 2
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. Mockito helps you to easily create Java tests by using mock objects.
What you'll learn
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.
Table of contents
- Version Check | 15s
- Introduction | 3m 8s
- Demo Code Overview | 1m 53s
- Writing a Test without Mocks | 2m 24s
- Installing Mockito and Adding a Mock to the Mockless Test | 1m 56s
- What Is Mocking? | 1m 47s
- Why Mock? | 1m 53s
- Test Doubles | 3m 21s
- What Is a Unit? | 1m
- Mock Classes or Mock Interfaces? | 1m
- Summary | 1m 28s
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 Courses by Nicolae