Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers | ||||
| ||||
Ans. When we Mock an object and then make a reference to any method using mocked object reference , java never makes a call to that method and looks for mocked value to be returned or null if none specified. But If we want that to be overridden and want java to make actual method call upon using mocked object reference, this method can be used. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  junit  mocking  java unit testing  Mockito | ||||
Related Questions | ||||
Have you ever tried mocking static methods ? | ||||
Have you ever used PowerMock ? If yes , which mocking framework you have used it with ? | ||||
How can you verify if there were interactions with a static method using PowerMock ? | ||||