pub struct MockWorkflowDispatch { /* private fields */ }Expand description
Implementations§
Source§impl MockWorkflowDispatch
impl MockWorkflowDispatch
Sourcepub fn new() -> MockWorkflowDispatch
pub fn new() -> MockWorkflowDispatch
Create a new mock workflow dispatcher.
Sourcepub async fn start<T>(
&self,
workflow_name: &str,
input: T,
) -> Result<Uuid, ForgeError>where
T: Serialize,
pub async fn start<T>(
&self,
workflow_name: &str,
input: T,
) -> Result<Uuid, ForgeError>where
T: Serialize,
Start a workflow (records for later verification).
Sourcepub fn started_workflows(&self) -> Vec<StartedWorkflow>
pub fn started_workflows(&self) -> Vec<StartedWorkflow>
Get all started workflows.
Sourcepub fn workflows_named(&self, name: &str) -> Vec<StartedWorkflow>
pub fn workflows_named(&self, name: &str) -> Vec<StartedWorkflow>
Get workflows of a specific name.
Sourcepub fn assert_started(&self, workflow_name: &str)
pub fn assert_started(&self, workflow_name: &str)
Assert that a workflow was started.
Sourcepub fn assert_started_with<F>(&self, workflow_name: &str, predicate: F)
pub fn assert_started_with<F>(&self, workflow_name: &str, predicate: F)
Assert that a workflow was started with matching input.
Sourcepub fn assert_not_started(&self, workflow_name: &str)
pub fn assert_not_started(&self, workflow_name: &str)
Assert that a workflow was not started.
Sourcepub fn assert_start_count(&self, workflow_name: &str, expected: usize)
pub fn assert_start_count(&self, workflow_name: &str, expected: usize)
Assert that a specific number of workflows were started.
Sourcepub fn complete_workflow(&self, run_id: Uuid)
pub fn complete_workflow(&self, run_id: Uuid)
Mark a workflow as completed (for test simulation).
Sourcepub fn fail_workflow(&self, run_id: Uuid)
pub fn fail_workflow(&self, run_id: Uuid)
Mark a workflow as failed (for test simulation).
Trait Implementations§
Source§impl Default for MockWorkflowDispatch
impl Default for MockWorkflowDispatch
Source§fn default() -> MockWorkflowDispatch
fn default() -> MockWorkflowDispatch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MockWorkflowDispatch
impl RefUnwindSafe for MockWorkflowDispatch
impl Send for MockWorkflowDispatch
impl Sync for MockWorkflowDispatch
impl Unpin for MockWorkflowDispatch
impl UnwindSafe for MockWorkflowDispatch
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more