MVN

au.com.dius : pact-jvm-server_2.10

Maven & Gradle

Apr 14, 2018
1k stars

pact-jvm-server_2.10 · Pact server =========== The pact server is a stand-alone interactions recorder and verifier, aimed at clients that are non-JVM or non-Ruby based. The pact client for that platform will need to be implemented, but it only be responsible for generating the `JSON` interactions, running the tests and communicating with the server. The server implements a `JSON` `REST` Admin API with the following endpoints. / -> For diagnostics, currently returns a list of ports of the running mock servers. /create -> For initialising a test server and submitting the JSON interactions. It returns a port /complete -> For finalising and verifying the interactions with the server. It writes the `JSON` pact file to disk. ## Running the server ### Versions 2.2.6+ Pact server takes the following parameters: ``` Usage: pact-jvm-server [options] [port] port port to run on (defaults to 29999) --help prints this usage text -h <value> | --host <value> host to bind to (defaults to localhost) -l <value> | --mock-port-lower <value> lower bound to allocate mock ports (defaults to 20000) -u <value> | --mock-port-upper <value> upper bound to allocate mock ports (defaults to 40000) -d | --daemon run as a daemon process --debug run with debug logging ``` ### Prior to version 2.2.6 Pact server takes one optional parameter, the port number to listen on. If not provided, it will listen on 29999. It requires an active console to run. ### Using a distribution archive You can download a [distribution from maven central](http://search.maven.org/remotecontent?filepath=au/com/dius/pact-jvm-server_2.11/2.2.4/). There is both a ZIP and TAR archive. Unpack it to a directory of choice and then run the script in the bin directory. ### Building a distribution bundle You can build an application bundle with gradle by running (for 2.11 version): $ ./gradlew :pact-jvm-server_2.11:installdist This will create an app bundle in `build/2.11/install/pact-jvm-server_2.11`. You can then execute it with: $ java -jar pact-jvm-server/build/2.10/install/pact-jvm-server_2.11/lib/pact-jvm-server_2.11-2.2.4.jar or with the generated bundle script file: $ pact-jvm-server/build/2.11/install/pact-jvm-server_2.11/bin/pact-jvm-server_2.11 By default will run on port `29999` but a port number can be optionally supplied. ### Running it with docker You can use a docker image to execute the mock server as a docker container. $ docker run -d -p 8080:8080 -p 20000-20010:20000-20010 uglyog/pact-jvm-server This will run the main server on port 8080, and each created mock server on ports 20000-20010. You can map the ports to any you require. ## Life cycle The following actions are expected to occur * The client calls `/create` to initialise a server with the expected `JSON` interactions and state * The admin server will start a mock server on a random port and return the port number in the response * The client will execute its interaction tests against the mock server with the supplied port * Once finished, the client will call `/complete' on the Admin API, posting the port number * The pact server will verify the interactions and write the `JSON` `pact` file to disk under `/target` * The mock server running on the supplied port will be shutdown. ## Endpoints ### /create The client will need `POST` to `/create` the generated `JSON` interactions, also providing a state as a query parameter. For example: POST http://localhost:29999/create?state=NoUsers '{ "provider": { "name": "Animal_Service"}, ... }' This will create a new running mock service provider on a randomly generated port. The port will be returned in the `201` response: { "port" : 34423 } ### /complete Once the client has finished running its tests against the mock server on the supplied port (in this example port `34423`) the client will need to `POST` to `/complete` the port number of the mock server that was used. For example: POST http://localhost:29999/complete '{ "port" : 34423 }' This will cause the Pact server to verify the interactions, shutdown the mock server running on that port and writing the pact `JSON` file to disk under the `target` directory. ### / The `/` endpoint is for diagnostics and to check that the pact server is running. It will return all the currently running mock servers port numbers. For example: GET http://localhost:29999/ '{ "ports": [23443,43232] }'

<dependency>
    <groupId>au.com.dius</groupId>
    <artifactId>pact-jvm-server_2.10</artifactId>
    <version>2.4.20</version>
</dependency>
Copy
pom.xml
Table Of Contents

Latest Version

Choose a version of au.com.dius : pact-jvm-server_2.10 to add to Maven or Gradle - Latest Versions:

  • Latest Stable: 2.4.20
  • Latest Release Candidate: 2.0-RC5

All Versions

Choose a version of au.com.dius : pact-jvm-server_2.10 to add to Maven or Gradle - All Versions:

Version Vulnerabilities Updated
2.4.x
pact-jvm-server_2.10-2.4.20
pact-jvm-server_2.10-2.4.19
pact-jvm-server_2.10-2.4.18
pact-jvm-server_2.10-2.4.17
pact-jvm-server_2.10-2.4.16
pact-jvm-server_2.10-2.4.14
pact-jvm-server_2.10-2.4.13
pact-jvm-server_2.10-2.4.12
pact-jvm-server_2.10-2.4.11
pact-jvm-server_2.10-2.4.10
pact-jvm-server_2.10-2.4.9
pact-jvm-server_2.10-2.4.8
pact-jvm-server_2.10-2.4.7
pact-jvm-server_2.10-2.4.6
pact-jvm-server_2.10-2.4.5
pact-jvm-server_2.10-2.4.4
pact-jvm-server_2.10-2.4.2
pact-jvm-server_2.10-2.4.0
2.3.x
pact-jvm-server_2.10-2.3.3
2.2.x
pact-jvm-server_2.10-2.2.15
pact-jvm-server_2.10-2.2.14
pact-jvm-server_2.10-2.2.13
pact-jvm-server_2.10-2.2.12
pact-jvm-server_2.10-2.2.11
pact-jvm-server_2.10-2.2.10
pact-jvm-server_2.10-2.2.9
pact-jvm-server_2.10-2.2.8
pact-jvm-server_2.10-2.2.7
pact-jvm-server_2.10-2.2.6
pact-jvm-server_2.10-2.2.5
pact-jvm-server_2.10-2.2.4
pact-jvm-server_2.10-2.2.3
pact-jvm-server_2.10-2.2.2
pact-jvm-server_2.10-2.2.1
pact-jvm-server_2.10-2.2.0
2.1.x
pact-jvm-server_2.10-2.1.13
pact-jvm-server_2.10-2.1.12
pact-jvm-server_2.10-2.1.11
pact-jvm-server_2.10-2.1.10
pact-jvm-server_2.10-2.1.9
pact-jvm-server_2.10-2.1.8
pact-jvm-server_2.10-2.1.7
pact-jvm-server_2.10-2.1.6
pact-jvm-server_2.10-2.1.5
pact-jvm-server_2.10-2.1.4
pact-jvm-server_2.10-2.1.3
pact-jvm-server_2.10-2.1.2
pact-jvm-server_2.10-2.1.1
pact-jvm-server_2.10-2.1.0
2.0.x
pact-jvm-server_2.10-2.0.9
pact-jvm-server_2.10-2.0.8
pact-jvm-server_2.10-2.0.7
pact-jvm-server_2.10-2.0.6
pact-jvm-server_2.10-2.0.5
pact-jvm-server_2.10-2.0.4
pact-jvm-server_2.10-2.0.3
pact-jvm-server_2.10-2.0.2
pact-jvm-server_2.10-2.0.1
pact-jvm-server_2.10-2.0.0
2.0
pact-jvm-server_2.10-2.0-RC5
pact-jvm-server_2.10-2.0-RC4
pact-jvm-server_2.10-2.0-RC3
pact-jvm-server_2.10-2.0-RC1
1.12
pact-jvm-server_2.10-1.12
1.11
pact-jvm-server_2.10-1.11
1.10
pact-jvm-server_2.10-1.10
1.9
pact-jvm-server_2.10-1.9
1.8
pact-jvm-server_2.10-1.8
1.7
pact-jvm-server_2.10-1.7
1.6
pact-jvm-server_2.10-1.6
1.5
pact-jvm-server_2.10-1.5

How to add a dependency to Maven

Add the following au.com.dius : pact-jvm-server_2.10 maven dependency to the pom.xml file with your favorite IDE (IntelliJ / Eclipse / Netbeans):

<dependency>
    <groupId>au.com.dius</groupId>
    <artifactId>pact-jvm-server_2.10</artifactId>
    <version>2.4.20</version>
</dependency>

How to add a dependency to Gradle

Gradle Groovy DSL: Add the following au.com.dius : pact-jvm-server_2.10 gradle dependency to your build.gradle file:

implementation 'au.com.dius:pact-jvm-server_2.10:2.4.20'

Gradle Kotlin DSL: Add the following au.com.dius : pact-jvm-server_2.10 gradle kotlin dependency to your build.gradle.kts file:

implementation("au.com.dius:pact-jvm-server_2.10:2.4.20")

How to add a dependency to SBT Scala

SBT Scala: Add the following au.com.dius : pact-jvm-server_2.10 sbt scala dependency to your build.sbt file:

libraryDependencies += "au.com.dius" % "pact-jvm-server_2.10" % "2.4.20"

Advertisement

Dependencies from Group

Apr 29, 2020
31 usages
1k stars
Nov 04, 2018
27 usages
1k stars
Nov 04, 2018
18 usages
1k stars
Apr 29, 2020
13 usages
1k stars
Apr 29, 2020
12 usages
1k stars

Discover Dependencies

Apr 14, 2018
2 usages
1k stars
Apr 14, 2018
Apr 14, 2018
Apr 14, 2018
Apr 14, 2018
5 usages
1k stars
Apr 14, 2018
3 usages
1k stars