Mockito is a mocking framework, JAVA-based library that is used for effective unit testing of JAVA applications. Mockito is used to mock interfaces so that a dummy functionality can be added to a mock interface that can be used in unit testing.
Mocking is a way to test the functionality of a class in isolation. Mocking does not require a database connection or properties file read or file server read to test a functionality. Mock objects do the mocking of the real service. A mock object returns a dummy data corresponding to some dummy input passed to it.
No Handwriting − No need to write mock objects on your own.
Refactoring Safe − Renaming interface method names or reordering parameters will not break the test code as Mocks are created at runtime.
Return value support − Supports return values.
Exception support − Supports exceptions.
Order check support − Supports check on order of method calls.
Annotation support − Supports creating mocks using annotation.
1) Developer Ready
2) Instant Feedback
Fast interactive watch mode runs only test files related to changed files and is optimized to give signal quickly.
3) Snapshot Testing
Capture snapshots of React trees or other serializable values to simplify testing and to analyze how state changes over time.