@Beta public enum MockNature extends java.lang.Enum<MockNature>
MockingApi
factory method.Enum Constant and Description |
---|
MOCK
A mock object whose method calls are verified, which instantiates class-based mock objects with Objenesis,
and whose strategy for responding to unexpected method calls is
ZeroOrNullResponse . |
SPY
A mock object whose method calls are verified, which instantiates class-based mock objects by calling a
real constructor, and whose strategy for responding to unexpected method calls is
CallRealMethodResponse . |
STUB
A mock object whose method calls are not verified, which instantiates class-based mock objects with Objenesis,
and whose strategy for responding to unexpected method calls is
EmptyOrDummyResponse . |
Modifier and Type | Method and Description |
---|---|
IDefaultResponse |
getDefaultResponse()
Returns the strategy for responding to unexpected method calls.
|
boolean |
isUseObjenesis()
Tells whether class-based mock objects should be instantiated with the Objenesis library (if available),
or by calling a real constructor.
|
boolean |
isVerified()
Tells whether method calls should be verified.
|
static MockNature |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static MockNature[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MockNature MOCK
ZeroOrNullResponse
.public static final MockNature STUB
EmptyOrDummyResponse
.public static final MockNature SPY
CallRealMethodResponse
.public static MockNature[] values()
for (MockNature c : MockNature.values()) System.out.println(c);
public static MockNature valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isVerified()
public boolean isUseObjenesis()
public IDefaultResponse getDefaultResponse()
Copyright © 2017. All rights reserved