Java - Interview Questions and Answers for 'Mocking' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Mocking' - 5 question(s) found - Order By Newest

 Q1. What are the steps to be performed while coding Junit with Mocking framework ?
admin
info@buggybread.com
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 :   

   Like      Discuss      Correct / Improve     junit   mocking frameworks   mock   unit testing   java   white box testing


 Q2. Name few Java Mocking frameworks ?
admin
info@buggybread.com
Ans. Mockito, PowerMock, EasyMock, JMock, JMockit

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     junit   mocking frameworks   mock   architecture   white box testing


 Q3. 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
Anonymous
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 :   

   Like      Discuss      Correct / Improve     mocking frameworks   mockito   unit testing   junits


 Q4. Can we mock static methods ?Testing2017-08-17 19:32:01

Ans. Yes we can use PowerMock. With Mockito , we cannot mock static methods.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     mocking fraeworks  mocking static methods


 Q5. How do you use Mock frmaework to test webservices in any of your previous project ?Testing2017-08-24 14:06:46

Ans. We were having client methods to call web services and were mocking the client method call using Mockito.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     mocking  testing




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: