Versions of artifact au.com.dius:pact-jvm-provider-lein_2.11

pact-jvm-provider-lein_2.11

# Leiningen plugin to verify a provider [version 2.2.14+, 3.0.3+] Leiningen plugin for verifying pacts against a provider. The plugin provides a `pact-verify` task which will verify all configured pacts against your provider. ## To Use It ### 1. Add the plugin to your project plugins, preferably in it's own profile. ```clojure :profiles { :pact { :plugins [[au.com.dius/pact-jvm-provider-lein_2.11 "3.2.11" :exclusions [commons-logging]]] :dependencies [[ch.qos.logback/logback-core "1.1.3"] [ch.qos.logback/logback-classic "1.1.3"] [org.apache.httpcomponents/httpclient "4.4.1"]] }}} ``` ### 2. Define the pacts between your consumers and providers You define all the providers and consumers within the `:pact` configuration element of your project. ```clojure :pact { :service-providers { ; You can define as many as you need, but each must have a unique name :provider1 { ; All the provider properties are optional, and have sensible defaults (shown below) :protocol "http" :host "localhost" :port 8080 :path "/" :has-pact-with { ; Again, you can define as many consumers for each provider as you need, but each must have a unique name :consumer1 { ; pact file can be either a path or an URL :pact-file "path/to/provider1-consumer1-pact.json" } } } } } ``` ### 3. Execute `lein with-profile pact pact-verify` You will have to have your provider running for this to pass. ## Enabling insecure SSL For providers that are running on SSL with self-signed certificates, you need to enable insecure SSL mode by setting `:insecure true` on the provider. ```clojure :pact { :service-providers { :provider1 { :protocol "https" :host "localhost" :port 8443 :insecure true :has-pact-with { :consumer1 { :pact-file "path/to/provider1-consumer1-pact.json" } } } } } ``` ## Specifying a custom trust store For environments that are running their own certificate chains: ```clojure :pact { :service-providers { :provider1 { :protocol "https" :host "localhost" :port 8443 :trust-store "relative/path/to/trustStore.jks" :trust-store-password "changeme" :has-pact-with { :consumer1 { :pact-file "path/to/provider1-consumer1-pact.json" } } } } } ``` `:trust-store` is relative to the current working (build) directory. `:trust-store-password` defaults to `changeit`. NOTE: The hostname will still be verified against the certificate. ## Modifying the requests before they are sent Sometimes you may need to add things to the requests that can't be persisted in a pact file. Examples of these would be authentication tokens, which have a small life span. The Leiningen plugin provides a request filter that can be set to an anonymous function on the provider that will be called before the request is made. This function will receive the HttpRequest object as a parameter. ```clojure :pact { :service-providers { :provider1 { ; function that adds an Authorization header to each request :request-filter #(.addHeader % "Authorization" "oauth-token eyJhbGciOiJSUzI1NiIsIm...") :has-pact-with { :consumer1 { :pact-file "path/to/provider1-consumer1-pact.json" } } } } } ``` __*Important Note:*__ Y

Artifact Version Name Latest uploaded at
3.5.0-beta.4 pact-jvm-provider-lein_2.11 2017-05-14 11:51:49 UTC
3.3.9 pact-jvm-provider-lein_2.11 2017-05-08 11:36:11 UTC
3.3.8 pact-jvm-provider-lein_2.11 2017-04-14 03:56:51 UTC
3.3.7 pact-jvm-provider-lein_2.11 2017-03-27 04:37:56 UTC
3.5.0-beta.3 pact-jvm-provider-lein_2.11 2017-02-05 05:59:37 UTC
3.3.6 pact-jvm-provider-lein_2.11 2017-01-26 06:41:32 UTC
3.3.5 pact-jvm-provider-lein_2.11 2017-01-14 06:52:37 UTC
3.3.4 pact-jvm-provider-lein_2.11 2017-01-04 05:06:27 UTC
3.3.3 pact-jvm-provider-lein_2.11 2016-11-06 03:48:55 UTC
2.5.0-beta.0 pact-jvm-provider-lein_2.11 2016-10-22 12:57:22 UTC
3.3.2 pact-jvm-provider-lein_2.11 2016-10-22 08:59:53 UTC
3.3.1 pact-jvm-provider-lein_2.11 2016-10-02 03:51:35 UTC
3.5.0-beta.2 pact-jvm-provider-lein_2.11 2016-09-21 12:39:46 UTC
3.3.0 pact-jvm-provider-lein_2.11 2016-09-07 10:53:15 UTC
3.5.0-beta.1 pact-jvm-provider-lein_2.11 2016-08-28 11:20:09 UTC
3.2.13 pact-jvm-provider-lein_2.11 2016-08-14 01:54:25 UTC
3.2.12 pact-jvm-provider-lein_2.11 2016-08-07 04:40:51 UTC
3.3.0-beta.0 pact-jvm-provider-lein_2.11 2016-07-31 09:05:24 UTC
3.2.11 pact-jvm-provider-lein_2.11 2016-07-31 06:31:10 UTC
3.2.10 pact-jvm-provider-lein_2.11 2016-07-15 04:17:08 UTC
2.4.12 pact-jvm-provider-lein_2.11 2016-07-15 03:02:39 UTC
3.2.9 pact-jvm-provider-lein_2.11 2016-07-06 05:38:31 UTC
3.2.8 pact-jvm-provider-lein_2.11 2016-06-18 04:28:39 UTC
2.4.10 pact-jvm-provider-lein_2.11 2016-06-17 23:22:00 UTC
3.2.7 pact-jvm-provider-lein_2.11 2016-05-04 05:00:42 UTC
3.2.6 pact-jvm-provider-lein_2.11 2016-03-29 03:21:54 UTC
3.2.5 pact-jvm-provider-lein_2.11 2016-03-25 01:58:56 UTC
3.2.4 pact-jvm-provider-lein_2.11 2016-02-20 00:46:07 UTC
2.4.6 pact-jvm-provider-lein_2.11 2016-02-19 23:32:54 UTC
3.2.3 pact-jvm-provider-lein_2.11 2016-02-11 06:21:37 UTC