specs2_2.13

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.consumer" %% "specs2" % "4.0.1" ``` or if you are using Gradle: ```groovy dependencies { testCompile "au.com.dius.pact.consumer:specs2_2.13:4.0.1" } ``` __*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`. # Test Analytics We are tracking anonymous analytics to gather important usage statistics like JVM version and operating system. To disable tracking, set the 'pact_do_not_track' system property or environment variable to 'true'.

License

License

GroupId

GroupId

au.com.dius.pact.consumer
ArtifactId

ArtifactId

specs2_2.13
Last Version

Last Version

4.2.21
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

specs2_2.13
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.consumer" %% "specs2" % "4.0.1" ``` or if you are using Gradle: ```groovy dependencies { testCompile "au.com.dius.pact.consumer:specs2_2.13:4.0.1" } ``` __*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`. # Test Analytics We are tracking anonymous analytics to gather important usage statistics like JVM version and operating system. To disable tracking, set the 'pact_do_not_track' system property or environment variable 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 specs2_2.13

Dependencies

compile (5)

Group / Artifact Type Version
au.com.dius.pact : consumer jar 4.2.21
org.json : json jar 20160212
org.specs2 : specs2-core_2.13 jar 4.9.4
org.asynchttpclient : async-http-client jar 2.8.1
org.scala-lang.modules : scala-java8-compat_2.13 jar 0.9.1

runtime (3)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.32
org.jetbrains.kotlin : kotlin-reflect jar 1.4.32
io.netty : netty-transport-native-epoll jar 4.1.48.Final

Project Modules

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

DiUS Computing Pty Ltd

Versions

Version
4.2.21
4.2.20
4.2.19
4.2.18
4.2.17
4.2.16
4.2.15
4.2.14
4.2.13
4.2.12
4.2.11
4.2.10
4.2.9
4.2.8
4.2.7
4.2.6
4.2.5
4.2.4
4.2.3
4.2.2
4.2.1
4.2.0
4.2.0-beta.3
4.2.0-beta.2
4.2.0-beta.1
4.2.0-beta.0
4.1.38
4.1.37
4.1.36
4.1.35
4.1.34
4.1.33
4.1.32
4.1.31
4.1.30
4.1.29
4.1.28
4.1.27
4.1.26
4.1.25
4.1.24
4.1.23
4.1.22
4.1.21
4.1.20
4.1.19
4.1.18
4.1.17
4.1.16
4.1.15
4.1.14
4.1.13
4.1.12
4.1.11
4.1.10
4.1.9
4.1.8
4.1.7
4.1.6
4.1.5
4.1.4
4.1.3
4.1.2
4.1.1
4.1.0