Skip to content

Releases: jbwheatley/pact4s

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

0.0.19

02 Oct 12:33
Compare
Choose a tag to compare

Several dependency bumps.

Syntax changes for building PactBrokerWithSelectors, ProviderTags and PublishVerificationResults.
Hopefully the ergonomics of constructing PactBrokerWithSelectors has been improved, especially for users constructing them from config. pact4s will also produce a runtime exception if an invalid combination of parameters are provided to PactBrokerWithSelectors. #82

v0.0.18

15 Sep 19:18
Compare
Choose a tag to compare

fixes an issue where verification suites would fail if pending pacts failed - #51 @kflorence

v0.0.17

06 Sep 11:55
bf84e2b
Compare
Choose a tag to compare
  • Add support for response factory verification for message pacts. Fixes #11 (@kflorence)

  • Much scaladoc added for various classes, particularly ProviderInfoBuilder.

  • Changes to the PactBrokerWithSelectors api

    • safer constructor to avoid exceptions from pact-jvm when bad argument combinations are provided. Uses builder pattern.
    • wipPactsSince no longer a finiteDuration - can now provide a Instant, OffsetDateTime or LocalDate.
  • pact-jvm for java 11+ -> 4.2.11, pact-jvm for java 8 -> 4.1.26

v0.0.15

02 Aug 15:50
Compare
Choose a tag to compare

Adds support for request filtering, e.g. for the injection/removal of headers.

Adds scala friendly versions of PactDslWithProvider#'given'

v0.0.13

29 Jul 16:13
Compare
Choose a tag to compare

Adds scala friendly versions of PactDslResponse#'given', PactDslWithState#'given', MessagePactBuilder#'given', and PactDslResponse#statusCodes (java 11+ only).

Resolves #38