Skip to content

Releases: jbwheatley/pact4s

v0.7.0-java8

24 Nov 15:53
73d4d9d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.6.0-java8...v0.7.0-java8

v0.7.0

24 Nov 15:54
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.6.0...v0.7.0

v0.6.0-java8

31 Oct 16:38
a11de72
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.0.19...v0.6.0-java8

v0.6.0

31 Oct 16:38
cf83293
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.5.1...v0.6.0

v0.5.0

30 Aug 09:57
Compare
Choose a tag to compare

equivalent java 8 version is v0.5.0-java8

What's Changed

Full Changelog: v0.4.1...v0.5.0

v0.4.0

28 Jun 16:03
0f07e65
Compare
Choose a tag to compare

This is the first release that targets scala 3. This has been a long time coming - I first tried this in April 2021 using 3.0.0-RC2 and discovered this compiler bug that prevented moving forward: scala/scala3#12086
This has now been fixed in 3.1.3!

As usual, the java8 compatible version is available as 0.4.0-java8.

v0.3.1

27 May 08:44
b0ccab6
Compare
Choose a tag to compare

Fixes issue with provider state callbacks not inserting parameters into requests. issues #197 #122, fixed in #200 @jbwheatley

0.3.0

15 Apr 10:48
44feada
Compare
Choose a tag to compare

This version should be source compatible with 0.2.0. Apart from version updates, in this release:

  • #176 changed how data classes are defined internally and added additional convenient to use constructors for many of the models.
  • #181 addressed an issue with pact forging. pact-jvm will not write pacts to a file if not all interactions have been registered by the mock server - e.g. if you don't have a test for each interaction. This error is now surfaced to the user and will cause the forger suite to fail if not all interactions are tested.

What's Changed

Full Changelog: v0.2.0...v0.3.0

v0.2.0

26 Feb 20:35
1c1259e
Compare
Choose a tag to compare
  • Added support for branches in consumer version selectors - see #89

Added the following methods on ConsumerVersionSelector to facilitate these additions:

ConsumerVersionSelector().
  withBranch(Branch("foo")) 

For convenience we include Branch.MAIN and Branch.MASTER for main and master resp.

ConsumerVersionSelector().
  withMainBranch(true)
ConsumerVersionSelector().
  withMatchingBranch(true) //gets pacts with branch that is the same as the current branch name. 
  • Added support for consumer version selectors for deployed and released versions - see #68

As the selectors in this issue are subject to change, and more may be made available to the broker in the future, additional selectors such as these can be provided with the following method on ConsumerVersionSelector:

ConsumerVersionSelector().
  withAdditionalSelectors(Map("deployed" -> true, "environment" -> "stg"))
  • Added support for publishing verification results with a branch - see #87
    When verifying pacts, the argument publishVerificationResults provided to the test function verifyPacts can be modified to specify the branch that will be associated with the verification results when they are published:
verifyPacts(
  publishVerificationResults = Some(
    PublishVerificationResults(
      providerVersion = "ABC",
      branch = Branch("feature/x")
    )
  )
)
  • Added apply method for ProviderInfoBuilder apply(name: String, providerUrl: URL, pactSource: PactSource) that takes a URL

v0.1.0

06 Jan 15:46
1176969
Compare
Choose a tag to compare

This release is quite large, including bug fixes, model changes, additional features and some major rearranging of the core module, including many package changes.

Bug fixes

  • Adding headers to ProviderResponseBuilder now correctly converts to java - #141 @Arknot

New features

  • module for play-json support for json helpers - #114 @gaeljw
  • Pact spec v4 is now the default, following the upgrade to pact-jvm version 4.3.x for java11+ - #125 @gaeljw
  • params field of type Map[String, String] added to ProviderState class - #136 @gaeljw
  • Configurable optional timeout for pact verification - @jbwheatley. This will cause the test class to fail after the timeout has completed, regardless of whether the pacts are pending or not. The default timeout is 30 seconds.
//e.g.
verifyPacts(
  verificationTimeout = Some(10.seconds)
)
  • ProviderRequestFilters can now be composed with .andThen - @jbwheatley. This is now the preferred method of adding the filters to ProviderInfoBuilder, e.g.:
.withRequestFiltering(
  req => 
    ProviderRequestFilter.SetHeaders(("Authorization", "Bearer token")) andThen
      ProviderRequestFilter.RemoveHeaders("fooHeader")
) 
  • Provider state change can now be applied using a state change function, in addition to the current method of using a state change endpoint - #143 @jbwheatley. This can be added to the ProviderInfoBuilder in a pact verification suite using ProviderInfoBuilder#withStateChangeFunction(stateChange: PartialFunction[ProviderState, Unit]) or ProviderInfoBuilder#withStateChangeFunction(stateChange: ProviderState => Unit). This feature works by spinning up an additional state-change mock server that pact-jvm sends a request with the ProviderState json to before each interaction is run against the mock provider. The state-change server will apply the function to the deserialised ProviderState. The default host for this server is http://localhost:64646/pact4s-state-change. If you would like to use a different host for this functionality (e.g. if that port is already in use), then you can use ProviderInfoBuilder#withStateChangeFunctionConfigOverrides to update it. e.g.:
.withStateChangeFunction { 
  case ProviderState("bob exists", params) => updateStateForBob(params)
  case _ => ???
}.withStateChangeFunctionConfigOverrides(_.withOverrides(portOverride = 64640))

Rearranging etc.

  • support for java 8, i.e. building using pact-jvm version 4.1.x was moved to its own branch, drastically simplifying the pact4s build. The java 8 versions of the modules are now no longer suffixed with -java8, instead the version number is suffixed. i.e, if before you were adding "io.github.jbwheatley" %% "pact4s-scalatest-java8" % "0.1.0" as a dependency, you would now add "io.github.jbwheatley" %% "pact4s-scalatest" % "0.1.0-java8".
  • The shared module was renamed to pact4s-core. This shouldn't effect users as they shouldn't ever need to explicitly add it as a dependency - @jbwheatley
  • All classes that were used to define the provider information used during the pact verification suite have moved from package pact4s to package pact4s.provider - @jbwheatley. This has been done to improve the structuring of the core module. These include:
- Authentication
- ConsumerVersionSelector
- PactSource
- ProviderInfoBuilder
- ProviderRequest
- ProviderRequestFilter
- ProviderState
- ProviderTags
- ProviderVerificationOption
- PublishVerificationResults
- ResponseBuilder
- VerificationSettings
- WipPactsSince