@Pact(consumer = "idm-client")
public PactFragment getUsersFragment(PactDslWithProvider builder) {
return builder
.given("a user with an id named 'user' exists")
.uponReceiving("get all users")
.path("idm/user")
.method("GET")
.willRespondWith()
.status(200)
.body(new PactDslJsonArray()
.minArrayLike(1)
.uuid("id")
.stringType("username")
.stringType("email")
.closeObject())
.toFragment();
}
"interactions": [ { "providerState": "a user with an id named 'user' exists", "description": "get all users", "request": { "method": "GET", "path": "idm/user", "body": null }, "response": { "status": 200, "headers": { "Content-Type": "application/json; charset=UTF-8" }, "body": [ { "email": "dnpVDMuTXwIduMLiOTKg", "id": "946e570b-386d-4a22-b5cc-a0b429f063aa", "username": "vhICeWvqPNYeZErsIWkZ" } ], "matchingRules": { "$.body[*].username": { "match": "type" }, "$.body[*].email": { "match": "type" }, "$.body[*].id": { "regex": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" } } } } ],Enter code here...java.lang.AssertionError: []: Expected 1 values but got 2
$ diff minArrayLike5 maxArrayLike5
24,26c24,26
< "email": "nrUfIlvNMdmjSZwsNPHv",
< "id": "cae2db77-487a-4b6b-8e6f-9cb7411ab2b1",
< "userName": "rzFvcALwDaqNBDghdalp"
---
> "email": "DNoDFLraARDfMgKAygIA",
> "id": "e0f1456b-3257-490a-aff3-757b016a8d9d",
> "userName": "gMjLmufHxdJctMzroWRv"
--
You received this message because you are subscribed to the Google Groups "Pact" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pact-support...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.