Class LocalMemoryExecutionClient

java.lang.Object
software.amazon.lambda.durable.testing.LocalMemoryExecutionClient
All Implemented Interfaces:
DurableExecutionClient

public class LocalMemoryExecutionClient extends Object implements DurableExecutionClient
  • Constructor Details

    • LocalMemoryExecutionClient

      public LocalMemoryExecutionClient()
  • Method Details

    • checkpoint

      public software.amazon.awssdk.services.lambda.model.CheckpointDurableExecutionResponse checkpoint(String arn, String token, List<software.amazon.awssdk.services.lambda.model.OperationUpdate> updates)
      Specified by:
      checkpoint in interface DurableExecutionClient
    • getExecutionState

      public software.amazon.awssdk.services.lambda.model.GetDurableExecutionStateResponse getExecutionState(String arn, String checkpointToken, String marker)
      Specified by:
      getExecutionState in interface DurableExecutionClient
    • getOperationUpdates

      public List<software.amazon.awssdk.services.lambda.model.OperationUpdate> getOperationUpdates()
      Get all operation updates that have been sent to this client. Useful for testing and verification.
    • getAllEvents

      public List<software.amazon.awssdk.services.lambda.model.Event> getAllEvents()
      Get all events in order.
    • getEventsForOperation

      public List<software.amazon.awssdk.services.lambda.model.Event> getEventsForOperation(String operationId)
      Get events for a specific operation.
    • advanceReadyOperations

      public boolean advanceReadyOperations()
      Advance all operations (simulates time passing for retries/waits).
      Returns:
      true if any operations were advanced, false otherwise
    • completeChainedInvoke

      public void completeChainedInvoke(String name, OperationResult result)
    • getOperationByName

      public software.amazon.awssdk.services.lambda.model.Operation getOperationByName(String name)
    • getAllOperations

      public List<software.amazon.awssdk.services.lambda.model.Operation> getAllOperations()
    • reset

      public void reset()
    • toTestResult

      public <O> TestResult<O> toTestResult(DurableExecutionOutput output)
      Build TestResult from current state.
    • resetCheckpointToStarted

      public void resetCheckpointToStarted(String stepName)
      Simulate checkpoint failure by forcing an operation into STARTED state
    • simulateFireAndForgetCheckpointLoss

      public void simulateFireAndForgetCheckpointLoss(String stepName)
      Simulate fire-and-forget checkpoint loss by removing the operation entirely
    • getCallbackId

      public String getCallbackId(String operationName)
      Get callback ID for a named callback operation.
    • completeCallback

      public void completeCallback(String callbackId, String result)
      Simulate external system completing callback successfully.
    • failCallback

      public void failCallback(String callbackId, software.amazon.awssdk.services.lambda.model.ErrorObject error)
      Simulate external system failing callback.
    • timeoutCallback

      public void timeoutCallback(String callbackId)
      Simulate callback timeout.