Mockito
Mocking framework for Java unit tests.
Execution & architecture flow
- Create mock
- Stub: when(...).thenReturn
- Run code under test
- verify() calls
Engineering capabilities
- Stubbing return values and exceptions
- Verifying interactions and invocation order
- Argument matchers and captors
- Spies for partial mocking
Where used
- Java testing at Oracle