Struct pact_mock_server::MockServer
[−]
[src]
pub struct MockServer { pub id: String, pub port: i32, pub server: u64, pub matches: Vec<MatchResult>, pub resources: Vec<CString>, pub pact: Pact, }
Struct to represent a mock server
Fields
id: String
Mock server unique ID
port: i32
Port the mock server is running on
server: u64
Address of the server implementing the Listening
trait
matches: Vec<MatchResult>
List of all match results for requests this mock server has received
resources: Vec<CString>
List of resources that need to be cleaned up when the mock server completes
pact: Pact
Pact that this mock server is based on
Methods
impl MockServer
[src]
fn new(id: String, pact: &Pact) -> MockServer
Creates a new mock server with the given ID and pact
fn port(&mut self, port: i32)
Sets the port that the mock server is listening on
fn server(&mut self, server: &Listening)
Sets the address of the server implementing the Listening
trait
fn to_json(&self) -> Value
Converts this mock server to a Value
struct
fn mismatches(&self) -> Vec<MatchResult>
Returns all the mismatches that have occured with this mock server
fn write_pact(&self, output_path: &Option<String>) -> Result<()>
Mock server writes it pact out to the provided directory
fn url(&self) -> String
Returns the URL of the mock server