From 4d850e73a891834f91f49a42fd03c9df5382b764 Mon Sep 17 00:00:00 2001 From: Ronald Holshausen Date: Wed, 6 Aug 2014 17:08:56 +1000 Subject: [PATCH] updated gradle plugin doco to include provider state info --- pact-jvm-provider-gradle/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pact-jvm-provider-gradle/README.md b/pact-jvm-provider-gradle/README.md index ef5f8cb364..873ad863f8 100644 --- a/pact-jvm-provider-gradle/README.md +++ b/pact-jvm-provider-gradle/README.md @@ -106,3 +106,31 @@ The following project properties can be specified with `-Pproperty=value` on the |Property|Description| |--------|-----------| |pact.showStacktrace|This turns on stacktrace printing for each request. It can help with diagnosing network errors| + +## Provider States + +For each provider you can specify a state change URL to use to switch the state of the provider. This URL will +receive the providerState description from the pact file before each interaction via a POST. + +``` +pact { + + serviceProviders { + + provider1 { + + hasPactWith('consumer1') { + pactFile = file('path/to/provider1-consumer1-pact.json') + stateChange = url('http://localhost:8001/tasks/pactStateChange') + stateChangeUsesBody = false // defaults to true + } + + } + + } + +} +``` + +If the `stateChangeUsesBody` is not specified, or is set to true, then the provider state description will be sent as + JSON in the body of the request. If it is set to false, it will passed as a query parameter.