< session />

Java Testing Part 2: Mocks, Stubs, and Spies with Mockito 4

Wed, 26 April, 2:00 PM GMT+5:30 |

The Mockito framework is the most popular library for creating mocks, stubs, and spies for your tests. This talk reviews why and how you might want to do that, including unit vs integration tests, creating your own mocks and stubs, setting expectations, and verifying the results.

The Mockito documentation is notoriously misleading if you don't already know the principles behind the library. This talk gives an example that hopefully clears up any confusion and makes the docs useful. Many examples will be provided covering a wide range of capabilities. In addition to the basics, issues like mocking static methods, mocking final methods and classes, using spies for existing classes, and more will be examined.

< speaker_info />

About the speaker

Kenneth Kousen

Founder, KousenIT

Ken Kousen is a Java Champion, Oracle Groundbreaker Ambassador, and a Grails Rock Star. He is the author of the O'Reilly books “Kotlin Cookbook”, “Modern Java Recipes”, and “Gradle Recipes for Android”, and the Manning book “Making Java Groovy”. He...