-
- All Implemented Interfaces:
-
au.com.dius.pact.core.model.Interaction
,au.com.dius.pact.core.model.SynchronousRequestResponse
public class RequestResponseInteraction extends BaseInteraction implements SynchronousRequestResponse
Interaction between a consumer and a provider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
RequestResponseInteraction.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Request
request
private final Response
response
private final String
interactionId
private final String
description
private final List<ProviderState>
providerStates
private final Map<String, JsonValue>
comments
-
Constructor Summary
Constructors Constructor Description RequestResponseInteraction(String description, List<ProviderState> providerStates, Request request, Response response, String interactionId)
RequestResponseInteraction(String description, List<ProviderState> providerStates, Request request, Response response)
RequestResponseInteraction(String description, List<ProviderState> providerStates, Request request)
RequestResponseInteraction(String description, List<ProviderState> providerStates)
RequestResponseInteraction(String description)
-
Method Summary
Modifier and Type Method Description Request
getRequest()
Request part Response
getResponse()
Response part String
getInteractionId()
Interaction ID. String
getDescription()
Interaction description List<ProviderState>
getProviderStates()
Returns the provider states for this interaction Map<String, JsonValue>
getComments()
Annotations and comments associated with this interaction String
toString()
Boolean
conflictsWith(Interaction other)
Checks if this interaction conflicts with the other one. String
uniqueKey()
Generates a unique key for this interaction Map<String, Object>
toMap(PactSpecVersion pactSpecVersion)
Converts this interaction to a Map Boolean
equals(Object other)
Integer
hashCode()
List<String>
validateForVersion(PactSpecVersion pactVersion)
Validates if this Interaction can be used with the provided Pact specification version V4Interaction
asV4Interaction()
Converts this interaction to a V4 format Boolean
isSynchronousRequestResponse()
If this interaction is synchronous request/response RequestResponseInteraction
asSynchronousRequestResponse()
If this interaction is synchronous request/response, returns it. -
Methods inherited from class au.com.dius.pact.core.model.RequestResponseInteraction
displayState
-
Methods inherited from class au.com.dius.pact.core.model.BaseInteraction
asAsynchronousMessage, asMessage, asSynchronousMessages, isAsynchronousMessage, isSynchronousMessages, isV4
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
RequestResponseInteraction
RequestResponseInteraction(String description, List<ProviderState> providerStates, Request request, Response response, String interactionId)
-
RequestResponseInteraction
RequestResponseInteraction(String description, List<ProviderState> providerStates, Request request, Response response)
-
RequestResponseInteraction
RequestResponseInteraction(String description, List<ProviderState> providerStates, Request request)
-
RequestResponseInteraction
RequestResponseInteraction(String description, List<ProviderState> providerStates)
-
RequestResponseInteraction
RequestResponseInteraction(String description)
-
-
Method Detail
-
getRequest
Request getRequest()
Request part
-
getResponse
Response getResponse()
Response part
-
getInteractionId
String getInteractionId()
Interaction ID. Will only be populated from pacts loaded from a Pact Broker
-
getDescription
String getDescription()
Interaction description
-
getProviderStates
List<ProviderState> getProviderStates()
Returns the provider states for this interaction
-
getComments
Map<String, JsonValue> getComments()
Annotations and comments associated with this interaction
-
conflictsWith
Boolean conflictsWith(Interaction other)
Checks if this interaction conflicts with the other one. Used for merging pact files.
-
toMap
Map<String, Object> toMap(PactSpecVersion pactSpecVersion)
Converts this interaction to a Map
-
validateForVersion
List<String> validateForVersion(PactSpecVersion pactVersion)
Validates if this Interaction can be used with the provided Pact specification version
-
asV4Interaction
V4Interaction asV4Interaction()
Converts this interaction to a V4 format
-
isSynchronousRequestResponse
Boolean isSynchronousRequestResponse()
If this interaction is synchronous request/response
-
asSynchronousRequestResponse
RequestResponseInteraction asSynchronousRequestResponse()
If this interaction is synchronous request/response, returns it. Otherwise returns null.
-
-
-
-