Class MockitoTestExecutionListener

java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.springframework.test.context.bean.override.mockito.MockitoTestExecutionListener
All Implemented Interfaces:
Ordered, TestExecutionListener

public class MockitoTestExecutionListener extends AbstractTestExecutionListener
TestExecutionListener that enables @MockitoBean and @MockitoSpyBean support. Also triggers MockitoAnnotations.openMocks(Object) when any Mockito annotations are used, primarily to support @Captor annotations.

The automatic reset support for @MockBean and @SpyBean is handled by the MockitoResetTestExecutionListener.

Since:
6.2
Author:
Simon Baslé, Phillip Webb, Andy Wilkinson, Moritz Halbritter
See Also: