`
sunxboy
  • 浏览: 2829411 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

How to mock void method using mockito

 
阅读更多

sometimes, we need to mock void method like this:

public void printLine() {
  //... ...
}

 
how to mock it by using mockito ?
here it is:

Mockito.doNothing().when(handler).printLine();

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics