MVN

au.com.dius.pact.consumer : specs2_2.13

Maven & Gradle

Jul 28, 2023
1k stars

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'.

<dependency>
    <groupId>au.com.dius.pact.consumer</groupId>
    <artifactId>specs2_2.13</artifactId>
    <version>4.1.42</version>
</dependency>
Copy
pom.xml
Table Of Contents

Latest Version

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

  • Latest Stable: 4.1.42
  • Latest Beta: 4.2.0-beta.3

All Versions

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

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

How to add a dependency to Maven

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

<dependency>
    <groupId>au.com.dius.pact.consumer</groupId>
    <artifactId>specs2_2.13</artifactId>
    <version>4.1.42</version>
</dependency>

How to add a dependency to Gradle

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

implementation 'au.com.dius.pact.consumer:specs2_2.13:4.1.42'

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

implementation("au.com.dius.pact.consumer:specs2_2.13:4.1.42")

How to add a dependency to SBT Scala

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

libraryDependencies += "au.com.dius.pact.consumer" % "specs2_2.13" % "4.1.42"

Advertisement

Dependencies from Group

Aug 18, 2023
3 usages
1k stars
Aug 18, 2023
3 usages
1k stars
Jul 28, 2023
1k stars
Jul 28, 2023
1k stars
Aug 18, 2023
1k stars

Discover Dependencies

Jun 08, 2020
Jun 08, 2020
May 25, 2020
2 stars
Oct 11, 2020
1 usages
34 stars
May 26, 2020
May 22, 2023
0 stars
Aug 26, 2023
2 usages
2.6k stars
Mar 29, 2021
237 stars