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
3
votes
0 answers

Skip Preauthorise annotation for Pact test

Doing PACT testing for application having microservices architecture and test case is failing due to authentication. Either some way to skip authorisation or i'm not able to find where should i give authorisation at provider side. I tried with…
3
votes
1 answer

scala-pact provider verification using specific service url

I'm trying to perform provider verification using scala-pact implementation. My dockerized service under test is located at http://localhost:9999/my_test_label/my_service. There is def runVerificationAgainst[F[_]](protocol: String, host: String,…
Klikam
  • 31
  • 1
3
votes
1 answer

Testing React API - Unexpected Token error

I have a basic React app created using create-react-app. I am trying to get started with Pact to do contract testing on my API using the Javascript implementation guide. I have followed the steps in the above link exactly and have created a basic…
darkpool
  • 13,822
  • 16
  • 54
  • 89
3
votes
2 answers

How to use pact with typescript

I am trying to implement pact-node using typescript. (https://github.com/pact-foundation/pact-node). I am having some problems and the resulting errors messages are not very descriptive. It's probably something I am doing wrong in the setup, a lot…
user1523236
  • 1,403
  • 3
  • 20
  • 43
3
votes
1 answer

PACT and selenium

I'm a automation engineer and I was wondering if pact could help us in any way to increase test coverage I'm new to PACT, but I was thinking if it could be possible to generate a pact file with existing selenium web tests? It is that the contract…
jarumski
  • 31
  • 2
3
votes
1 answer

Pact JS: Provider testing

Using Pact JS to test both my consumers and providers. I’m successfully able to generate a pact file, and I’d like to verify those against my provider. I have a few questions with regards to testing the provider: Do I need to start my provider…
3
votes
2 answers

Pact: how to set up provider states

I'm looking at the Python implementation of Pact and trying to set up provider states. It seems to say that the way to do it is for the provider to have an endpoint built into the service that is called to put the provider in the correct state. …
ewok
  • 20,148
  • 51
  • 149
  • 254
3
votes
2 answers

How to use PactJS with Angular 2/4/5 to tests services

I'm trying to use PactJS to test some of my Angular Services. I'm using: "@pact-foundation/karma-pact": "^2.1.1", "pact": "^4.2.1", "pact-web": "^4.2.1", I can't get the test to run successfully. Without using async the subscribe callback never…
Steve Fitzsimons
  • 3,754
  • 7
  • 27
  • 66
3
votes
2 answers

Publish pacts to a pact broker using maven plugin

I was able to generate a pact file and then verify it using the maven plugin. Now, I am trying to publish the pacts using a pact broker. What I have done so far is based on the below link- …
ljs
  • 495
  • 1
  • 8
  • 23
3
votes
2 answers

pact-jvm : how to solve au.com.dius.pact.consumer.PactMismatchesException

I am trying to generate a pact between 2 of our services using pact-JVM. But when I try to run the Java class, I get this exception. 1) I suspect something is wrong with the Pact body, is that correct? There is an extra 'message' parameter in the…
ljs
  • 495
  • 1
  • 8
  • 23
3
votes
1 answer

Testing same API for multiple response sets

We've been trying to test an API exposed from a microservice (say GET /contacts) which is being consumed by another microservice. In order to avoid integration tests, we created consumer-driven contract tests where the consumer microservice created…
Hawkes
  • 457
  • 1
  • 4
  • 16
2
votes
1 answer

Pact Testing in Spring Boot | Error in installing the au.com.dius.pact:consumer:4.6.1 in Intellij

I am trying to learn Pact Testing but I am having issue in installing au.com.dius.pact:consumer:4.6.1 in Intellij. I am using gradle for the build. I am using this thing in the build.gradle file implementation…
2
votes
1 answer

Pact - Ignore some interactions when verifying on provider side

Let's say I have a provider which is involved in 2 interactions (with one consumer or many, it shouldn't matter). On the provider side, I am able to handle one interaction in the sense that I know how to interpret the provider state of one…
Gaël J
  • 11,274
  • 4
  • 17
  • 32
2
votes
1 answer

Setting mock ports for multiple providers in pact-jvm

I am trying to learn the pact framework by rewriting some of our wiremock tests that test our application written in java and springboot. I have provided a simplified example of where we end up getting…
Kevin de Boer
  • 115
  • 1
  • 2
  • 4
2
votes
1 answer

How to programmatically launch a .NET 6 minimal API with no Startup class

I am trying to implement PactNet contract tests on our provider project. However the issue is that we are using a Minimal API so instead of having a Startup.cs and Program.cs class we just have it all rolled into one Program.cs. This poses an issue,…
Imer Muhović
  • 109
  • 1
  • 8
1 2
3
43 44