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

tech.harmonysoft.oss.http.server.mock.request.condition.ParameterName2ValueCondition.kt Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package tech.harmonysoft.oss.http.server.mock.request.condition

import org.mockserver.model.HttpRequest

data class ParameterName2ValueCondition(
    val expected: Map
) : DynamicRequestCondition {

    override fun matches(request: HttpRequest): Boolean {
        return expected.all { (name, value) ->
            request.hasQueryStringParameter(name, value)
        }
    }

    override fun toString(): String {
        return "request has the following query parameters: ${expected.entries.joinToString {
            "${it.key}=${it.value}"
        }}"
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy