Mockito
Verifying a Method Was Called An Exact Number of Times
Autoplay
Up next
Previous
About
In this lesson, we'll explain how the times()
verification mode works and how it is used to verify that a method was called a certain number of times.
Summary of Content
- The default implementation of
Mockito.verify()
- What errors you'll see when you call a method an unexpected number of times
- Customising the verification using Verification Modes
- Overloaded method for
Mockito.verify()
which accepts a way of specifying how many times a method should be called as part of its verification - How to use the
times()
verification mode to verify a mock object had its method called a certain number of times
Instructor
Links
Comments
Lessons in Mockito
Introduction and Integration
02:19
Writing Your First Unit Test with Mockito

Pro
03:10
A Guide to Writing Testable Code

Pro
02:51
What Makes a Good Unit Test

04:17
Test Doubles

Pro
04:34
Configuring Stubs

Pro
04:21
Stubs - Default Return Values

Pro
03:45
String Matchers - anyString()

Pro
02:45
Stubs - Matching on Any Parameters of a Given Type

Pro
04:36
Introduction to Mocks

02:03
Verifying a Method Was Never Called

Pro
01:46
Verifying a Method Was Called An Exact Number of Times

Pro
01:36
Verifying That a Method was Called a Minimum or Maximum Number of Times

Pro
01:17
Mocking and Stubbing Final Classes

02:58
Argument Captors

Pro
04:04

Something went wrong
Lesson added to playlist
Create new playlist
Name can't be empty