strikt-spring / strikt.spring / strikt.api.Assertion.Builder

Extensions for strikt.api.Assertion.Builder

contentType

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.

val <T : ServletResponse> Builder<T>.contentType: Builder<MediaType?>

contentTypeIsCompatibleWith

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

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

isCompatibleWith

Asserts that the subject is compatible with expected.

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

statusCodeIs

Asserts that the status code is equal to expected.

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

statusCodeIs1xxInformational

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

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

statusCodeIs2xxSuccess

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

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

statusCodeIs3xxRedirection

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

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

statusCodeIs4xxClientError

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

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

statusCodeIs5xxServerError

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

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