Enum Class MockReset
- All Implemented Interfaces:
- Serializable,- Comparable<MockReset>,- Constable
Reset strategy used on a mock bean.
 
Usually applied to a mock via the @MockitoBean or
 @MockitoSpyBean annotation but can also be directly
 applied to any mock in the ApplicationContext using the static methods
 in this class.
- Since:
- 6.2
- Author:
- Phillip Webb, Sam Brannen
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum Constants
- 
Method SummaryModifier and TypeMethodDescriptionstatic org.mockito.MockSettingsafter()Createsettingsto be used with mocks where reset should occur after each test method runs.static org.mockito.MockSettingsApplyMockResetto existingsettings.static org.mockito.MockSettingsbefore()Createsettingsto be used with mocks where reset should occur before each test method runs.static MockResetReturns the enum constant of this class with the specified name.static MockReset[]values()Returns an array containing the constants of this enum class, in the order they are declared.static org.mockito.MockSettingswithSettings(MockReset reset) Createsettingsto be used with mocks where a specific reset should occur.
- 
Enum Constant Details- 
BEFOREReset the mock before the test method runs.
- 
AFTERReset the mock after the test method runs.
- 
NONEDo not reset the mock.
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
beforepublic static org.mockito.MockSettings before()Createsettingsto be used with mocks where reset should occur before each test method runs.- Returns:
- mock settings
 
- 
afterpublic static org.mockito.MockSettings after()Createsettingsto be used with mocks where reset should occur after each test method runs.- Returns:
- mock settings
 
- 
withSettingsCreatesettingsto be used with mocks where a specific reset should occur.- Parameters:
- reset- the reset type
- Returns:
- mock settings
 
- 
apply
 
-