Trait pact_models::pact::ReadWritePact[][src]

pub trait ReadWritePact {
    fn read_pact(path: &Path) -> Result<Self>
    where
        Self: Sized + Send + Sync
;
fn merge(&self, other: &dyn Pact) -> Result<Box<dyn Pact + Send + Sync>>;
fn default_file_name(&self) -> String; }
Expand description

Trait for objects that can represent Pacts and can be read and written

Required methods

Reads the pact file and parses the resulting JSON into a Pact struct

Merges this pact with the other pact, and returns a new Pact with the interactions sorted. Returns an error if there is a merge conflict, which will occur if the other pact is a different type, or if a V3 Pact then if any interaction has the same description and provider state and the requests and responses are different.

Determines the default file name for the pact. This is based on the consumer and provider names.

Implementors