pact4s.provider

Type members

Classlikes

sealed trait Authentication

Auth for accessing a pact-broker. Used in PactSource.PactBroker

Auth for accessing a pact-broker. Used in PactSource.PactBroker

Companion:
object
Companion:
class
final case class Branch(branch: String)
Companion:
object
object Branch
Companion:
class

Consumer version selectors. See https://docs.pact.io/pact_broker/advanced_topics/selectors

Companion:
object
sealed trait PactSource
Companion:
object
object PactSource
Companion:
class

Interface for defining the provider that consumer pacts are verified against. Internally gets converted to au.com.dius.pact.provider.ProviderInfo during verification.

Interface for defining the provider that consumer pacts are verified against. Internally gets converted to au.com.dius.pact.provider.ProviderInfo during verification.

Use the apply methods in the companion object to construct.

Value parameters:
host

mock provider host

name

the name of the provider

pactSource

pacts to verify can come either from a file location, or from a pact broker.

path

address of the mock provider server is {protocol}://{host}:{port}{path}

port

mock provider port

protocol

e.g. http or https

requestFilter

Apply filters to certain consumer requests. The most common use case for this is adding auth headers to requests

stateManagement

Used for the setting of provider state before each interaction with state is run. Can be either: (1) the url of a endpoint on the mock provider that can configure internal state. Can be set using a full url with ProviderInfoBuilder#withStateChangeUrl or simply by providing the endpoint with ProviderInfoBuilder#withStateChangeEndpoint. State is sent as a json of the form {"state": "state name", "params": {"param1" : "paramValue"}}. Decoders for ProviderState can be found in the json-modules, or defined by the user. (2) a partial function => Unit provided by ProviderInfoBuilder#withStateChangeFunction which will be applied before each interaction is run. This works by using a mock internal server, the host of which can be configured using ProviderInfoBuilder#withStateChangeFunctionConfigOverrides

verificationSettings

Required if verifying message pacts using the old java-y annotated method search. Not needed if using the response factory method.

See also:
Companion:
object
Companion:
class
final class ProviderRequest

A simplified interface for managing the requests sent by pact-jvm to the mock provider service. Used in conjunction with ProviderRequestFilter in ProviderInfoBuilder.withRequestFiltering

A simplified interface for managing the requests sent by pact-jvm to the mock provider service. Used in conjunction with ProviderRequestFilter in ProviderInfoBuilder.withRequestFiltering

Companion:
object
Companion:
class

pact-jvm uses apache-http as its http implementation. A ProviderRequestFilter applies a transformation to a org.apache.http.HttpRequest before passing it to the mock provider server. Its called a "filter" here as this is what its called in other pact implementations. It doesn't filter in the sense of stopping certain requests from reaching the mock server.

pact-jvm uses apache-http as its http implementation. A ProviderRequestFilter applies a transformation to a org.apache.http.HttpRequest before passing it to the mock provider server. Its called a "filter" here as this is what its called in other pact implementations. It doesn't filter in the sense of stopping certain requests from reaching the mock server.

Companion:
object
final case class ProviderState(state: String, params: Map[String, String])

Entity passed to the mock provider state setup endpoint by pact-jvm before running consumer pacts with state. Decoders are provided in each JSON library module (circe or play-json).

Entity passed to the mock provider state setup endpoint by pact-jvm before running consumer pacts with state. Decoders are provided in each JSON library module (circe or play-json).

final case class ProviderTags(head: String, tail: List[String])
Companion:
object
Companion:
class
sealed abstract class ProviderVerificationOption(val key: String)
Companion:
object
Companion:
object
sealed trait ResponseBuilder
Companion:
object
Companion:
class
sealed trait StateManagement
Companion:
object
Companion:
class
Companion:
object
Companion:
class
final class WipPactsSince
Companion:
object
Companion:
class

Deprecated classlikes

Value parameters:
additionalSelectors

see https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/provider-pacts-for-verification.markdown for a list of available selectors that can be set. This list is subject to change and so we leave it to the user add any other selectors they require here rather than having them as strongly-typed fields.

branch

the branch name of the consumer versions to get the pacts for. Use of this selector requires that the consumer has configured a branch name when publishing the pacts.

consumer

allows a selector to only be applied to a certain consumer. This is used for example when there is an API that has multiple consumers, one of which is a deployed service, and one of which is a mobile consumer. The deployed service only needs the latest production pact verified, where as the mobile consumer may want all the production pacts verified.

fallbackTag

the name of the tag to fallback to if the specified tag does not exist. This is useful when the consumer and provider use matching branch names to coordinate the development of new features. This field is still supported but it is recommended to use the fallbackBranch in preference now.

latest

Used in conjunction with the tag property. If a tag is specified, and latest is true, then the latest pact for each of the consumers with that tag will be returned. If a tag is specified and the latest flag is not set to true, all the pacts with the specified tag will be returned. (This might seem a bit weird, but it's done this way to match the syntax used for the matrix query params. See https://docs.pact.io/selectors).

mainBranch

Return the pacts for the configured mainBranch of each consumer.Use of this selector requires that the consumer has configured the mainBranch property, and has set a branch name when publishing the pacts.

matchingBranch

When true, returns the latest pact for any branch with the same name as the specified providerVersionBranch.

tag

the tag name(s) of the consumer versions to get the pacts for. This field is still supported but it is recommended to use the branch in preference now.

See also:
Companion:
object
Deprecated