当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Mocked private method getting invocked Jmockito

问题描述:

I am writing a test case for my class using mockito and Power Mockito. for one of my public method i wrote the test case but that internally calling a private method, but i dont care about the result of private method so i decided to mock the method using Power Mockito as below

PowerMockito.doReturn(refDataListVO).when(mockObject,

"referenceDataValues",Mockito.anyList(),(ReferenceDataListVO)anyObject());

My referenceDataValues method is as below

private ReferenceDataListVO referenceDataValues(List inputList,

ReferenceDataListVO referenceDataListVO) {

// Some Code

}

But when i run this code referenceDataValues method getting invoked.

Please help me on this

分享给朋友:
您可能感兴趣的文章:
随机阅读: