Last Version

pact-jvm-consumer-specs2_2.10 2.4.20

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.2" ``` or if you are using Gradle: ```groovy dependencies { testCompile "au.com.dius:pact-jvm-consumer-specs2_2.11:3.2.2" } ``` __*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 ```

License

License

GroupId

GroupId

au.com.dius
ArtifactId

ArtifactId

pact-jvm-consumer-specs2_2.10
Version

Version

2.4.20
Type

Type

jar
Description

Description

pact-jvm-consumer-specs2_2.10
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.2" ``` or if you are using Gradle: ```groovy dependencies { testCompile "au.com.dius:pact-jvm-consumer-specs2_2.11:3.2.2" } ``` __*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 ```
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.10 2.4.20


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

Dependencies

compile (4)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.21
org.scala-lang : scala-library jar 2.10.7
au.com.dius : pact-jvm-consumer_2.10 jar 2.4.20
org.specs2 : specs2-core_2.10 jar 3.8.4

test (10)

Group / Artifact Type Version
org.specs2 : specs2-junit_2.10 jar 3.8.4
org.hamcrest : hamcrest-all jar 1.3
org.mockito : mockito-core jar 1.10.19
junit : junit jar 4.12
org.codehaus.groovy : groovy-all jar 2.4.12
org.spockframework : spock-core jar 1.1-groovy-2.4
cglib : cglib jar 3.2.4
org.objenesis : objenesis jar 2.4
ch.qos.logback : logback-core jar 1.1.7
ch.qos.logback : logback-classic jar 1.1.7

Project Modules

There are no modules declared in this project.