pact-jvm-consumer-specs2_2.12

pact-jvm-consumer-specs2 ======================== ## Specs2 Bindings for the pact-jvm library ## Dependency In the root folder of your project in build.sbt add the line: ```scala libraryDependencies += "au.com.dius" %% "pact-jvm-consumer-specs2" % "3.2.11" ``` or if you are using Gradle: ```groovy dependencies { testCompile "au.com.dius:pact-jvm-consumer-specs2_2.11:3.2.11" } ``` __*Note:*__ `PactSpec` requires spec2 3.x. Also, for spray users there's an incompatibility between specs2 v3.x and spray. Follow these instructions to resolve that problem: https://groups.google.com/forum/#!msg/spray-user/2T6SBp4OJeI/AJlnJuAKPRsJ ## Usage To author a test, mix `PactSpec` into your spec First we define a service client called `ConsumerService`. In our example this is a simple wrapper for `dispatch`, an HTTP client. The source code can be found in the test folder alongside the `ExamplePactSpec`. Here is a simple example: ``` import au.com.dius.pact.consumer.PactSpec class ExamplePactSpec extends Specification with PactSpec { val consumer = "My Consumer" val provider = "My Provider" override def is = uponReceiving("a request for foo") .matching(path = "/foo") .willRespondWith(body = "{}") .withConsumerTest { providerConfig => Await.result(ConsumerService(providerConfig.url).simpleGet("/foo"), Duration(1000, MILLISECONDS)) must beEqualTo(200, Some("{}")) } } ``` This spec will be run along with the rest of your specs2 unit tests and will output your pact json to ``` /target/pacts/<Consumer>_<Provider>.json ``` # Forcing pact files to be overwritten (3.6.5+) By default, when the pact file is written, it will be merged with any existing pact file. To force the file to be overwritten, set the Java system property `pact.writer.overwrite` to `true`.

License

License

GroupId

GroupId

au.com.dius
ArtifactId

ArtifactId

pact-jvm-consumer-specs2_2.12
Last Version

Last Version

4.0.10
Release Date

Release Date

Type

Type

jar
Description

Description

pact-jvm-consumer-specs2_2.12
pact-jvm-consumer-specs2 ======================== ## Specs2 Bindings for the pact-jvm library ## Dependency In the root folder of your project in build.sbt add the line: ```scala libraryDependencies += "au.com.dius" %% "pact-jvm-consumer-specs2" % "3.2.11" ``` or if you are using Gradle: ```groovy dependencies { testCompile "au.com.dius:pact-jvm-consumer-specs2_2.11:3.2.11" } ``` __*Note:*__ `PactSpec` requires spec2 3.x. Also, for spray users there's an incompatibility between specs2 v3.x and spray. Follow these instructions to resolve that problem: https://groups.google.com/forum/#!msg/spray-user/2T6SBp4OJeI/AJlnJuAKPRsJ ## Usage To author a test, mix `PactSpec` into your spec First we define a service client called `ConsumerService`. In our example this is a simple wrapper for `dispatch`, an HTTP client. The source code can be found in the test folder alongside the `ExamplePactSpec`. Here is a simple example: ``` import au.com.dius.pact.consumer.PactSpec class ExamplePactSpec extends Specification with PactSpec { val consumer = "My Consumer" val provider = "My Provider" override def is = uponReceiving("a request for foo") .matching(path = "/foo") .willRespondWith(body = "{}") .withConsumerTest { providerConfig => Await.result(ConsumerService(providerConfig.url).simpleGet("/foo"), Duration(1000, MILLISECONDS)) must beEqualTo(200, Some("{}")) } } ``` This spec will be run along with the rest of your specs2 unit tests and will output your pact json to ``` /target/pacts/<Consumer>_<Provider>.json ``` # Forcing pact files to be overwritten (3.6.5+) By default, when the pact file is written, it will be merged with any existing pact file. To force the file to be overwritten, set the Java system property `pact.writer.overwrite` to `true`.
Project URL

Project URL

https://github.com/DiUS/pact-jvm
Source Code Management

Source Code Management

https://github.com/DiUS/pact-jvm

Download pact-jvm-consumer-specs2_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/au.com.dius/pact-jvm-consumer-specs2_2.12/ -->
<dependency>
    <groupId>au.com.dius</groupId>
    <artifactId>pact-jvm-consumer-specs2_2.12</artifactId>
    <version>4.0.10</version>
</dependency>
// https://jarcasting.com/artifacts/au.com.dius/pact-jvm-consumer-specs2_2.12/
implementation 'au.com.dius:pact-jvm-consumer-specs2_2.12:4.0.10'
// https://jarcasting.com/artifacts/au.com.dius/pact-jvm-consumer-specs2_2.12/
implementation ("au.com.dius:pact-jvm-consumer-specs2_2.12:4.0.10")
'au.com.dius:pact-jvm-consumer-specs2_2.12:jar:4.0.10'
<dependency org="au.com.dius" name="pact-jvm-consumer-specs2_2.12" rev="4.0.10">
  <artifact name="pact-jvm-consumer-specs2_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='au.com.dius', module='pact-jvm-consumer-specs2_2.12', version='4.0.10')
)
libraryDependencies += "au.com.dius" % "pact-jvm-consumer-specs2_2.12" % "4.0.10"
[au.com.dius/pact-jvm-consumer-specs2_2.12 "4.0.10"]

Dependencies

compile (5)

Group / Artifact Type Version
au.com.dius : pact-jvm-consumer jar 4.0.10
org.json : json jar 20160212
org.specs2 : specs2-core_2.12 jar 4.5.1
org.asynchttpclient : async-http-client jar 2.8.1
org.scala-lang.modules : scala-java8-compat_2.12 jar 0.9.0

runtime (1)

Group / Artifact Type Version
io.netty : netty-transport-native-epoll jar 4.1.48.Final

Project Modules

There are no modules declared in this project.
au.com.dius

DiUS Computing Pty Ltd

Versions

Version
4.0.10
4.0.9
4.0.8
4.0.7
4.0.6
4.0.5
4.0.4
4.0.3
4.0.2
4.0.1
4.0.0
4.0.0-beta.6
4.0.0-beta.5
4.0.0-beta.4
4.0.0-beta.3
4.0.0-beta.2
3.6.15
3.6.14
3.6.13
3.6.12
3.6.11
3.6.10
3.6.9
3.6.8
3.6.7
3.6.6
3.6.5
3.6.4
3.6.3
3.6.2
3.6.1
3.6.0
3.6.0-rc.1
3.6.0-rc.0
3.5.25
3.5.24
3.5.23
3.5.22
3.5.21
3.5.20
3.5.19
3.5.18
3.5.17
3.5.16
3.5.15
3.5.14
3.5.13
3.5.12
3.5.11
3.5.10
3.5.9
3.5.8
3.5.7
3.5.6
3.5.5
3.5.4-rc.1
3.5.4-rc.0