Spy object by Mockito in Spring

后端 未结 4 536
眼角桃花
眼角桃花 2020-12-20 17:56

When I try to Spy an object in my unit test, I got an exception. This is my unit test file:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(loc         


        
4条回答
  •  半阙折子戏
    2020-12-20 18:41

    Use powermock-api-mockito2 if you are using 2.x.x version of mockito-core as powermock-api-mockito is not compatible with mockito-core 2.

提交回复
热议问题