Skip to main content

Module mock_client

Module mock_client 

Source
Expand description

Mock implementation of DurableServiceClient for testing.

This module provides a mock checkpoint client that can be used for unit testing durable functions without requiring AWS infrastructure.

§Examples

use durable_execution_sdk_testing::MockDurableServiceClient;
use durable_execution_sdk::{CheckpointResponse, Operation, OperationType};

// Create a mock client with default responses
let client = MockDurableServiceClient::new();

// Create a mock client with custom checkpoint responses
let client = MockDurableServiceClient::new()
    .with_checkpoint_response(Ok(CheckpointResponse::new("token-1")))
    .with_checkpoint_response(Ok(CheckpointResponse::new("token-2")));

// Create a mock client with multiple default responses
let client = MockDurableServiceClient::new()
    .with_checkpoint_responses(5);

Structs§

CheckpointCall
Record of a checkpoint call made to the mock client.
GetOperationsCall
Record of a get_operations call made to the mock client.
MockDurableServiceClient
Mock implementation of DurableServiceClient for testing.