|
|
@ -33,13 +33,18 @@ import org.springframework.util.ReflectionUtils;
|
|
|
|
import org.springframework.util.ReflectionUtils.FieldCallback;
|
|
|
|
import org.springframework.util.ReflectionUtils.FieldCallback;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* {@link TestExecutionListener} to trigger {@link MockitoAnnotations#openMocks(Object)}
|
|
|
|
* {@link TestExecutionListener} to enable {@link MockBean @MockBean} and
|
|
|
|
* when {@link MockBean @MockBean} annotations are used. Primarily to allow
|
|
|
|
* {@link SpyBean @SpyBean} support. Also triggers
|
|
|
|
* {@link Captor @Captor} annotations.
|
|
|
|
* {@link MockitoAnnotations#openMocks(Object)} when any Mockito annotations used,
|
|
|
|
|
|
|
|
* primarily to allow {@link Captor @Captor} annotations.
|
|
|
|
|
|
|
|
* <p>
|
|
|
|
|
|
|
|
* To use the automatic reset support of {@code @MockBean} and {@code @SpyBean}, configure
|
|
|
|
|
|
|
|
* {@link ResetMocksTestExecutionListener} as well.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Phillip Webb
|
|
|
|
* @author Phillip Webb
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
* @since 1.4.2
|
|
|
|
* @since 1.4.2
|
|
|
|
|
|
|
|
* @see ResetMocksTestExecutionListener
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class MockitoTestExecutionListener extends AbstractTestExecutionListener {
|
|
|
|
public class MockitoTestExecutionListener extends AbstractTestExecutionListener {
|
|
|
|
|
|
|
|
|
|
|
|