public enum MockReset extends Enum<MockReset>
@MockBean
annotation but can also be directly applied to any mock in
the ApplicationContext
using the static methods.ResetMocksTestExecutionListener
Enum Constant and Description |
---|
AFTER
Reset the mock after the test method runs.
|
BEFORE
Reset the mock before the test method runs.
|
NONE
Don't reset the mock.
|
Modifier and Type | Method and Description |
---|---|
static org.mockito.MockSettings |
after()
Create
settings to be used with mocks where reset should occur
after each test method runs. |
static org.mockito.MockSettings |
apply(MockReset reset,
org.mockito.MockSettings settings)
Apply
MockReset to existing settings . |
static org.mockito.MockSettings |
before()
Create
settings to be used with mocks where reset should occur
before each test method runs. |
static MockReset |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MockReset[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static org.mockito.MockSettings |
withSettings(MockReset reset)
Create
settings to be used with mocks where a specific reset
should occur. |
public static final MockReset BEFORE
public static final MockReset AFTER
public static final MockReset NONE
public static MockReset[] values()
for (MockReset c : MockReset.values()) System.out.println(c);
public static MockReset valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static org.mockito.MockSettings before()
settings
to be used with mocks where reset should occur
before each test method runs.public static org.mockito.MockSettings after()
settings
to be used with mocks where reset should occur
after each test method runs.public static org.mockito.MockSettings withSettings(MockReset reset)
settings
to be used with mocks where a specific reset
should occur.reset
- the reset typeCopyright © 2020 Pivotal Software, Inc.. All rights reserved.