mattiasmgn / Pact-JVM-Example

Basic example of Consumer driven contract testing using Pact JVM (December 2017)
7 stars 21 forks source link

Verifying different PACT files are not working #1

Open Dattasaisukumar opened 4 years ago

Dattasaisukumar commented 4 years ago

Hi I have created 4 different projects(2 for consumer and 2 for provider ) for verifying 2 different get calls . I am able to publish the PACT files to PACT broker sucessfully. But When I am trying to do the Verification for the PACT files it is verfying by default to 1st PACT file which is published . Can you please help me on this

image

image

I have used the same YAML file what you have used

ConsumerPOM:- <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0 Consumer-Pact Consumer-Pact 0.0.1-SNAPSHOT Consumer-Pact http://www.example.com UTF-8 1.7 1.7 org.springframework.boot spring-boot-starter-web 2.3.0.RELEASE org.springframework.boot spring-boot-starter-thymeleaf 2.3.0.RELEASE org.springframework.boot spring-boot-devtools 2.3.0.RELEASE org.springframework.boot spring-boot-starter-test 2.3.0.RELEASE test org.junit.jupiter junit-jupiter-api 5.7.0-M1 test junit junit 4.13 test au.com.dius pact-jvm-consumer-junit 4.0.10 au.com.dius pact-jvm-consumer-java8 4.0.10 org.json json 20171018 org.springframework.boot spring-boot-maven-plugin au.com.dius pact-jvm-provider-maven_2.11 3.5.10 au.com.dius pact-jvm-provider-maven_2.11 3.5.10 ${project.build.directory}/pacts http://localhost:8113 ${project.version} true

Provider POM:- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0 Provider-Pact Provider-Pact jar 0.0.1-SNAPSHOT Provider-Pact http://maven.apache.org junit junit 4.12 test au.com.dius pact-jvm-provider-junit_2.12 3.5.10 org.springframework.boot spring-boot-maven-plugin au.com.dius pact-jvm-provider-maven_2.12 3.5.10 ProviderJson http jsonplaceholder.typicode.com 80 / http://localhost:8113/ ProviderJson http localhost 3000 / http://localhost:8113/

I am strcuk in this Provider PART Verification for different PACT FILES. If this is done then I will be finishing my working POC

Dattasaisukumar commented 4 years ago

Hi Can you please provide the code for Provider side with Query parameters . I am able to do my POC sucessfully with your GITHUB example. When I am trying to do the Provider side validation with Query parameters with your GITHUB provider side example it is showing error for me as verify failed: No signature of method: static au.com.dius.pact.model.PactReader.queryStringToMap() is applicable for argument types: (java.util.LinkedHashMap) values: [[city_id:[4487042], key:[1c7fdbc64572463f9ebe140ff3909050]]] [ERROR] Possible solutions: queryStringToMap(java.lang.String), queryStringToMap(java.lang.String, boolean)