Questions tagged [pact-java]

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

42 questions
1
vote
1 answer

Why is this pact-jvm provider test failing?

We’ve got a provider test that is only failing on Jenkins, which is preventing me from debugging. Here are some relevant logs from Jenkins: Error Message 0 - $.body.2 -> Expected name='FXUHHqWrZZcodhHBmeLf' but was missing 0) a request to get all…
Fitzoh
  • 776
  • 1
  • 6
  • 12
1
vote
1 answer

PactDslJsonObject getting resolved to Empty Map {}

The object, below, while debugging is being displayed as {} instead of {"types" : ["Ice Cream"] } as one would expect. Why is this happening. PactDslJsonObject resquest = new PactDslJsonObject() …
Antho Christen
  • 1,369
  • 1
  • 10
  • 21
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
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

Is there a way to add pact interaction into to JSON file and add to consumer test code in JAVA

We have a requirement that we need have a pact standalone server and interactions (request/ expected response pairs) in a JSON files and store it in a directory and just add to consumer tests and generate a pact file. I would like to know if this…
0
votes
1 answer

Unauthorised error when publishing java contract to pact flow using jenkins

I have a contract that we can publish to the pact flow broker okay when running mvn pact:publish -Dpactbroker.auth.token=myToken. However, the same contract and maven command gives us an authentication error when running it from Jenkins. Not sure…
Francislainy Campos
  • 3,462
  • 4
  • 33
  • 81
0
votes
1 answer

How to test pact with null data

I am aware of that PACT expects provider data need to be in our control, but I am facing following situation I have pact contract for multiple consumers, all have some mandatory attribute and some are optional attribute, but business logic suppress…
LowCool
  • 1,187
  • 5
  • 25
  • 51
0
votes
1 answer

how to parse the response at pact provider verfication

My scenario is that there are two interactions defined by the consumer, interation1 with state1, and interation2 with state2. After running interation1, there will be an id in the JSON response, and this id has to be used as the query parameter of…
zero_yu
  • 493
  • 5
  • 15
0
votes
1 answer

Pact provider verification fails with : For input string: "\null"

I am trying to validate on the provider side but getting error - Verifying a pact between DataConsumer and DataProvider [Using File pact/DataConsumer-DataProvider.json] Given some state a request for json data Request Failed - For input string:…
0
votes
1 answer

Test Pact provider for json structure only

Looking at Pact for some contract testing, our Real api's have timestamps in the response, so I was looking to validate against the json schema only. In the example here -…
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

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

How to convey to provider a contractual agreement of data format

Is there a way to generate a PACT file to convey data format validation? An exaple of what I'm trying to accomplish: As a consumer, I expect a "phoneNumber" field with some data. I also expect that the phone number must contain 7 to 10 digit…
Steven
  • 714
  • 2
  • 8
  • 21
0
votes
1 answer

Pact does not send provider-verification result to pact broker if junit 5 test fails

I have created a REST-service with spring. Now I want to use pact and junit 5 to test the consumer-provider-communication. I have already a running pact-broker (from https://github.com/jaimeniswonger/pact-broker-openshift). The consumer-test works…
0
votes
2 answers

Pacts: Matching rule for non-empty map (or a field which is not null) needed

I need help with writing my consumer Pacts using pact-jvm (https://github.com/DiUS/pact-jvm). My problem is I have a field which is a list (an array) of maps. Each map can have elements of different types (strings or sub-maps),…
Patrycja K
  • 731
  • 7
  • 14