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
1 answer

Pact File creation failed due to NoHttpResponseException : 127.0.*.*.*** failed to respond

I am unable to create the Pact file. Facing NoHttpResponseException : 127.0.0.1:56314 failed to respond. I was able to generate the pact file successfully, but after I did Maven->clean i am facing a series of issues. Please let me know what can be…
PaChSu
  • 297
  • 3
  • 13
0
votes
1 answer

Generate json schema in addition to, or from pact contract

In my client code, I use json schemas to validate json responses (using ajv). I am planning to use pact-js to generate pacts to run against the provider for contract testing. I would like a single source of truth for the schema that my client code…
0
votes
1 answer

pact-jvm-provider-spring-mvc json4s exception

Just trying to understand pact. We are using spring boot, so naturally I went to trying simple setup using pact-jvm-provider-spring-mvc. My pact file is a simple { "consumer": { "name": "MyConsumer" }, "provider": { "name":…
Arash
  • 11,697
  • 14
  • 54
  • 81
0
votes
2 answers

In PactBroker, When i will get the data in "Last Verified" column - New PactBroker Version

In PactBroker, When i will get the data in "Last Verified" column. Image : Pact Broker - New Version Am using Maven plugin to verify with provider, mvn pact:verify Plugin: groupId: au.com.dius artifactId: pact-jvm-provider-maven_2.11 version:…
Nandess
  • 25
  • 1
  • 10
0
votes
2 answers

Encoded / Encrypted body before verifying a Pact

A server I need to integrate with returns its answers encoded as a JWT. Worse, the response body actually is a json, of the form: {d: token} with token = JWT.encode({id: 123, field: "John", etc.}) I'd like to use a pact verification on the…
André
  • 1
0
votes
1 answer

PACT-JVM problems with closeArray

So I'm only starting to use JVM-PACT. I'm trying to crate this JSON { "elements": [ { "Location": { "id": "loc_id1", "Addr": { "Addr1": { "value": "545 Test Street" }, "City": { …
Tommy
  • 1
  • 1
0
votes
1 answer

Pact JVM Junit Consumer Compilation Error

I am writing the Consumer Side Code for Pact using JVm-Junit library. However at the line : MockProviderConfig config = MockProviderConfig.createDefault(); i am getting error "createDefault() is not undefined for the type MockProviderConfig" What…
PaChSu
  • 297
  • 3
  • 13
0
votes
1 answer

Extract the exact value used in a PACT (when the match is done via a regexp as value not initially known))

I have a ruby pact mock service provider that captures my request. I would like to extract the exact value provided in the request (which was matched by a Pact.term / Pact.like), to do further processing with that value once the request has been…
André
  • 1
0
votes
1 answer

Determining when karma-pact mock server has started

We're using the karma-pact plugin to run our pact JS client tests, based on the example from https://github.com/pact-foundation/pact-js/blob/master/karma/mocha/client-spec.js . In the example there's a timeout in the before(), I believe to ensure…
0
votes
1 answer

Pre-requisites for getting started with Pact Contract Testing

Our organisation team structure is such that there is a new independent team of testers who is supposed to do API Testing. So as a member of this team, I do not have java code set up for every API project. So how can I write Consumer driven tests…
PaChSu
  • 297
  • 3
  • 13
0
votes
1 answer

PACT: java-maven

I need few answer for my doubt: Pact-mock-service Vs pact-jvm-server, is both are same? Pls describe this. Am implementing the PACT in java-maven I can able to run…
Nandess
  • 25
  • 1
  • 10
0
votes
1 answer

PACT DSL .closeObject to format hierarchical, PACT file interaction, response

I not able to use the PACT DSL .closeObject() to format a PACT interaction response. I'm asking for suggestions to make this work or asking if .closeObject() is not working as intended? I have a Shopping cart with 2 items. When I try to format the…
0
votes
0 answers

How to mock user authentication on Rails with Pact contract verification?

On a Pact verification stage I need to mock user authentication. What is the best way to do it? I'm using Rails 4 with Devise. I found a very hacky looking solution, which works but looks ugly and I hope there's another way to do it. I'm replacing…
Vladimir Mikhaylovskiy
  • 1,955
  • 4
  • 19
  • 28
0
votes
2 answers

Using pact for contract tests on CI in one container without a pipeline?

I'm trying to introduce contract testing to my team, and Pact seems to be the only reliable tool out there. The complication is that the documentation suggests to use it with microservices and as a part of CI pipeline. But we can't make such a big…
Vladimir Mikhaylovskiy
  • 1,955
  • 4
  • 19
  • 28
0
votes
1 answer

Provider pactVerify isn't picking up JSON Pact file

I have two projects in the same repo, with completely separate directory structures (consumer in /test-consumer, provider in /app). The consumer check outputs a JSON Pact file in /test-consumer/build/pacts, as expected by dependencies { test {…
Kazuaki
  • 947
  • 6
  • 8