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.
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 :
Ans. Initialize required objects for working with mocks and tested method
Set the mock behaviour on dependent objects
Execute the tested method
Perform assertions
Verify if a method is invoked or not
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  junit   mocking frameworks   mock   unit testing   java   white box testing  Mockito
Q10. Which of the following is not the advantage of Mocking frameworks ?
a. It helps testing the module independently b. It helps in faster unit testing c. It helps in testing code even when external dependencies like service calls are not working d. It helps in doing end to end Integration Testing
Ans. It helps in doing end to end Integration Testing
Help us improve. Please let us know the company, where you were asked this question :