MVN

au.com.dius : pact-jvm-consumer-specs2_2.11

Maven & Gradle

Nov 04, 2018
1k stars

pact-jvm-consumer-specs2_2.11 · 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 ```

<dependency>
    <groupId>au.com.dius</groupId>
    <artifactId>pact-jvm-consumer-specs2_2.11</artifactId>
    <version>3.5.24</version>
</dependency>
Copy
pom.xml
Table Of Contents

Latest Version

Choose a version of au.com.dius : pact-jvm-consumer-specs2_2.11 to add to Maven or Gradle - Latest Versions:

  • Latest Stable: 3.5.24
  • Latest Release Candidate: 3.5.0-rc.3
  • Latest Beta: 3.5.0-beta.4

All Versions

Choose a version of au.com.dius : pact-jvm-consumer-specs2_2.11 to add to Maven or Gradle - All Versions:

Version Vulnerabilities Updated
3.5.x
pact-jvm-consumer-specs2_2.11-3.5.24
pact-jvm-consumer-specs2_2.11-3.5.23
pact-jvm-consumer-specs2_2.11-3.5.22
pact-jvm-consumer-specs2_2.11-3.5.21
pact-jvm-consumer-specs2_2.11-3.5.20
pact-jvm-consumer-specs2_2.11-3.5.19
pact-jvm-consumer-specs2_2.11-3.5.18
pact-jvm-consumer-specs2_2.11-3.5.17
pact-jvm-consumer-specs2_2.11-3.5.16
pact-jvm-consumer-specs2_2.11-3.5.15
pact-jvm-consumer-specs2_2.11-3.5.14
pact-jvm-consumer-specs2_2.11-3.5.13
pact-jvm-consumer-specs2_2.11-3.5.12
pact-jvm-consumer-specs2_2.11-3.5.11
pact-jvm-consumer-specs2_2.11-3.5.10
pact-jvm-consumer-specs2_2.11-3.5.9
pact-jvm-consumer-specs2_2.11-3.5.8
pact-jvm-consumer-specs2_2.11-3.5.7-jre7.0
pact-jvm-consumer-specs2_2.11-3.5.7
pact-jvm-consumer-specs2_2.11-3.5.6-jre7.0
pact-jvm-consumer-specs2_2.11-3.5.6
pact-jvm-consumer-specs2_2.11-3.5.5-jre7.0
pact-jvm-consumer-specs2_2.11-3.5.5
pact-jvm-consumer-specs2_2.11-3.5.4-jre7.0
pact-jvm-consumer-specs2_2.11-3.5.4
pact-jvm-consumer-specs2_2.11-3.5.3-jre7.0
pact-jvm-consumer-specs2_2.11-3.5.3
pact-jvm-consumer-specs2_2.11-3.5.2
pact-jvm-consumer-specs2_2.11-3.5.2-jre7.0
pact-jvm-consumer-specs2_2.11-3.5.1
pact-jvm-consumer-specs2_2.11-3.5.1-jre7.1
pact-jvm-consumer-specs2_2.11-3.5.0-jre7.1
pact-jvm-consumer-specs2_2.11-3.5.0-jre7
pact-jvm-consumer-specs2_2.11-3.5.0
pact-jvm-consumer-specs2_2.11-3.5.0-rc.3
pact-jvm-consumer-specs2_2.11-3.5.0-rc.2
pact-jvm-consumer-specs2_2.11-3.5.0-rc.1
pact-jvm-consumer-specs2_2.11-3.5.0-beta.4
pact-jvm-consumer-specs2_2.11-3.5.0-beta.3
pact-jvm-consumer-specs2_2.11-3.5.0-beta.2
pact-jvm-consumer-specs2_2.11-3.5.0-beta.1
3.4.x
pact-jvm-consumer-specs2_2.11-3.4.1
pact-jvm-consumer-specs2_2.11-3.4.0
3.3.x
pact-jvm-consumer-specs2_2.11-3.3.10
pact-jvm-consumer-specs2_2.11-3.3.9
pact-jvm-consumer-specs2_2.11-3.3.8
pact-jvm-consumer-specs2_2.11-3.3.7
pact-jvm-consumer-specs2_2.11-3.3.6
pact-jvm-consumer-specs2_2.11-3.3.5
pact-jvm-consumer-specs2_2.11-3.3.4
pact-jvm-consumer-specs2_2.11-3.3.3
pact-jvm-consumer-specs2_2.11-3.3.2
pact-jvm-consumer-specs2_2.11-3.3.1
pact-jvm-consumer-specs2_2.11-3.3.0
pact-jvm-consumer-specs2_2.11-3.3.0-beta.0
3.2.x
pact-jvm-consumer-specs2_2.11-3.2.13
pact-jvm-consumer-specs2_2.11-3.2.12
pact-jvm-consumer-specs2_2.11-3.2.11
pact-jvm-consumer-specs2_2.11-3.2.10
pact-jvm-consumer-specs2_2.11-3.2.9
pact-jvm-consumer-specs2_2.11-3.2.8
pact-jvm-consumer-specs2_2.11-3.2.7
pact-jvm-consumer-specs2_2.11-3.2.6
pact-jvm-consumer-specs2_2.11-3.2.5
pact-jvm-consumer-specs2_2.11-3.2.4
pact-jvm-consumer-specs2_2.11-3.2.3
pact-jvm-consumer-specs2_2.11-3.2.2
pact-jvm-consumer-specs2_2.11-3.2.1
pact-jvm-consumer-specs2_2.11-3.2.0
3.1.x
pact-jvm-consumer-specs2_2.11-3.1.3
pact-jvm-consumer-specs2_2.11-3.1.2
pact-jvm-consumer-specs2_2.11-3.1.1
pact-jvm-consumer-specs2_2.11-3.1.0
3.0.x
pact-jvm-consumer-specs2_2.11-3.0.4
pact-jvm-consumer-specs2_2.11-3.0.3
pact-jvm-consumer-specs2_2.11-3.0.2
pact-jvm-consumer-specs2_2.11-3.0.1
pact-jvm-consumer-specs2_2.11-3.0.0
2.5.x
pact-jvm-consumer-specs2_2.11-2.5.0-beta.0
2.4.x
pact-jvm-consumer-specs2_2.11-2.4.20
pact-jvm-consumer-specs2_2.11-2.4.19
pact-jvm-consumer-specs2_2.11-2.4.18
pact-jvm-consumer-specs2_2.11-2.4.17
pact-jvm-consumer-specs2_2.11-2.4.16
pact-jvm-consumer-specs2_2.11-2.4.15
pact-jvm-consumer-specs2_2.11-2.4.14
pact-jvm-consumer-specs2_2.11-2.4.13
pact-jvm-consumer-specs2_2.11-2.4.12
pact-jvm-consumer-specs2_2.11-2.4.11
pact-jvm-consumer-specs2_2.11-2.4.10
pact-jvm-consumer-specs2_2.11-2.4.9
pact-jvm-consumer-specs2_2.11-2.4.8
pact-jvm-consumer-specs2_2.11-2.4.7
pact-jvm-consumer-specs2_2.11-2.4.6
pact-jvm-consumer-specs2_2.11-2.4.5
pact-jvm-consumer-specs2_2.11-2.4.4
pact-jvm-consumer-specs2_2.11-2.4.3
pact-jvm-consumer-specs2_2.11-2.4.2
pact-jvm-consumer-specs2_2.11-2.4.1
pact-jvm-consumer-specs2_2.11-2.4.0
2.3.x
pact-jvm-consumer-specs2_2.11-2.3.3
pact-jvm-consumer-specs2_2.11-2.3.2
pact-jvm-consumer-specs2_2.11-2.3.1
pact-jvm-consumer-specs2_2.11-2.3.0
2.2.x
pact-jvm-consumer-specs2_2.11-2.2.15
pact-jvm-consumer-specs2_2.11-2.2.14
pact-jvm-consumer-specs2_2.11-2.2.13
pact-jvm-consumer-specs2_2.11-2.2.12
pact-jvm-consumer-specs2_2.11-2.2.11
pact-jvm-consumer-specs2_2.11-2.2.10
pact-jvm-consumer-specs2_2.11-2.2.9
pact-jvm-consumer-specs2_2.11-2.2.8
pact-jvm-consumer-specs2_2.11-2.2.7
pact-jvm-consumer-specs2_2.11-2.2.6
pact-jvm-consumer-specs2_2.11-2.2.5
pact-jvm-consumer-specs2_2.11-2.2.4
pact-jvm-consumer-specs2_2.11-2.2.3
pact-jvm-consumer-specs2_2.11-2.2.2
pact-jvm-consumer-specs2_2.11-2.2.1
pact-jvm-consumer-specs2_2.11-2.2.0
2.1.x
pact-jvm-consumer-specs2_2.11-2.1.13
pact-jvm-consumer-specs2_2.11-2.1.12
pact-jvm-consumer-specs2_2.11-2.1.11
pact-jvm-consumer-specs2_2.11-2.1.10
pact-jvm-consumer-specs2_2.11-2.1.9
pact-jvm-consumer-specs2_2.11-2.1.8
pact-jvm-consumer-specs2_2.11-2.1.7
pact-jvm-consumer-specs2_2.11-2.1.6
pact-jvm-consumer-specs2_2.11-2.1.5
pact-jvm-consumer-specs2_2.11-2.1.4
pact-jvm-consumer-specs2_2.11-2.1.3
pact-jvm-consumer-specs2_2.11-2.1.2
pact-jvm-consumer-specs2_2.11-2.1.1
pact-jvm-consumer-specs2_2.11-2.1.0
2.0.x
pact-jvm-consumer-specs2_2.11-2.0.9
pact-jvm-consumer-specs2_2.11-2.0.8
pact-jvm-consumer-specs2_2.11-2.0.7
pact-jvm-consumer-specs2_2.11-2.0.6
pact-jvm-consumer-specs2_2.11-2.0.5
pact-jvm-consumer-specs2_2.11-2.0.4
pact-jvm-consumer-specs2_2.11-2.0.3
pact-jvm-consumer-specs2_2.11-2.0.2
pact-jvm-consumer-specs2_2.11-2.0.1
pact-jvm-consumer-specs2_2.11-2.0.0

How to add a dependency to Maven

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

<dependency>
    <groupId>au.com.dius</groupId>
    <artifactId>pact-jvm-consumer-specs2_2.11</artifactId>
    <version>3.5.24</version>
</dependency>

How to add a dependency to Gradle

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

implementation 'au.com.dius:pact-jvm-consumer-specs2_2.11:3.5.24'

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

implementation("au.com.dius:pact-jvm-consumer-specs2_2.11:3.5.24")

How to add a dependency to SBT Scala

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

libraryDependencies += "au.com.dius" % "pact-jvm-consumer-specs2_2.11" % "3.5.24"

Advertisement