Enum Class CaseKind
- All Implemented Interfaces:
Serializable,Comparable<CaseKind>,Constable
What a contract case tests: which response the contract declares for its request, and so
what a target must do before the request is sent.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA request with exactly one constraint violated, expecting the configured invalid-request status.A valid request whoseAcceptno declared response offers, expecting the declared406.A valid request naming a resource that does not exist, expecting the declared404.A valid request, expecting an exact2xxthe operation declares.The valid body sent with a content type the operation does not accept, expecting the declared415. -
Method Summary
Modifier and TypeMethodDescriptionstatic CaseKindThe kind a setting name names.booleanWhether a case of this kind can only pass when the target is in a particular state, which a fixture must arrange before the request is sent.setting()How a project names this kind in thederivesetting, such asnotFound.settings()Every kind's setting name, in canonical order: the default of thederivesetting.static CaseKindReturns the enum constant of this class with the specified name.static CaseKind[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUCCESS
A valid request, expecting an exact2xxthe operation declares. Requires state: the resource exists for a read, an update or a delete, and does not for a create. -
NOT_FOUND
A valid request naming a resource that does not exist, expecting the declared404. Requires state: the resource the path names must be absent. -
NOT_ACCEPTABLE
A valid request whoseAcceptno declared response offers, expecting the declared406. -
UNSUPPORTED_MEDIA_TYPE
The valid body sent with a content type the operation does not accept, expecting the declared415. -
INVALID_REQUEST
A request with exactly one constraint violated, expecting the configured invalid-request status.
-
-
Method Details
-
values
Returns 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
-
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.)- 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 nameNullPointerException- if the argument is null
-
setting
How a project names this kind in thederivesetting, such asnotFound.- Returns:
- the name
-
requiresState
public boolean requiresState()Whether a case of this kind can only pass when the target is in a particular state, which a fixture must arrange before the request is sent.- Returns:
- whether it requires state
-
settings
Every kind's setting name, in canonical order: the default of thederivesetting.- Returns:
- the names
-
ofSetting
The kind a setting name names.- Parameters:
setting- the name, such asnotFound- Returns:
- the kind
- Throws:
IllegalArgumentException- when no kind has that name
-