package strikt.spring

Fields

Name Description
val contentType: Assertion.Builder<MediaType?>

Maps this assertion to an assertion on the content type of the servlet response. If the subject has no Content-Type header the subject of the mapped assertion is null.

Methods

isCompatibleWith

infix fun <T> Assertion.Builder<T>.isCompatibleWith(expected: MediaType): Assertion.Builder<MediaType>

Asserts that the subject is compatible with expected.

For example, a subject of application/json;charset=UTF-8 is compatiblewith the media type application/json, but not with the media type application/x-yaml.

Receiver

Name Description
Assertion.Builder<T>

Parameters

Name Description
expected: MediaType

ReturnValue

Name Description
Assertion.Builder<MediaType>

statusCodeIs1xxInformational

fun <T> Assertion.Builder><ResponseEntity<T>>.statusCodeIs1xxInformational(): Assertion.Builder><ResponseEntity<T>>

Asserts that the status code is a 1xx Information response.

Receiver

Name Description
Assertion.Builder><ResponseEntity<T>>

ReturnValue

Name Description
Assertion.Builder><ResponseEntity<T>>

statusCodeIs2xxSuccess

fun <T> Assertion.Builder><ResponseEntity<T>>.statusCodeIs2xxSuccess(): Assertion.Builder><ResponseEntity<T>>

Asserts that the status code is a 2xx Success response.

Receiver

Name Description
Assertion.Builder><ResponseEntity<T>>

ReturnValue

Name Description
Assertion.Builder><ResponseEntity<T>>

statusCodeIs3xxRedirection

fun <T> Assertion.Builder><ResponseEntity<T>>.statusCodeIs3xxRedirection(): Assertion.Builder><ResponseEntity<T>>

Asserts that the status code is a 3xx Redirect response.

Receiver

Name Description
Assertion.Builder><ResponseEntity<T>>

ReturnValue

Name Description
Assertion.Builder><ResponseEntity<T>>

statusCodeIs4xxClientError

fun <T> Assertion.Builder><ResponseEntity<T>>.statusCodeIs4xxClientError(): Assertion.Builder><ResponseEntity<T>>

Asserts that the status code is a 4xx Client Error response.

Receiver

Name Description
Assertion.Builder><ResponseEntity<T>>

ReturnValue

Name Description
Assertion.Builder><ResponseEntity<T>>

statusCodeIs5xxServerError

fun <T> Assertion.Builder><ResponseEntity<T>>.statusCodeIs5xxServerError(): Assertion.Builder><ResponseEntity<T>>

Asserts that the status code is a 5xx Server Error response.

Receiver

Name Description
Assertion.Builder><ResponseEntity<T>>

ReturnValue

Name Description
Assertion.Builder><ResponseEntity<T>>

statusCodeIs

infix fun <T> Assertion.Builder><ResponseEntity<T>>.statusCodeIs(expected: Int): Assertion.Builder><ResponseEntity<T>>

Asserts that the status code is equal to expected.

Receiver

Name Description
Assertion.Builder><ResponseEntity<T>>

Parameters

Name Description
expected: Int

ReturnValue

Name Description
Assertion.Builder><ResponseEntity<T>>

statusCodeIs

infix fun <T> Assertion.Builder><ResponseEntity<T>>.statusCodeIs(expected: HttpStatus): Assertion.Builder><ResponseEntity<T>>

Asserts that the status code is equal to expected.

Receiver

Name Description
Assertion.Builder><ResponseEntity<T>>

Parameters

Name Description
expected: HttpStatus

ReturnValue

Name Description
Assertion.Builder><ResponseEntity<T>>

contentTypeIsCompatibleWith

infix fun <T> Assertion.Builder<T>.contentTypeIsCompatibleWith(expected: MediaType): Assertion.Builder<T>

Asserts that the content type of the subject is compatible with expected.

Receiver

Name Description
Assertion.Builder<T>

Parameters

Name Description
expected: MediaType

ReturnValue

Name Description
Assertion.Builder<T>