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
1
vote
0 answers

pact-jvm-server Complete returns 400

I've got a pact-jvm-server instance in Docker and when ever I call the /create method it creates a stub server and returns the correct responses. But now when I try to delete the stub server on the selected port with /complete call and port in body…
cotnic
  • 158
  • 2
  • 11
0
votes
1 answer

Validate Provider Build Verification for the Consumer Pacts with dynamic auth token

Can someone help me understand, how this scenario is handled? Here are the steps what I am following Consumer pushed the Pacts to PACT Broker. Once a new version is published, I trigger the Provider verification Pipeline and verify the pacts…
Gowtham
  • 53
  • 3
  • 10
0
votes
1 answer

Pact: use a query parameter on consumer side but exclude it from the contract

Imagine the scenario where the consumer production code under test is adding an API key as query parameter when calling the provider because it's required by some intermediate layers between the consumer and provider (typically an API…
Gaël J
  • 11,274
  • 4
  • 17
  • 32
0
votes
1 answer

@DefaultRequestValues replacement in pact jUnit5

I am trying to migrate my pact consumer tests from jUnit4 to jUnit5. I've run across a problem with @DefaultRequestValues annotation, which is missing in pact-jvm-consumer-junit5. In jUnit4 I was using it as follows: @DefaultRequestValues def…
Lesiak
  • 22,088
  • 2
  • 41
  • 65
0
votes
1 answer

Pact JVM, get array without any root as response

Using Pack for JVM using Junit5. Maven dependency that I have used is as follows. au.com.dius.pact.consumer junit5 test I am trying to create DslPart…
MMR
  • 33
  • 7
0
votes
1 answer

How to return json array with PactDslJsonArray in consumer tests?

I'm trying to write a consumer test and the following json array will be my response. [ { "additionalInfo": { "details": { "logo": "German Logo" } }, "flagRequired": true, "name": "Germany" }, { …
Ozzy
  • 3
  • 2
0
votes
0 answers

One of the two identical consumer pact tests gets "expected status of 200 but was 404"

I created 2 identical consumer pact tests each consuming the same service of a provider. When I run provider contract test, one consumer pact passes but the other gets this error: Verifying a pact between Mobil Mudurluk Fatura Ekibi and…
Cagin Uludamar
  • 372
  • 1
  • 3
  • 16
0
votes
1 answer

How to upload consumer contract to official Pact Broker

I can do this using the following pom entry: au.com.dius.pact.provider maven 4.1.17
Cagin Uludamar
  • 372
  • 1
  • 3
  • 16
0
votes
2 answers

"Skipping publishing verification results" error in pact for JUnit 4

When I run JUnit tests, contract tests run as expected but the results are not published to the pact broker. What do I need to do here? Here is the message I see on the console: Skipping publishing verification results for source…
Cagin Uludamar
  • 372
  • 1
  • 3
  • 16
0
votes
1 answer

Pact provider test gets InitializationError but consumer can upload the contract

I'm trying to run a simple provider contract test for a pact uploaded to the pactflow broker by a consumer test which can run without problems on the same PC. When I run the provider test I see this log: 2023-03-03 09:52:35.575 INFO 22944 --- [ …
Cagin Uludamar
  • 372
  • 1
  • 3
  • 16
0
votes
1 answer

Is it possible to use a an existing mock-server using pact-jvm and Junit5?

Is it possible to configure an existing Pact Mock Server using Pact Junit5 Consumer? I know it is possible to write my own Pact Plugin just for that but it seems overkill. I do not want the Junit Framework to create the Mock Server for me but I want…
0
votes
0 answers

Error when running my first pact-jvm test

I'm new to contract Testing Automation and I've written my first test using jvm-pact. I'm using junit5. Below is the code @ExtendWith(PactConsumerTestExt.class) @PactTestFor(providerName = "testProvider", port = "8081") public class ConsumerTests { …
Poo M
  • 31
  • 3
0
votes
1 answer

is there any way to download pact contract (.json) file from pact broker using java?

by using Java, i am trying to download pact contract on provider side. Please suggest any way or tool to Download contract from pact broker on provider side.
KB1
  • 51
  • 5
0
votes
0 answers

No Pact files were found to verify

I am facing weird issue for pact testing. When I use local pact-broker same test is passing however, when I use remote pact-broker test is failing. systemProperty 'pactbroker.url', 'https://pact-broker.internal-dev.com/' // Test is…
Pati Ram Yadav
  • 815
  • 1
  • 8
  • 22
0
votes
1 answer

Pact consumer contact gives au.com.dius.pact.consumer.PactMismatchesException

I am new to Pact contract testing Gradle dependencies dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' testImplementation 'org.springframework.boot:spring-boot-starter-test' //pact …
Shashwat
  • 2,342
  • 1
  • 17
  • 33