---
title: "Discussion on \"Mockito Cheatsheet\" | Hashnode"
description: "Discussion on \"Mockito Cheatsheet\". A cheatsheet of some of the most useful features of Mockito - the mocking framework."
url: "https://hashnode.com/posts/mockito-cheatsheet/645511adaa2b3bedb6b01dc5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Mockito Cheatsheet](https://stacktobasics.com/mockito-cheatsheet?utm_source=hashnode&utm_medium=feed)

A cheatsheet of some of the most useful features of Mockito - the mocking framework.

May 4, 2020 · 7 min read · stacktobasics.com  
Updated May 8, 2023  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#mockito](https://hashnode.com/tag/mockito)
-   [#testing](https://hashnode.com/tag/testing)

## Written by

[Shane Jennings](https://hashnode.com/@zinbo)

@zinbo · Nottingham, United Kingdom

  
[View profile](https://hashnode.com/@zinbo)

Full stack Developer - specialising in Java with Spring Boot and React with Next.js

Full Stack Developer and Architect. Specialising in Java with Spring Boot, and React with Next.js. Passionate about building cloud-native applications following DDD.

## Responses 1

Markdown supported · ⌘↵ to post

[Sayan Das](https://hashnode.com/@kaizeco)

[Apr 6, 2025](https://hashnode.com/posts/mockito-cheatsheet/645511adaa2b3bedb6b01dc5/comment/67f28a09a042de5f9d7f3058)

In Section 'Stubbing a Void Method -> Calling the Real Implementation', I think the last comment is wrong where it says the test will pass when the exception is thrown. Maybe a copy paste issue?

[Sep 2, 2025](https://hashnode.com/posts/mockito-cheatsheet/645511adaa2b3bedb6b01dc5/comment/67f28a09a042de5f9d7f3058#reply-68b72a5f210e3d3019c62008)

Yes you're right, good spot! I'll get that updated :)
