Category Archives: Mockito

What are the Benefits of Mockito ?

Below are the main advantages or benefits of Mockito: Annotation Support: It supports creating mocks using various annotations. No Handwriting: We do not need to write mock objects by own. Return value support: Supports return values. Exception support: It supports exceptions. Order check support: It also supports check on the order of method calls. Refactoring Safe: Even if we… Read More »

Why Need for mocking ?

Before using the Mocking technique, Let’s try to understand the reasons for using mocking. Why Need for mocking (Reason-01)? If you want to test a component that depends on the other component, but that component is under development. It generally happens when working in a team and different components are divided between several team members.… Read More »

What is Mocking and Mockito?

   What is Mocking?  Mocking is a way to test the functionality of a class in an isolation fashion. When we use mockito then we do not require a database connection or file server read or properties file to read to test functionality. The mocking object usually does the mocking of the real service. A… Read More »