I tried the solution to which it was marked as duplicate, but it did not solve my issue.
I am running a mockito test on a oneMethod()
which is inturn calling 'internalMethod1()
' , the mockito setup that we have is something like this
@RunWith(MockitoJUnitRunner.class)
public class ServiceImplTest {
@Mock
public TdsAllResourcesQueryPortMod getResourceWS;
@InjectMocks
private ServiceImpl service = new ServiceImpl();
@Test
public void testing(){
.....
service.oneMethod();
}
class ServiceImpl
public class ServiceImpl {
public oneMethod(){
internalMethod1();
}
public internalMethod1(){
...
}
}
Is there a good way to avoid the internalmethod1() call? or can I mock the response from this internalMethod1()?