pact4s
package pact4s
- Alphabetic
- Public
- All
Type Members
-
sealed
trait
Authentication extends AnyRef
Auth for accessing a pact-broker
- trait BasePactForgerResources extends Pact4sLogger
- trait BasePactForgerResourcesForPlatform[Pact <: BasePact[_]] extends BasePactForgerResources
-
final
case class
ConsumerVersionSelector(tag: Option[String] = None, latest: Boolean = true, fallbackTag: Option[String] = None, consumer: Option[String] = None) extends Product with Serializable
- tag
the tag name(s) of the consumer versions to get the pacts for.
- latest
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.
- fallbackTag
default true. If the latest flag is omitted, 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)
- 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.
- See also
https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors/ and https://github.com/pact-foundation/pact_broker/issues/307 Gets converted into a au.com.dius.pact.core.pactbroker.ConsumerVersionSelector under the hood.
- sealed case class MessageAndMetadataBuilder(message: Array[Byte], metadata: Map[String, Any]) extends ResponseBuilder with Product with Serializable
- trait MessagePactDecoder[A] extends AnyRef
- trait MessagePactForgerResources extends BasePactForgerResourcesForPlatform[MessagePact] with MessagePactOps
- trait MessagePactOps extends AnyRef
- trait Pact4sLogger extends AnyRef
- trait PactBodyJsonEncoder[A] extends AnyRef
- trait PactDslJsonBodyEncoder[A] extends AnyRef
- sealed trait PactSource extends AnyRef
- trait PactVerifyResources extends AnyRef
-
final
case class
ProviderInfoBuilder(name: String, protocol: String, host: String, port: Int, path: String, pactSource: PactSource, stateChangeUrl: Option[String] = None, verificationSettings: Option[VerificationSettings] = None, requestFilter: (ProviderRequest) ⇒ List[ProviderRequestFilter] = _ => Nil) extends Product with Serializable
Interface for defining the provider that consumer pacts are verified against.
Interface for defining the provider that consumer pacts are verified against. Internally gets converted to au.com.dius.pact.provider.ProviderInfo during verification.
- name
the name of the provider
- path
address of the mock provider server is {protocol}://{host}:{port}{path}
- pactSource
pacts to verify can come either from a file location, or from a pact broker.
- stateChangeUrl
full url of the mock provider endpoint that can be used for setting provider state before each pact with state is run. state is sent as JSON of the form {"state": "state goes here"}. Can also be set using ProviderInfoBuilder#withStateChangeEndpoint just by providing the path.
- verificationSettings
Required if verifying message pacts
- requestFilter
Apply filters to certain consumer requests. The most common use case for this is adding auth headers to requests
- See also
https://docs.pact.io/faq/#how-do-i-test-oauth-or-other-security-headers
-
final
case class
ProviderRequest extends Product with Serializable
A simplified interface for managing the requests sent by pact-jvm to the mock provider service.
A simplified interface for managing the requests sent by pact-jvm to the mock provider service. Used in conjunction with ProviderRequestFilter in ProviderInfoBuilder.requestFilter
-
trait
ProviderRequestFilter extends AnyRef
pact-jvm uses apache-http as its http implementation.
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" 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.
- sealed case class ProviderResponseBuilder(statusCode: Int, contentType: Option[String], headers: Map[String, List[String]], data: Option[String]) extends ResponseBuilder with Product with Serializable
-
final
case class
ProviderState(state: String) extends AnyVal with Product with Serializable
entity passed to the mock provider state setup endpoint by pact-jvm before running consumer pacts with state.
entity passed to the mock provider state setup endpoint by pact-jvm before running consumer pacts with state. A circe.Decoder instance is provided in the pact4s-circe module.
- sealed abstract class ProviderVerificationOption extends AnyRef
- final case class PublishVerificationResults(providerVersion: String, providerTags: List[String]) extends Product with Serializable
- trait RequestResponsePactForgerResources extends BasePactForgerResourcesForPlatform[RequestResponsePact] with RequestResponsePactOps
- trait RequestResponsePactOps extends AnyRef
- sealed trait ResponseBuilder extends AnyRef
- sealed trait VerificationSettings extends AnyRef
Value Members
- object Authentication
- object MessageAndMetadataBuilder extends Serializable
- object MessagePactOps
- object MessagePactOpsForPlatform
- object PactBodyJsonEncoder
- object PactSource
- object ProviderInfoBuilder extends Serializable
- object ProviderRequestFilter
- object ProviderResponseBuilder extends Serializable
- object ProviderVerificationOption
- object RequestResponsePactOps
- object RequestResponsePactOpsForPlatform
- object VerificationSettings