Class MessagePact
-
- All Implemented Interfaces:
-
au.com.dius.pact.core.model.Pact
public final class MessagePact extends BasePact
Pact for a sequences of messages
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
MessagePact.Companion
-
Field Summary
Fields Modifier and Type Field Description private final List<Interaction>
interactions
private Provider
provider
private Consumer
consumer
private List<Message>
messages
private final Map<String, Object>
metadata
private final PactSource
source
public final static MessagePact.Companion
Companion
-
Constructor Summary
Constructors Constructor Description MessagePact(Provider provider, Consumer consumer, List<Message> messages, Map<String, Object> metadata, PactSource source)
MessagePact(Provider provider, Consumer consumer, List<Message> messages, Map<String, Object> metadata)
MessagePact(Provider provider, Consumer consumer, List<Message> messages)
MessagePact(Provider provider, Consumer consumer)
-
Method Summary
Modifier and Type Method Description List<Interaction>
getInteractions()
Returns all the interactions of the pact Provider
getProvider()
Returns the provider of the service for the pact Unit
setProvider(Provider provider)
Returns the provider of the service for the pact Consumer
getConsumer()
Returns the consumer of the service for the pact Unit
setConsumer(Consumer consumer)
Returns the consumer of the service for the pact final List<Message>
getMessages()
final Unit
setMessages(List<Message> messages)
Map<String, Object>
getMetadata()
Metadata associated with this Pact PactSource
getSource()
The source that this pact was loaded from Map<String, Object>
toMap(PactSpecVersion pactSpecVersion)
Returns a Map representation of this pact for the purpose of generating a JSON document. final Map<String, Object>
mergePacts(Map<String, Object> pact, File pactFile)
Pact
mergeInteractions(List<Interaction> interactions)
Merges all the interactions into this Pact Boolean
isRequestResponsePact()
If this pact is a synchronous request/response pact Result.Err<String>
asRequestResponsePact()
Converts this Pact into a concrete V3 HTTP Pact, if able to Result.Ok<MessagePact>
asMessagePact()
Converts this Pact into a concrete V3 Message Pact, if able to Result<V4Pact, String>
asV4Pact()
Converts this Pact into a concrete V4 Pact Pact
sortInteractions()
Returns a pact with the interactions sorted final MessagePact
mergePact(Pact other)
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
List<String>
validateForVersion(PactSpecVersion pactVersion)
Validates if this Pact can be used with the provided Pact specification version -
-
Method Detail
-
getInteractions
List<Interaction> getInteractions()
Returns all the interactions of the pact
-
getProvider
Provider getProvider()
Returns the provider of the service for the pact
-
setProvider
Unit setProvider(Provider provider)
Returns the provider of the service for the pact
-
getConsumer
Consumer getConsumer()
Returns the consumer of the service for the pact
-
setConsumer
Unit setConsumer(Consumer consumer)
Returns the consumer of the service for the pact
-
getMessages
final List<Message> getMessages()
-
setMessages
final Unit setMessages(List<Message> messages)
-
getMetadata
Map<String, Object> getMetadata()
Metadata associated with this Pact
-
getSource
PactSource getSource()
The source that this pact was loaded from
-
toMap
Map<String, Object> toMap(PactSpecVersion pactSpecVersion)
Returns a Map representation of this pact for the purpose of generating a JSON document.
-
mergeInteractions
Pact mergeInteractions(List<Interaction> interactions)
Merges all the interactions into this Pact
-
isRequestResponsePact
Boolean isRequestResponsePact()
If this pact is a synchronous request/response pact
-
asRequestResponsePact
Result.Err<String> asRequestResponsePact()
Converts this Pact into a concrete V3 HTTP Pact, if able to
-
asMessagePact
Result.Ok<MessagePact> asMessagePact()
Converts this Pact into a concrete V3 Message Pact, if able to
-
sortInteractions
Pact sortInteractions()
Returns a pact with the interactions sorted
-
mergePact
final MessagePact mergePact(Pact other)
-
validateForVersion
List<String> validateForVersion(PactSpecVersion pactVersion)
Validates if this Pact can be used with the provided Pact specification version
-
-
-
-