Francislainy Campos
10/30/2023, 6:26 AMMatt (pactflow.io / pact-js / pact-go)
dd/MM/yyyy and the consumer test works, and you’re expecting it to fail on the provider side because the format doesn’t match?Matt (pactflow.io / pact-js / pact-go)
rholshausen
10/30/2023, 10:56 PMFrancislainy Campos
10/31/2023, 7:13 AM.date("19/08/2016", "dd/MM/YYYY", new Date())
@Pact(provider = PACT_PROVIDER, consumer = PACT_CONSUMER)
public RequestResponsePact createPact(PactDslWithProvider builder) {
headers.put("Content-Type", "application/json");
headers.put("Accept", "application/json");
DslPart bodyReturned = PactDslJsonArray.arrayEachLike(2)
.uuid("client_id", clientId)
.uuid("purchase_id", randomUUID())
.numberType("value", 1234)
.date("19/08/2016", "dd/MM/YYYY", new Date())
.stringType("card_number", "**** **** **** 1234")
.close();
return builder
.given("A request to retrieve the history of transactions for a client")
.uponReceiving("A request to retrieve the history of transactions for a client")
.pathFromProviderState(path + "${clientId}", path + clientId)
.method(String.valueOf(GET))
.headers(headers)
.willRespondWith()
.body(bodyReturned)
.status(200)
.toPact();
}Francislainy Campos
10/31/2023, 7:13 AM