Class MockitoTestExecutionListener

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

public class MockitoTestExecutionListener extends AbstractTestExecutionListener
TestExecutionListener to enable @MockBean and @SpyBean support. Also triggers MockitoAnnotations.openMocks(Object) when any Mockito annotations used, primarily to allow @Captor annotations.

To use the automatic reset support of @MockBean and @SpyBean, configure ResetMocksTestExecutionListener as well.

Since:
1.4.2
Author:
Phillip Webb, Andy Wilkinson, Moritz Halbritter
See Also: