pub struct CamelTestContextBuilder<S = NoTimeControl> { /* private fields */ }Expand description
Builder for CamelTestContext.
Use CamelTestContext::builder() to obtain one.
Implementations§
Source§impl CamelTestContextBuilder<NoTimeControl>
impl CamelTestContextBuilder<NoTimeControl>
Sourcepub fn with_time_control(self) -> CamelTestContextBuilder<WithTimeControl>
pub fn with_time_control(self) -> CamelTestContextBuilder<WithTimeControl>
Activate tokio mock-time. build() will call tokio::time::pause()
and return a TimeController alongside the harness.
Sourcepub async fn build(self) -> CamelTestContext
pub async fn build(self) -> CamelTestContext
Build the harness without time control.
Source§impl CamelTestContextBuilder<WithTimeControl>
impl CamelTestContextBuilder<WithTimeControl>
Sourcepub async fn build(self) -> (CamelTestContext, TimeController)
pub async fn build(self) -> (CamelTestContext, TimeController)
Build the harness with time control.
Calls tokio::time::pause() before returning. Use the returned
TimeController to advance the clock inside the test.
Source§impl CamelTestContextBuilder<NoTimeControl>
impl CamelTestContextBuilder<NoTimeControl>
Sourcepub fn with_mock(self) -> Self
pub fn with_mock(self) -> Self
Include MockComponent explicitly (always registered; this is a
documentation signal for call sites).
Sourcepub fn with_timer(self) -> Self
pub fn with_timer(self) -> Self
Register TimerComponent.
Sourcepub fn with_direct(self) -> Self
pub fn with_direct(self) -> Self
Register DirectComponent.
Sourcepub fn with_component<C>(self, component: C) -> Selfwhere
C: Component + 'static,
pub fn with_component<C>(self, component: C) -> Selfwhere
C: Component + 'static,
Register any component that implements the Component trait.
Source§impl CamelTestContextBuilder<WithTimeControl>
impl CamelTestContextBuilder<WithTimeControl>
Sourcepub fn with_mock(self) -> Self
pub fn with_mock(self) -> Self
Include MockComponent explicitly (always registered; this is a
documentation signal for call sites).
Sourcepub fn with_timer(self) -> Self
pub fn with_timer(self) -> Self
Register TimerComponent.
Sourcepub fn with_direct(self) -> Self
pub fn with_direct(self) -> Self
Register DirectComponent.
Sourcepub fn with_component<C>(self, component: C) -> Selfwhere
C: Component + 'static,
pub fn with_component<C>(self, component: C) -> Selfwhere
C: Component + 'static,
Register any component that implements the Component trait.