Questions tagged [pact-jvm]

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

JVM implementation of the consumer driven contract library pact.

From the Ruby Pact website:

Define a pact between service consumers and providers, enabling "consumer driven contract" testing.

Pact provides an RSpec DSL for service consumers to define the HTTP requests they will make to a service provider and the HTTP responses they expect back. These expectations are used in the consumers specs to provide a mock service provider. The interactions are recorded, and played back in the service provider specs to ensure the service provider actually does provide the response the consumer expects.

This allows testing of both sides of an integration point using fast unit tests.

This gem is inspired by the concept of "Consumer driven contracts". See http://martinfowler.com/articles/consumerDrivenContracts.html for more information.

Read Getting started with Pact for more information on how to get going.

Source: https://github.com/DiUS/pact-jvm/

109 questions
0
votes
1 answer

does pact-jvm-provider-maven_2.12 support multiple headers?

When there are multiple headers in the interaction, pact-jvm-provider-maven_2.12 version 3.5.25 throws an exception when I run mvn pact:verify to verify the contract at the provider side Caused by: java.lang.NullPointerException: Cannot set property…
zero_yu
  • 493
  • 5
  • 15
0
votes
2 answers

pact-jvm-provider - JUnit5 Spring - Unable to add authorization headers

I have a Spring Boot application for which I'm writing contract tests using Pact-JVM. It is a provider. I have added the following pact dependencies/configurations in build.gradle: I'm using Java 11, Gradle 6.3 plugins { id 'au.com.dius.pact'…
Amer
  • 13
  • 4
0
votes
1 answer

Can we use pact-jvm for validation soap xml?

I have tried using pact-JVM for an endpoint which returns a soap XML response. For XML response it looks like it does string comparison, Can we do XML validation against XSD or can we write matchers for XML? Need suggestion as well, is it a good…
0
votes
1 answer

WARN: Ignoring unsupported matching rules while verifying pact using pact-python

I'm new to Pact and I am trying to verify a pact on provider side using pact-python but some matching rules are getting ignored. WARN: Ignoring unsupported matching rules {"$.num_issues"=>{"matchers"=>[{"match"=>"integer"}], "combine"=>"AND"},…
Sarthak
  • 5
  • 1
0
votes
1 answer

How to verify PACT test locally before the contract is published to the online broker?

I have a situation where I've access to a contract as a .json file but it's not published yet and it may take some time for this to happen. I want to start writing the verification tests for it, so was thinking of pasting this file manually under…
Francislainy Campos
  • 3,462
  • 4
  • 33
  • 81
0
votes
1 answer

Run Pact Provider Test Class in Sequence

I am using pact-jvm provider spring. I have two different pact(.json) files lets say (order.json and irs.json), i need to run them in sequentially (order followed by irs), but based on alphabetical order the test classes are picked, the irs run…
krishnakumar
  • 173
  • 3
  • 15
0
votes
1 answer

JVM Pact Dsl body for a map of collections

I am going to model a map of collection as the response of my provider using pact dsl, But I can not figure out how. I appreciate if somebody can help me on this. Map> responseBody;
setiabb
  • 529
  • 1
  • 5
  • 13
0
votes
1 answer

how to update the incoming request in pact jvm requestFilter?

I have a spring boot API in java which is using pact-jvm for pact verification. We have a new client who wants to use the same API using a new path, which the gateway will take care of, but this causes issue for pacts, I want to intercept the…
MSeth
  • 81
  • 7
0
votes
1 answer

PACT jvm matching rules are being ignored when running test

I'm using PACT JVM https://github.com/DiUS/pact-jvm/tree/master/provider/pact-jvm-provider-junit I don't know why the matching rules in my contact are being ignored. My HTTP test @RunWith(SpringRestPactRunner.class) // Say JUnit to run tests with…
Ali Tran
  • 7
  • 3
0
votes
1 answer

Seperate Pact Interactions in Provider Verification Tests by Endpoint

I just started to adopt Pact test for my system that consists of one provider service and an Angular frontend as the consumer. I succeeded in setting up both sides, thus, the Angular application generates a (single) pact file with many interactions…
0
votes
1 answer

"No tests found matching Method " error on CDC test with spring and pact

I doing an CDC provider test with pact and spring, I was able to generate the pact file, but when I use the pact json for provider testing , it came out below error :"No tests found matching Method runTest", here is my…
rellocs wood
  • 1,381
  • 4
  • 21
  • 36
0
votes
1 answer

Publishing verification result with tag back to pact Broker with pact-jvm

pact-jvm can publish the result back to the pact broker. However, I can't seem to find the option or a way to publish with a tag, like in the example of the pact broker:
l-lin
  • 1,075
  • 1
  • 11
  • 20
0
votes
1 answer

How to input @TestTarget point when do provider verification?

I am a new learner for pact and I want to know what should I input when do provider verification for provider verification I should fill provided target as localhost only or instead of localhost i also can input actual env's host? which scenario…
0
votes
2 answers

mvn pact:verify does not execute provider state but @State code is executed from IDE

When I execute my provider test from IDE @State method is executed, but mvn pact:verify command does not execute the @State of the provider Provider test…
vasilev21
  • 113
  • 2
  • 4
  • 15
0
votes
1 answer

PACT - Modify header to include oAuth2 token

I am using PACT JVM in the provider side and I need to add an oAuth2 token to the header before a request is made. I have followed the advice in this FAQ https://docs.pact.io/faq#how-do-i-test-oauth-or-other-security-headers and I have created…
user3727540
  • 922
  • 3
  • 11
  • 30