Class AbstractStatusAssertions<E,R> 
java.lang.Object
org.springframework.test.web.support.AbstractStatusAssertions<E,R> 
- Type Parameters:
- E- the type of the exchange result
- R- the type of the response spec
- Direct Known Subclasses:
- StatusAssertions, StatusAssertions
Assertions on the response status.
- Since:
- 7.0
- Author:
- Rob Worsnop, Rossen Stoyanchev
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractStatusAssertions(E exchangeResult, R responseSpec) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidassertWithDiagnostics(Runnable assertion) Subclasses must implement this to assert with diagnostics.protected EReturn the exchange result.protected Rprotected abstract HttpStatusCodeSubclasses must implement this to provide access to the response status.Assert the response status code is in the 1xx range.Assert the response status code is in the 2xx range.Assert the response status code is in the 3xx range.Assert the response status code is in the 4xx range.Assert the response status code is in the 5xx range.Assert the response status code isHttpStatus.ACCEPTED(202).Assert the response status code isHttpStatus.BAD_REQUEST(400).Assert the response status code isHttpStatus.CREATED(201).isEqualTo(int status) Assert the response status as an integer.isEqualTo(HttpStatusCode status) Assert the response status as anHttpStatusCode.Assert the response status code isHttpStatus.FORBIDDEN(403).isFound()Assert the response status code isHttpStatus.FOUND(302).Assert the response status code isHttpStatus.NO_CONTENT(204).Assert the response status code isHttpStatus.NOT_FOUND(404).Assert the response status code isHttpStatus.NOT_MODIFIED(304).isOk()Assert the response status code isHttpStatus.OK(200).Assert the response status code isHttpStatus.PERMANENT_REDIRECT(308).Assert the response status code isHttpStatus.SEE_OTHER(303).Assert the response status code isHttpStatus.TEMPORARY_REDIRECT(307).Assert the response status code isHttpStatus.UNAUTHORIZED(401).reasonEquals(String reason) Assert the response error message.Consume the response status value as an integer.
- 
Constructor Details- 
AbstractStatusAssertions
 
- 
- 
Method Details- 
getExchangeResultReturn the exchange result.
- 
getResponseSpec
- 
getStatusSubclasses must implement this to provide access to the response status.
- 
assertWithDiagnosticsSubclasses must implement this to assert with diagnostics.
- 
isEqualToAssert the response status as anHttpStatusCode.
- 
isEqualToAssert the response status as an integer.
- 
isOkAssert the response status code isHttpStatus.OK(200).
- 
isCreatedAssert the response status code isHttpStatus.CREATED(201).
- 
isAcceptedAssert the response status code isHttpStatus.ACCEPTED(202).
- 
isNoContentAssert the response status code isHttpStatus.NO_CONTENT(204).
- 
isFoundAssert the response status code isHttpStatus.FOUND(302).
- 
isSeeOtherAssert the response status code isHttpStatus.SEE_OTHER(303).
- 
isNotModifiedAssert the response status code isHttpStatus.NOT_MODIFIED(304).
- 
isTemporaryRedirectAssert the response status code isHttpStatus.TEMPORARY_REDIRECT(307).
- 
isPermanentRedirectAssert the response status code isHttpStatus.PERMANENT_REDIRECT(308).
- 
isBadRequestAssert the response status code isHttpStatus.BAD_REQUEST(400).
- 
isUnauthorizedAssert the response status code isHttpStatus.UNAUTHORIZED(401).
- 
isForbiddenAssert the response status code isHttpStatus.FORBIDDEN(403).
- 
isNotFoundAssert the response status code isHttpStatus.NOT_FOUND(404).
- 
reasonEquals
- 
is1xxInformationalAssert the response status code is in the 1xx range.
- 
is2xxSuccessfulAssert the response status code is in the 2xx range.
- 
is3xxRedirectionAssert the response status code is in the 3xx range.
- 
is4xxClientErrorAssert the response status code is in the 4xx range.
- 
is5xxServerErrorAssert the response status code is in the 5xx range.
- 
value
 
-