--
You received this message because you are subscribed to the Google Groups "Pact" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pact-support...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>CDCProvider</groupId>
<artifactId>CDCProvider</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CDCProvider</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-provider-maven_2.11</artifactId>
<version>2.1.9</version>
<configuration>
<serviceProviders>
<!-- You can define as many as you need, but each must have a unique name -->
<serviceProvider>
<name>CarBookingProvider</name>
<stateChangeUrl>http://localhost:8080/persons/AAAAAAAA_ID</stateChangeUrl>
<!-- All the provider properties are optional, and have sensible defaults (shown below) -->
<protocol>http</protocol>
<host>localhost</host>
<port>8080</port>
<path>/persons/AAAAAAAA_ID</path>
<consumers>
<!-- Again, you can define as many consumers for each provider as you need, but each must have a unique name -->
<consumer>
<name>CarBookingConsumer</name>
<!-- currently supports a file path using pactFile or a URL using pactUrl -->
<pactFile>src/test/resources/CarBookingConsumer-CarBookingProvider.json</pactFile>
</consumer>
</consumers>
</serviceProvider>
</serviceProviders>
</configuration>
</plugin>
</plugins>
</build>
</project>
mvn au.com.dius:pact-jvm-provider-maven_2.11:verify
I got the below error:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CDCProvider 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- pact-jvm-provider-maven_2.11:2.1.9:verify (default-cli) @ CDCProvider ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.697 s
[INFO] Finished at: 2016-06-20T14:33:22+10:00
[INFO] Final Memory: 23M/981M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal au.com.dius:pact-jvm-provider-maven_2.11:2.1.9:verify (default-cli) on project CDCProvider: Unable to parse configuration of mojo au.com.dius:pact-jvm-provider-maven_2.11:2.1.9:verify for parameter stateChangeUrl: Cannot find 'stateChangeUrl' in class au.com.dius.pact.provider.maven.Provider -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException
Can you please help me what I am missing here.Do I need to write any other files.
<plugin>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-provider-maven_2.11</artifactId>
<version>2.1.9</version>
to a later version (latest is 3.2.8).
Secondly, remove the state change URL, to make things simpler to get started:
<serviceProvider>
<name>CarBookingProvider</name>
<stateChangeUrl>http://localhost:8080/persons/AAAAAAAA_ID</stateChangeUrl> <!-- Remove this line -->
Thirdly, you have specified the provider URL incorrectly. It should be the URL to access your running provider (i.e. if you have started it, what URL would you use to access it?).
<protocol>http</protocol>
<host>localhost</host>
<port>8080</port>
<path>/persons/AAAAAAAA_ID</path> <!-- remove this line -->
What you have specified there looks like the path used in the test. It should be the root path to the provider. Probably better to take it out unless your provider is running on some sub-path.
Thanks for the quick reply.Now I modified my pom like this.Pom.xml
<version>3.2.8</version>
<configuration>
<serviceProviders>
<!-- You can define as many as you need, but each must have a unique name -->
<serviceProvider>
<name>CarBookingProvider</name>
<!-- All the provider properties are optional, and have sensible defaults (shown below) -->
<protocol>http</protocol>
<host>localhost</host>
<port>8080</port>
<consumers>
<!-- Again, you can define as many consumers for each provider as you need, but each must have a unique name -->
<consumer>
<name>CarBookingConsumer</name>
<!-- currently supports a file path using pactFile or a URL using pactUrl -->
<pactFile>src/test/resources/CarBookingConsumer-CarBookingProvider.json</pactFile>
</consumer>
</consumers>
</serviceProvider>
</serviceProviders>
</configuration>
</plugin>
</plugins>
</build>
</project>
I started local tomcat server on port 8080 for mocking the consumer requests.So thats the reason i provided localhost:8080 in my pom.xml as provider url.If it is the wrong url can you tell me what URL i need to provide here.I had taken this consumer example from github.
Now I got the below error message.
mvn au.com.dius:pact-jvm-provider-maven_2.11:verify
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CDCProvider 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- pact-jvm-provider-maven_2.11:3.2.8:verify (default-cli) @ CDCProvider ---
Verifying a pact between CarBookingConsumer and CarBookingProvider
[Using file src/test/resources/CarBookingConsumer-CarBookingProvider.json]
Given john smith books a civic
WARNING: State Change ignored as there is no stateChange URL
book a car
returns a response which
has status code 201 (FAILED)
includes headers
"Content-Type" with value "application/json;charset=UTF-8" (FAILED)
has a matching body (FAILED)
Given john smith books a civic
WARNING: State Change ignored as there is no stateChange URL
retrieve data from Service-A
returns a response which
has status code 200 (FAILED)
includes headers
"Content-Type" with value "application/json;charset=UTF-8" (FAILED)
has a matching body (FAILED)
Given john smith books a civic
WARNING: State Change ignored as there is no stateChange URL
retrieving data from Service-B
returns a response which
has status code 200 (FAILED)
includes headers
"Content-Type" with value "application/json;charset=UTF-8" (FAILED)
has a matching body (FAILED)
Failures:
0) Verifying a pact between CarBookingConsumer and CarBookingProvider - book a car Given john smith books a civic returns a response which has status code 201
assert expectedStatus == actualStatus
| | |
201 | 404
false
1) Verifying a pact between CarBookingConsumer and CarBookingProvider - book a car Given john smith books a civic returns a response which includes headers "Content-Type" with value "application/json;charset=UTF-8"
Expected header 'Content-Type' to have value 'application/json;charset=UTF-8' but was 'text/html;charset=utf-8'
2) Verifying a pact between CarBookingConsumer and CarBookingProvider - book a car Given john smith books a civic returns a response which has a matching body
comparison -> Expected a response type of 'application/json' but the actual type was 'text/html'
3) Verifying a pact between CarBookingConsumer and CarBookingProvider - retrieve data from Service-A Given john smith books a civic returns a response which has status code 200
assert expectedStatus == actualStatus
| | |
200 | 404
false
4) Verifying a pact between CarBookingConsumer and CarBookingProvider - retrieve data from Service-A Given john smith books a civic returns a response which includes headers "Content-Type" with value "application/json;charset=UTF-8"
Expected header 'Content-Type' to have value 'application/json;charset=UTF-8' but was 'text/html;charset=utf-8'
5) Verifying a pact between CarBookingConsumer and CarBookingProvider - retrieve data from Service-A Given john smith books a civic returns a response which has a matching body
comparison -> Expected a response type of 'application/json' but the actual type was 'text/html'
6) Verifying a pact between CarBookingConsumer and CarBookingProvider - retrieving data from Service-B Given john smith books a civic returns a response which has status code 200
assert expectedStatus == actualStatus
| | |
200 | 404
false
7) Verifying a pact between CarBookingConsumer and CarBookingProvider - retrieving data from Service-B Given john smith books a civic returns a response which includes headers "Content-Type" with value "application/json;charset=UTF-8"
Expected header 'Content-Type' to have value 'application/json;charset=UTF-8' but was 'text/html;charset=utf-8'
8) Verifying a pact between CarBookingConsumer and CarBookingProvider - retrieving data from Service-B Given john smith books a civic returns a response which has a matching body
comparison -> Expected a response type of 'application/json' but the actual type was 'text/html'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.073 s
[INFO] Finished at: 2016-06-20T15:43:54+10:00
[INFO] Final Memory: 29M/1033M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal au.com.dius:pact-jvm-provider-maven_2.11:3.2.8:verify (default-cli) on project CDCProvider: There were 9 pact failures -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Appreciate your help on this.