Package org.springframework.test.context.bean.override.mockito
@NonNullApi
@NonNullFields
package org.springframework.test.context.bean.override.mockito
Bean overriding mechanism based on Mockito mocking and spying.
-
ClassDescription
@MockitoBean
is an annotation that can be used in test classes to override a bean in the test'sApplicationContext
with a Mockito mock.Container for@MockitoBean
annotations which allows@MockitoBean
to be used as a repeatable annotation at the type level — for example, on test classes or interfaces implemented by test classes.TestExecutionListener
that resets any mock beans that have been marked with aMockReset
.@MockitoSpyBean
is an annotation that can be used in test classes to override a bean in the test'sApplicationContext
with a Mockito spy that wraps the original bean instance.Container for@MockitoSpyBean
annotations which allows@MockitoSpyBean
to be used as a repeatable annotation at the type level — for example, on test classes or interfaces implemented by test classes.Reset strategy used on a mock bean.AMockResolver
for testing Spring applications with Mockito.