Is it possible to do strict mocks with Mockito?

后端 未结 6 1389
傲寒
傲寒 2021-02-12 20:13

I\'d like to use strict mocks, at least when developing for the first time some tests against old code, so any methods invoked on my mock will throw an exception if I didn\'t sp

6条回答
  •  无人及你
    2021-02-12 20:34

    Bellow Methods can verify no unexpected method called:

    org.mockito.Mockito#only
    org.mockito.Mockito#verifyNoMoreInteractions
    

提交回复
热议问题