nomeal
nomeal

Reputation: 88

Pact: Minimal Example to test API (JVM)

I am trying to find my way into the Pact Framework, but currently struggling with the basic setup. I think my problem is that I not yet have a real client, i.e. a web front end for example. Still, I would like to start with consumer tests by testing a REST API.

At the moment I connect to this cat API by

@Rule
public PactProviderRuleMk2 mockProvider = new PactProviderRuleMk2("test_provider", "https://cataas.com", 8080, this);

What would be now a simple (Pact-) way to test if a call ("https://cataas.com/cat") returns successful (200)?

PS: I also would be really happy about a link to an actual tutorial.

Upvotes: 1

Views: 349

Answers (1)

Matthew Fellows
Matthew Fellows

Reputation: 4065

There are examples here: https://docs.pactflow.io/docs/examples/

Short in browser tutorials here: https://docs.pactflow.io/docs/tutorials

And hands on workshops here: https://docs.pact.io/implementation_guides/workshops

Upvotes: 2

Related Questions