Skip to content

Releases: ITV/scala-pact

Scala-pact 2.4.0

20 Oct 10:55
Compare
Choose a tag to compare

This release aims to be source-compatible with the previous version, 2.3.18, but includes a number of significant changes. Scala-pact now cross-compiles (where possible) against Scala 2.12.12 and 2.13.3.

  • scala-pact-argonaut-6-2 now cross-compiles against scala 2.13 and has argonaut version bumped to 6.2.5 (#179).

  • Increased strictness of what is exposed in the public API. The aim is to only expose in the objects ScalaPactVerify and ScalaPactForger the building blocks for pact tests, and nothing else. Some things here have moved, others have been made private, but they shouldn't be classes that were being used directly.

  • In ScalaPactVerify, the timeout for the pact broker client is now configurable for PactSourceTypes that use a broker: pactBrokerUseLatest, pactBrokerWithTags, pactBrokerWithVersion, and pactBrokerWithVersionSelectors (more on this one later). Previously this timeout was being taken from argument passed to .runVerificationAgainst and was not separately configurable.

  • Sbt setting keys added for configuring the pact broker client timeout, and the ssl context name to be used when using the plugin commands (#181), pactBrokerClientTimeout, and sslContextName, respectively. Similar to above, these were not separately configurable in the past.

  • Remove hard-coded client timeout for ResultsPublisher (#183). If verification results were being published as part of your tests (using the publishResultsEnabled field in the pact source), a hard-coded timeout of 10 seconds was used. This timeout will now be the one configured in either of the above two methods.

  • All the functionality of scalapact-scalatest can now be used via mix-in in your test suites (#182).The existing behaviour (which remains) requires 3 dependencies (e.g. scalapact-scalatest, scalapact-http4s-021 and scalapact-circe-0-13), and explicit imports import com.itv.scalapact.http._ and import com.itv.scalapact.json._ to use. Instead, a single dependency can now be used: "com.itv" %% "scalapact-scalatest-suite" % "2.4.0" % "test", and two traits PactVerifySuite and PactForgerSuite can be mixed into test suites to use the entire scalapact API without addition imports. (N.B. this using http4s 0.21.x and circe 0.13.0 under the hood).

  • If your pact-broker is on version >2.6.x, you can now start making use of the pacts for verification endpoint (#178). See the master issue from the pact foundation for more information here: pact-foundation/pact_broker#307. To facilitate this, the scala-pact API has expanded to include a new pact source: pactBrokerWithVersionSelectors to which you pass a list of ConsumerVersionSelectors, and a list of ProviderVersionTags. In addition, new sbt setting keys have been added for the plugin that allow these values to be set in your pact.sbt to be used when running sbt pactVerify. This feature paves the way for "pending" and "WIP" pacts to be enabled in future releases of scala-pact.