Enum Class MockReset
- 所有已实现的接口:
Serializable,Comparable<MockReset>,Constable
Reset strategy used on a mock bean. Usually applied to a mock via the
@MockBean annotation but can also be directly applied to any mock in
the ApplicationContext using the static methods.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb
- 另请参阅:
-
嵌套类概要
嵌套类从类继承的嵌套类/接口 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
枚举常量概要
枚举常量 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static 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 MockResetGet theMockResetassociated with the given mock.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.
-
枚举常量详细资料
-
BEFORE
Reset the mock before the test method runs. -
AFTER
Reset the mock after the test method runs. -
NONE
Don't reset the mock.
-
-
构造器详细资料
-
MockReset
private MockReset()
-
-
方法详细资料
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- 返回:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns 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.)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- 如果参数为空值
-
before
public static org.mockito.MockSettings before()Createsettingsto be used with mocks where reset should occur before each test method runs.- 返回:
- mock settings
-
after
public static org.mockito.MockSettings after()Createsettingsto be used with mocks where reset should occur after each test method runs.- 返回:
- mock settings
-
withSettings
Createsettingsto be used with mocks where a specific reset should occur.- 参数:
reset- the reset type- 返回:
- mock settings
-
apply
ApplyMockResetto existingsettings.- 参数:
reset- the reset typesettings- the settings- 返回:
- the configured settings
-
get
Get theMockResetassociated with the given mock.- 参数:
mock- the source mock- 返回:
- the reset type (never
null)
-