jar

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

Maven & Gradle

Apr 29, 2020
1k stars

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

Table Of Contents

Latest Version

Download au.com.dius : pact-jvm-consumer-specs2_2.12 JAR file - Latest Versions:

All Versions

Download au.com.dius : pact-jvm-consumer-specs2_2.12 JAR file - All Versions:

Version Vulnerabilities Size Updated
4.0.x
3.6.x
3.5.x

View Java Class Source Code in JAR file

  1. Download JD-GUI to open JAR file and explore Java source code file (.class .java)
  2. Click menu "File → Open File..." or just drag-and-drop the JAR file in the JD-GUI window pact-jvm-consumer-specs2_2.12-3.6.15.jar file.
    Once you open a JAR file, all the java classes in the JAR file will be displayed.

au.com.dius.pact.consumer.specs2.dispatch

├─ au.com.dius.pact.consumer.specs2.dispatch.HttpClient.class - [JAR]

au.com.dius.pact.consumer.specs2

├─ au.com.dius.pact.consumer.specs2.PactFragmentBuilder.class - [JAR]

├─ au.com.dius.pact.consumer.specs2.PactSpec.class - [JAR]

├─ au.com.dius.pact.consumer.specs2.PrettyPrinter.class - [JAR]

├─ au.com.dius.pact.consumer.specs2.UnitSpecsSupport.class - [JAR]

├─ au.com.dius.pact.consumer.specs2.VerificationResultAsResult.class - [JAR]

Advertisement

Dependencies from Group

Apr 29, 2020
31 usages
1k stars
Nov 04, 2018
27 usages
1k stars
Nov 04, 2018
18 usages
1k stars
Apr 29, 2020
13 usages
1k stars
Apr 29, 2020
12 usages
1k stars

Discover Dependencies

Mar 26, 2018
3 usages
0 stars
Jul 27, 2020
0 stars
Oct 26, 2017
23 stars
Sep 25, 2017
1 usages
29 stars
Jan 04, 2021
2 usages
2 stars