---
title: "Mocking and Stubbing"
author: "jusi"
date: "2014-12-10T17:05:07Z"
tags: []
categories: ["编程语言"]
slug: "mocking-and-stubbing"
draft: false
lastmod: "2014-12-10T17:05:07Z"
id: 2164910
url: "https://jusi.iteye.com/blog/2164910"
---

**Mocking**

count abstract method invocations

 

**Stubbing**

get return of abstract method 

 

```
//mocking
1 * subscriber.receive()

//stubbing
subscriber.recerive() >> content

//combine mocking and stubbing

1 * subscriber.receive() >> content
```