Spy object by Mockito in Spring

后端 未结 4 528
眼角桃花
眼角桃花 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:38

    This is happening because of the dependency of powermock-api-mockito on mockito-core . Since powermock-api-mockito is added explicitly as dependency please remove mockito-core, this might be causing the issue

提交回复
热议问题