Releases: jbwheatley/pact4s
v0.1.0
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
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
version4.3.x
for java11+ - #125 @gaeljw params
field of typeMap[String, String]
added toProviderState
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 toProviderInfoBuilder
, 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 usingProviderInfoBuilder#withStateChangeFunction(stateChange: PartialFunction[ProviderState, Unit])
orProviderInfoBuilder#withStateChangeFunction(stateChange: ProviderState => Unit)
. This feature works by spinning up an additional state-change mock server thatpact-jvm
sends a request with theProviderState
json to before each interaction is run against the mock provider. The state-change server will apply the function to the deserialisedProviderState
. The default host for this server ishttp://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 useProviderInfoBuilder#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 usingpact-jvm
version4.1.x
was moved to its own branch, drastically simplifying thepact4s
build. Thejava 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 topact4s-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 packagepact4s.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
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
fixes an issue where verification suites would fail if pending pacts failed - #51 @kflorence
v0.0.17
-
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 aInstant
,OffsetDateTime
orLocalDate
.
-
pact-jvm for java 11+ -> 4.2.11, pact-jvm for java 8 -> 4.1.26
v0.0.15
Adds support for request filtering, e.g. for the injection/removal of headers.
Adds scala friendly versions of PactDslWithProvider#'given'