pub struct AssertionEngine { /* private fields */ }Expand description
Assertion engine
Implementations§
Source§impl AssertionEngine
impl AssertionEngine
Sourcepub fn with_registry(registry: Arc<dyn PluginRegistry>) -> Self
pub fn with_registry(registry: Arc<dyn PluginRegistry>) -> Self
Create a new assertion engine with a custom plugin registry
Sourcepub fn evaluate(
&self,
assertion: &str,
response: &Value,
headers: Option<&HashMap<String, String>>,
trailers: Option<&HashMap<String, String>>,
) -> Result<AssertionResult>
pub fn evaluate( &self, assertion: &str, response: &Value, headers: Option<&HashMap<String, String>>, trailers: Option<&HashMap<String, String>>, ) -> Result<AssertionResult>
Evaluate a single assertion
pub fn evaluate_with_timing( &self, assertion: &str, response: &Value, headers: Option<&HashMap<String, String>>, trailers: Option<&HashMap<String, String>>, timing: Option<&AssertionTiming>, ) -> Result<AssertionResult>
Sourcepub fn query(&self, expr: &str, input: &Value) -> Result<Vec<Value>>
pub fn query(&self, expr: &str, input: &Value) -> Result<Vec<Value>>
Execute a JQ query and return the result(s)
pub fn has_failures(&self, results: &[AssertionResult]) -> bool
pub fn get_failures<'a>( &self, results: &'a [AssertionResult], ) -> Vec<&'a AssertionResult>
pub fn evaluate_all( &self, assertions: &[String], response: &Value, headers: Option<&HashMap<String, String>>, trailers: Option<&HashMap<String, String>>, ) -> Vec<AssertionResult>
pub fn evaluate_all_with_timing( &self, assertions: &[String], response: &Value, headers: Option<&HashMap<String, String>>, trailers: Option<&HashMap<String, String>>, timing: Option<&AssertionTiming>, ) -> Vec<AssertionResult>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AssertionEngine
impl !UnwindSafe for AssertionEngine
impl Freeze for AssertionEngine
impl Send for AssertionEngine
impl Sync for AssertionEngine
impl Unpin for AssertionEngine
impl UnsafeUnpin for AssertionEngine
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
Mutably borrows from an owned value. Read more