<@U9UUY3CU9> am I misunderstanding something on ho...
# pact-jvm
f
@Matt (pactflow.io / pact-js / pact-go) am I misunderstanding something on how pact does these matcher verification, perhaps? 🤔
m
So for clarity, your local Pact consumer test expects a format
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?
I’d need to see the debug logs from the provider test to assert this, probably also the serialised pact file
r
That is probably the default format for dates in your locale
👍 1
f
For the moment of my contract generation, I don’t have any specific assertion for the date type, however this is specified in the expected body with
Copy code
.date("19/08/2016", "dd/MM/YYYY", new Date())
Copy code
@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();
}
However, when my api returns the default 2023-03-04 format, the tests still pass.