Struct pact_ffi::verifier::handle::VerifierHandle
source · pub struct VerifierHandle { /* private fields */ }
Expand description
Wraps a Pact verifier
Implementations§
source§impl VerifierHandle
impl VerifierHandle
sourcepub fn new() -> VerifierHandle
👎Deprecated since 0.1.4: Use new_for_application instead
pub fn new() -> VerifierHandle
Create a new verifier and return the handle to it (deprecated, use new_for_application)
sourcepub fn new_for_application(
calling_app_name: &str,
calling_app_version: &str
) -> VerifierHandle
pub fn new_for_application( calling_app_name: &str, calling_app_version: &str ) -> VerifierHandle
Create a new verifier and return the handle to it
sourcepub fn provider_info(&self) -> ProviderInfo
pub fn provider_info(&self) -> ProviderInfo
Retrieve the provider info from the handle
sourcepub fn add_transport(
&mut self,
protocol: String,
port: u16,
path: String,
scheme: Option<String>
)
pub fn add_transport( &mut self, protocol: String, port: u16, path: String, scheme: Option<String> )
Add a new transport to the verification process
sourcepub fn update_provider_info(
&mut self,
name: String,
scheme: String,
host: String,
port: u16,
path: String
)
pub fn update_provider_info( &mut self, name: String, scheme: String, host: String, port: u16, path: String )
Update the provider info
sourcepub fn update_filter_info(
&mut self,
filter_description: String,
filter_state: String,
filter_no_state: bool
)
pub fn update_filter_info( &mut self, filter_description: String, filter_state: String, filter_no_state: bool )
Update the filter info
sourcepub fn add_file_source(&mut self, file: &str)
pub fn add_file_source(&mut self, file: &str)
Add a file source to be verified
sourcepub fn add_directory_source(&mut self, dir: &str)
pub fn add_directory_source(&mut self, dir: &str)
Add a directory source to be verified. This will verify all pact files in the directory.
sourcepub fn add_url_source(&mut self, url: &str, auth: &HttpAuth)
pub fn add_url_source(&mut self, url: &str, auth: &HttpAuth)
Add a URL source to be verified. This will fetch the pact file from the URL. If a username and password is given, then basic authentication will be used when fetching the pact file. If a token is provided, then bearer token authentication will be used.
sourcepub fn add_pact_broker_source(
&mut self,
url: &str,
enable_pending: bool,
include_wip_pacts_since: Option<String>,
provider_tags: Vec<String>,
provider_branch: Option<String>,
selectors: Vec<ConsumerVersionSelector>,
auth: &HttpAuth
)
pub fn add_pact_broker_source( &mut self, url: &str, enable_pending: bool, include_wip_pacts_since: Option<String>, provider_tags: Vec<String>, provider_branch: Option<String>, selectors: Vec<ConsumerVersionSelector>, auth: &HttpAuth )
Add a Pact broker source to be verified. This will fetch all the pact files from the broker that match the provider name. If a username and password is given, the basic authentication will be used when fetching the pact file. If a token is provided, then bearer token authentication will be used.
sourcepub fn update_provider_state(
&mut self,
state_change_url: Option<String>,
state_change_teardown: bool,
state_change_body: bool
)
pub fn update_provider_state( &mut self, state_change_url: Option<String>, state_change_teardown: bool, state_change_body: bool )
Update the provider state
sourcepub fn update_verification_options(
&mut self,
disable_ssl_verification: bool,
request_timeout: u64
)
pub fn update_verification_options( &mut self, disable_ssl_verification: bool, request_timeout: u64 )
Update options used when running a verification
§Args
- disable_ssl_verification - Disable SSL verification on all HTTPS requests
- request_timeout - Timeout for all requests to the provider
sourcepub fn set_use_coloured_output(&mut self, coloured_output: bool)
pub fn set_use_coloured_output(&mut self, coloured_output: bool)
Enables or disables use of ANSI escape codes with the verifier output
sourcepub fn set_no_pacts_is_error(&mut self, is_error: bool)
pub fn set_no_pacts_is_error(&mut self, is_error: bool)
Enables or disables erroring if no pacts are found to verify
sourcepub fn update_publish_options(
&mut self,
provider_version: &str,
build_url: Option<String>,
provider_tags: Vec<String>,
provider_branch: Option<String>
)
pub fn update_publish_options( &mut self, provider_version: &str, build_url: Option<String>, provider_tags: Vec<String>, provider_branch: Option<String> )
sourcepub fn update_consumers(&mut self, consumers: Vec<String>)
pub fn update_consumers(&mut self, consumers: Vec<String>)
Update the consumer filter
sourcepub fn execute(&mut self) -> i32
pub fn execute(&mut self) -> i32
Execute the verifier
This will return an integer value based on the status of the verification:
- 0 - verification was successful
- 1 - verification was not successful
- 2 - failed to run the verification
Anu captured output from the verification will be stored against this handle
sourcepub fn output(&self) -> String
pub fn output(&self) -> String
Return the captured standard output from the verification execution
sourcepub fn add_custom_header(&mut self, header_name: &str, header_value: &str)
pub fn add_custom_header(&mut self, header_name: &str, header_value: &str)
Add a custom header to be included in the call to the provider
Trait Implementations§
source§impl Clone for VerifierHandle
impl Clone for VerifierHandle
source§fn clone(&self) -> VerifierHandle
fn clone(&self) -> VerifierHandle
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VerifierHandle
impl Debug for VerifierHandle
Auto Trait Implementations§
impl Freeze for VerifierHandle
impl RefUnwindSafe for VerifierHandle
impl !Send for VerifierHandle
impl !Sync for VerifierHandle
impl Unpin for VerifierHandle
impl !UnwindSafe for VerifierHandle
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request