pub trait ValidatingMockServer {
fn url(&self) -> Url;
fn path(&self, path: &str) -> Url;
fn status(&self) -> Vec<MatchResult>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
fn metrics(&self) -> MockServerMetrics;
}
Expand description
A mock server that handles the requests described in a Pact
, intended
for use in tests, and validates that the requests made to that server are
correct.
Because this is intended for use in tests, it will panic if something goes wrong.
Required Methods
The base URL of the mock server. You can make normal HTTP requests using this as the base URL (if it is a HTTP-based mock server).
Given a path string, return a URL pointing to that path on the mock
server. If the path
cannot be parsed as URL, this function will
panic. For a non-panicking version, call .url()
instead and build
this path yourself.
Returns the current status of the mock server. Note that with some mock server implementations, the status will only be available once the mock server has shutdown.
fn metrics(&self) -> MockServerMetrics
fn metrics(&self) -> MockServerMetrics
Returns the metrics collected by the mock server