Questions tagged [pact]

Pact is a cross-language tool that provides Consumer Driven Contracts testing.

A Contract is a collection of agreements between a client (Consumer) and an API (Provider) that describes the interactions that can take place between them.

Consumer Driven Contracts is a pattern that drives the development of the Provider from its Consumers point of view.

Pact is a testing tool that guarantees those Contracts are satisfied.

pact.io

658 questions
0
votes
2 answers

Pact matching non JSON body

Is there any way of matching non JSON bodies (either XML, byte or whatever). Looking for the Python solution, however will appreciate any ideas behind that (even monkeypatching).
niobium
  • 13
  • 4
0
votes
1 answer

Pact provider test running app instances

Currently I'm using pact-jvm-consumer/provider-junit_2.11 from au.com.dius lib. Got my consumer pact working and generating pacts, but the problem comes when I try to use these in my provider service. The idea is to make all pacts integrally with…
0
votes
1 answer

Pact - matching an array of integers

I'm using Pact and creating consumer tests. My response body for a specific request looks like: PactDslJsonBody responseBody = new PactDslJsonBody() .stringType("response","success") .array("accounts") …
0
votes
0 answers

Arquillian Cube with Algeron

I am successfully running Arquillian Cube tests, but as soon as arquillian-algeron-pact-consumer-core and pact-jvm-consumer_2.12 are just on the classpath, not even used in the tests, all tests are not executed but green, so errors are never…
MichaelJ
  • 113
  • 6
0
votes
1 answer

pact-jvm testing multi tier authorization

I want to test my authorization-service via pact-jvm. In my request I'm sending a html-body via post, including some metadata to verify the user - including his username and which is also sent in the header where I use Http Basic Auth. I add the…
KnechtRootrecht
  • 493
  • 1
  • 4
  • 18
0
votes
1 answer

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…
KnechtRootrecht
  • 493
  • 1
  • 4
  • 18
0
votes
1 answer

Pact JS (Jest) Pact stop failed; tried calling service 10 times with no result

I'm getting an error with the Pact JS implementation on the consumer side. When I'm trying to run my tests, I'm getting the following error: Pact stop failed; tried calling service 10 times with no result. Attaching snippets of my code below if…
0
votes
1 answer

Pact-python how to test a get request having UUID in URL

I am using pact-python (0.10.0). I want to make a request to a provider with an entity id: /entity/6000d04d-d5d6-4a5f-81d3-7d8a72b46174 but this (6000d04d-d5d6-4a5f-81d3-7d8a72b46174) should exist in the database. what'd be the better…
0
votes
1 answer

Using Pact Framework for MSA using SDKs

I am trying to introduce Pact in our company. However the consumer calls APIs using providers SDKs and the host-port is dynamically determined using Kubernetes. I am new to all this backend technology so trying to understand how do we deal with this…
PaChSu
  • 297
  • 3
  • 13
0
votes
1 answer

Provider to ignore some date and identifier fileds

New to pact, but excited to implement at my current 'micro services' based company I generated some reports that compares JSON responses, all done in ruby. But I am getting stumped by a few keys that are date based and index based. Key: - is…
Vinchbr
  • 49
  • 4
0
votes
1 answer

Pact.io - Need to specify url subdomain in request

I'm new to Pact.io and trying to get contract tests set up on our platform. The app is set up in such a way that each customer account has its own database schema which is directly tied to a URL subdomain. When making an API request, that URL…
0
votes
1 answer

How to generate mock server for pact consumer from contract json file?

I want to use contract file from provider to run tests against consumer. I have { "provider": { "name": "Provider" }, "consumer": { "name": "Consumer" }, "interactions": [ { "description": "Get data", "request": { …
Stepan
  • 41
  • 2
  • 7
0
votes
2 answers

Pact-jvm java noob questions

I have a few noob questions about Pact JVM (Java); If the providers json structure response is already known (for example by querying the api with Postman) ,is it possible to convert Postman json body automatically into a pact contract file without…
zombieboy
  • 116
  • 1
  • 10
0
votes
1 answer

Is it possible to filter pact broker overview page/verification overview by tag?

The pact broker overview page (the index page) displays the verification status of each pact which is very useful. Is it possible to filter this view, by a query parameter or such, so that I can see the verifications for a certain tag? I would like…
Joel Andersson
  • 239
  • 2
  • 7
0
votes
1 answer

How to set regex matchers on PactDslJsonBody in consumer pact version 3.5.3

When upgraded pact.consumer.version to 3.5.3, I am not able to create regex matcher on PactDslJsonBody. Below is code with version 3.2.8: PactDslJsonBody requestBody = createJSONPact(requestBodyJSON, new…
Shilpi
  • 39
  • 5