All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.http4k.hamkrest.response.kt Maven / Gradle / Ivy

package org.http4k.hamkrest

import com.natpryce.hamkrest.Matcher
import com.natpryce.hamkrest.equalTo
import com.natpryce.hamkrest.has
import org.http4k.core.Response
import org.http4k.core.Status
import org.http4k.core.cookie.Cookie
import org.http4k.core.cookie.cookies

fun hasStatus(expected: Status): Matcher = has(Response::status, equalTo(expected))

fun hasSetCookie(expected: Cookie): Matcher = hasSetCookie(expected.name, equalTo(expected))

fun hasSetCookie(name: String, expected: Matcher): Matcher = has("Cookie '$name'", { r: Response -> r.cookies().find { name == it.name }!! }, expected)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy