SpectoLabs / hoverfly-java

Java binding for Hoverfly
Apache License 2.0
168 stars 58 forks source link

Matching by multiple rules #192

Closed alshenetsky closed 4 years ago

alshenetsky commented 5 years ago

Is there any possibility to match by multiple rules? Like

 hoverfly.verify(service(auditUrl)
            .post("/api/v1/logs")
            .body(contains("123.45.14.90"))
            .body(contains("Test-User-Agent")))

to match both .body( ) conditions

tommysitu commented 5 years ago

It's not possible at the moment, but it will once Matcher Chaining is implemented; https://github.com/SpectoLabs/hoverfly/issues/761

jhigueras commented 4 years ago

What is the status of this issue? I have the same need.

As I understand, now it's only a matter of the RequestMatcherBuilder. I've tested in the hoverfly rest api and multiple matchers are supported. It address that by an "and" operator between them.

Thanks!

tommysitu commented 4 years ago

@jhigueras good for pointing that out. It's different from the matcher chaining one where it takes the result from the previous matcher and do further matching.

we already support multiple matchers so I can update the DSL this week.

tommysitu commented 4 years ago

done, it's supported in 0.13.1-SNAPSHOT