
com.confluex.mock.http.matchers.HttpRequestMatcher.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of confluex-mock-http Show documentation
Show all versions of confluex-mock-http Show documentation
Testing library for mocking interactions to external HTTP servers
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