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

com.confluex.mock.http.matchers.HttpRequestMatcher.groovy Maven / Gradle / Ivy

There is a newer version: 0.4.3
Show newest version
package com.confluex.mock.http.matchers

import com.confluex.mock.http.ClientRequest

class HttpRequestMatcher {

    private Closure matcher

    public HttpRequestMatcher(Closure closure) {
        this.matcher = closure
    }

    boolean matches(ClientRequest request) {
        matcher(request)
    }

    HttpRequestMatcher and(HttpRequestMatcher otherMatcher) {
        def left = this
        def right = otherMatcher
        new HttpRequestMatcher({ ClientRequest request ->
            left.matches(request) && right.matches(request)
        })
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy