KnechtRootrecht
KnechtRootrecht

Reputation: 493

pact-jvm create pact manually by hand

I'm exploring the chance to use pact-jvm with a client and provider that already exist and that are working productively. Currently I try to create a pact file per hand and verify it for the provider. I wonder if this even makes sense. I fear maybe I didn't get the point. Is this okay or am I off the track?

Thanks in advance

Upvotes: 0

Views: 223

Answers (1)

Matthew Fellows
Matthew Fellows

Reputation: 4065

As a general rule, creating the contract by hand - that is, manually crafting a JSON document according to the pact specification - is an anti-pattern in Pact.

We often see people using Pact where there are existing integrations, the first step is creating the consumer tests in the consumer code base and getting it to publish the pacts. Even just for a subset of its functionality to begin with.

Then you can look to verify it with the provider. Eventually, you add more and more tests until the complete functionality is covered at which point, you can remove any existing or invalidated E2E suites!

Upvotes: 2

Related Questions