Practical Mockito 3 : Java Unit Testing with Mockito & JUnit
4.3 (14 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
90 students enrolled

Practical Mockito 3 : Java Unit Testing with Mockito & JUnit

Master Mockito 3 testing framework step by step with in depth examples and demonstrations.
4.3 (14 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
90 students enrolled
Created by Dinesh Varyani
Last updated 5/2020
English
English [Auto-generated]
Current price: $129.99 Original price: $199.99 Discount: 35% off
1 day left at this price!
30-Day Money-Back Guarantee
This course includes
  • 7 hours on-demand video
  • 3 articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • You will learn to write Java unit tests in next generation JUnit 5 and Mockito 3 framework
  • You will learn Mockito 3 framework along with its new features
  • You will learn about role of Test Doubles in Unit Testing
  • You will learn about Mockito ability to perform method stubbing
  • You will learn about Mockito ability to perform behavior verification
  • You will learn about Argument Matchers
  • You will learn how to handle exceptions in Mockito
Course content
Expand all 59 lectures 07:07:52
+ Getting Started
6 lectures 22:56
Getting Started
00:38
Complete Source Code
00:15
Course Prerequisites
01:15
Maven Setup with JUnit 5
06:40
+ Test Doubles without Mockito
5 lectures 01:10:19
Test Double - Stub
18:54
Test Double - Spy
15:33
Test Double - Mock
08:52
+ Mockito Setup
2 lectures 06:01
Mockito project setup with JUnit 5 and Maven
02:17
Mockito project setup with JUnit 4 and Maven
03:44
+ Introduction to Mockito
2 lectures 08:44
What is Mocking ?
04:13
Introduction to Mockito
04:31
+ Creating Test Doubles with Mockito
5 lectures 40:15
Creating Fakes
11:02
Creating Dummies
05:38
Creating Stubs
10:48
Creating Mocks
08:09
Creating Spies
04:38
+ Using Mockito Annotations
5 lectures 30:13
Creating Mocks using Annotations
07:46
Using Mockito Extension
07:34
Using @RunWith(MockitoJUnitRunner.class)
07:23
Using MockitoAnnotations.initMocks(this)
03:01
Using Mockito Rule
04:29
+ Stubbing in Mockito
7 lectures 51:54
What is Stubbing ?
05:38
Stubbing method with when() and thenReturn()
14:41
Stubbing method with doReturn() and when()
03:53
Mockito misuse - UnfinishedStubbingException
04:16
Stubbing Multiple Calls to the Same Method
04:37
Stubbing Void Methods
04:30
Mockito misuse - PotentialStubbingException
14:19
+ Verifying Behavior in Mockito
8 lectures 59:16
What is Behavior Verification ?
03:39
Verify simple invocation on mock
09:49
Verify number of interactions with mock
13:40
Verify an interaction has not occurred
02:59
Verify no interaction with mock
06:31
Verify there are no unexpected interactions
10:49
Verify order of interactions
04:41
Verify an interaction has occurred at least certain number of times
07:08
+ Exception Handling in Mockito
2 lectures 18:01
Exception handling with Non Void methods
11:04
Exception handling with Void methods
06:57
+ Argument Captors in Mockito
2 lectures 12:05
Demo - ArgumentCaptor without using annotations
10:09
Demo - ArgumentCaptor using annotations
01:56
Requirements
  • Basic knowledge and installation of Java 8
  • Eclipse or IntelliJ IDE
Description

Mockito is a mocking framework for Java applications. It lets you write beautiful tests with a clean and simple API. Mockito tests are very readable and they produce clean verification errors. It's a simple Java library that is used for effective unit testing of Java applications. In this course, you will learn step by step, how to configure and use Mockito and JUnit testing frameworks. This course should help you learn how to create efficient unit tests with Mockito as well as how to use its API's in a simple and intuitive way.

Who this course is for:
  • You are new to Mockito and you would want to understand how it works
  • You want to learn writing unit tests in JUnit 5 and Mockito 3 Framework
  • Software developers who are new and willing to learn JUnit and Mockito