Reputation: 101
I have a class that has a static method that passes in request and that calls server to retrieve the response. is there a way to mock that since it unit test I do not want to make a service call.
String jsonResponse = getMeMyMoney(request)
protected static String getMeMyMoney(request)
{
response = executeService(request)
return response
}
I tried this which is supposed to bypass the method but it still went it. Any one knows how to do this
doReturn("1").when(TestClass.getMeMyMoney("S"));
Upvotes: 0
Views: 332