pub struct RequestResponseInteraction {
pub id: Option<String>,
pub description: String,
pub provider_states: Vec<ProviderState>,
pub request: Request,
pub response: Response,
}
Expand description
Struct that defines an interaction (request and response pair)
Fields§
§id: Option<String>
Interaction ID. This will only be set if the Pact file was fetched from a Pact Broker
description: String
Description of this interaction. This needs to be unique in the pact file.
provider_states: Vec<ProviderState>
Optional provider states for the interaction.
See <https://docs.pact.io/getting_started/provider_states>
for more info on provider states.
request: Request
Request of the interaction
response: Response
Response of the interaction
Implementations§
source§impl RequestResponseInteraction
impl RequestResponseInteraction
sourcepub fn from_json(
index: usize,
pact_json: &Value,
spec_version: &PactSpecification
) -> Result<RequestResponseInteraction>
pub fn from_json( index: usize, pact_json: &Value, spec_version: &PactSpecification ) -> Result<RequestResponseInteraction>
Constructs an Interaction
from the Value
struct.
sourcepub fn to_json(&self, spec_version: &PactSpecification) -> Value
pub fn to_json(&self, spec_version: &PactSpecification) -> Value
Converts this interaction to a Value
struct.
sourcepub fn conflicts_with(&self, other: &dyn Interaction) -> Vec<PactConflict>
pub fn conflicts_with(&self, other: &dyn Interaction) -> Vec<PactConflict>
Returns list of conflicts if this interaction conflicts with the other interaction.
Two interactions conflict if they have the same description and provider state, but they request and responses are not equal
sourcepub fn schema(_spec_version: PactSpecification) -> Value
pub fn schema(_spec_version: PactSpecification) -> Value
Generate the JSON schema properties for the given Pact specification
Trait Implementations§
source§impl Clone for RequestResponseInteraction
impl Clone for RequestResponseInteraction
source§fn clone(&self) -> RequestResponseInteraction
fn clone(&self) -> RequestResponseInteraction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RequestResponseInteraction
impl Debug for RequestResponseInteraction
source§impl Default for RequestResponseInteraction
impl Default for RequestResponseInteraction
source§impl Display for RequestResponseInteraction
impl Display for RequestResponseInteraction
source§impl Hash for RequestResponseInteraction
impl Hash for RequestResponseInteraction
source§impl Interaction for RequestResponseInteraction
impl Interaction for RequestResponseInteraction
source§fn is_request_response(&self) -> bool
fn is_request_response(&self) -> bool
source§fn as_request_response(&self) -> Option<RequestResponseInteraction>
fn as_request_response(&self) -> Option<RequestResponseInteraction>
source§fn is_message(&self) -> bool
fn is_message(&self) -> bool
source§fn as_message(&self) -> Option<Message>
fn as_message(&self) -> Option<Message>
source§fn id(&self) -> Option<String>
fn id(&self) -> Option<String>
source§fn description(&self) -> String
fn description(&self) -> String
source§fn set_description(&mut self, description: &str)
fn set_description(&mut self, description: &str)
source§fn provider_states(&self) -> Vec<ProviderState>
fn provider_states(&self) -> Vec<ProviderState>
<https://docs.pact.io/getting_started/provider_states>
for more info on provider states.source§fn provider_states_mut(&mut self) -> &mut Vec<ProviderState>
fn provider_states_mut(&mut self) -> &mut Vec<ProviderState>
<https://docs.pact.io/getting_started/provider_states>
for more info on provider states.source§fn contents(&self) -> OptionalBody
fn contents(&self) -> OptionalBody
source§fn contents_for_verification(&self) -> OptionalBody
fn contents_for_verification(&self) -> OptionalBody
source§fn content_type(&self) -> Option<ContentType>
fn content_type(&self) -> Option<ContentType>
Content-Type
header or metadata value is present, the
value of that value will be returned. Otherwise, the contents will be inspected.source§fn as_v4(&self) -> Option<Box<dyn V4Interaction + Send + Sync + RefUnwindSafe>>
fn as_v4(&self) -> Option<Box<dyn V4Interaction + Send + Sync + RefUnwindSafe>>
source§fn as_v4_mut(&mut self) -> Option<&mut dyn V4Interaction>
fn as_v4_mut(&mut self) -> Option<&mut dyn V4Interaction>
as_v4
method can convert to V4 format (via cloning the data).source§fn as_v4_http(&self) -> Option<SynchronousHttp>
fn as_v4_http(&self) -> Option<SynchronousHttp>
source§fn as_v4_async_message(&self) -> Option<AsynchronousMessage>
fn as_v4_async_message(&self) -> Option<AsynchronousMessage>
source§fn as_v4_sync_message(&self) -> Option<SynchronousMessage>
fn as_v4_sync_message(&self) -> Option<SynchronousMessage>
source§fn as_v4_http_mut(&mut self) -> Option<&mut SynchronousHttp>
fn as_v4_http_mut(&mut self) -> Option<&mut SynchronousHttp>
source§fn as_v4_async_message_mut(&mut self) -> Option<&mut AsynchronousMessage>
fn as_v4_async_message_mut(&mut self) -> Option<&mut AsynchronousMessage>
source§fn as_v4_sync_message_mut(&mut self) -> Option<&mut SynchronousMessage>
fn as_v4_sync_message_mut(&mut self) -> Option<&mut SynchronousMessage>
source§fn boxed(&self) -> Box<dyn Interaction + Send + Sync + RefUnwindSafe>
fn boxed(&self) -> Box<dyn Interaction + Send + Sync + RefUnwindSafe>
source§fn arced(&self) -> Arc<dyn Interaction + Send + Sync + RefUnwindSafe>
fn arced(&self) -> Arc<dyn Interaction + Send + Sync + RefUnwindSafe>
source§fn thread_safe(
&self
) -> Arc<Mutex<dyn Interaction + Send + Sync + RefUnwindSafe>>
fn thread_safe( &self ) -> Arc<Mutex<dyn Interaction + Send + Sync + RefUnwindSafe>>
source§fn matching_rules(&self) -> Option<MatchingRules>
fn matching_rules(&self) -> Option<MatchingRules>
source§fn is_v4_http(&self) -> bool
fn is_v4_http(&self) -> bool
source§fn is_v4_async_message(&self) -> bool
fn is_v4_async_message(&self) -> bool
source§fn is_v4_sync_message(&self) -> bool
fn is_v4_sync_message(&self) -> bool
source§impl PactJsonVerifier for RequestResponseInteraction
impl PactJsonVerifier for RequestResponseInteraction
source§fn verify_json(
path: &str,
pact_json: &Value,
strict: bool,
spec_version: PactSpecification
) -> Vec<PactFileVerificationResult>
fn verify_json( path: &str, pact_json: &Value, strict: bool, spec_version: PactSpecification ) -> Vec<PactFileVerificationResult>
source§impl PartialEq for RequestResponseInteraction
impl PartialEq for RequestResponseInteraction
source§fn eq(&self, other: &RequestResponseInteraction) -> bool
fn eq(&self, other: &RequestResponseInteraction) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for RequestResponseInteraction
impl StructuralEq for RequestResponseInteraction
impl StructuralPartialEq for RequestResponseInteraction
Auto Trait Implementations§
impl RefUnwindSafe for RequestResponseInteraction
impl Send for RequestResponseInteraction
impl Sync for RequestResponseInteraction
impl Unpin for RequestResponseInteraction
impl UnwindSafe for RequestResponseInteraction
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.