Class CloudDurableTestRunner<I,O>

java.lang.Object
software.amazon.lambda.durable.testing.CloudDurableTestRunner<I,O>
Type Parameters:
I - the handler input type
O - the handler output type

public class CloudDurableTestRunner<I,O> extends Object
Test runner for durable Lambda functions deployed to AWS. Invokes a real Lambda function, polls execution history, and returns structured test results.
  • Method Details

    • create

      public static <I, O> CloudDurableTestRunner<I,O> create(String functionArn, Class<I> inputType, Class<O> outputType)
      Creates a runner for the given function ARN with Class-based input/output types.
    • create

      public static <I, O> CloudDurableTestRunner<I,O> create(String functionArn, TypeToken<I> inputType, TypeToken<O> outputType)
      Creates a runner for the given function ARN with TypeToken-based input/output types.
    • create

      public static <I, O> CloudDurableTestRunner<I,O> create(String functionArn, Class<I> inputType, Class<O> outputType, software.amazon.awssdk.services.lambda.LambdaClient lambdaClient)
      Creates a runner with a custom LambdaClient and Class-based input/output types.
    • create

      public static <I, O> CloudDurableTestRunner<I,O> create(String functionArn, TypeToken<I> inputType, TypeToken<O> outputType, software.amazon.awssdk.services.lambda.LambdaClient lambdaClient)
      Creates a runner with a custom LambdaClient and TypeToken-based input/output types.
    • withPollInterval

      public CloudDurableTestRunner<I,O> withPollInterval(Duration interval)
      Returns a new runner with the specified poll interval between history checks.
    • withTimeout

      public CloudDurableTestRunner<I,O> withTimeout(Duration timeout)
      Returns a new runner with the specified maximum wait time for execution completion.
    • withInvocationType

      public CloudDurableTestRunner<I,O> withInvocationType(software.amazon.awssdk.services.lambda.model.InvocationType type)
      Returns a new runner with the specified Lambda invocation type.
    • run

      public TestResult<O> run(I input)
      Invokes the Lambda function, polls execution history until completion, and returns the result.
    • startAsync

      public AsyncExecution<O> startAsync(I input)
      Start an asynchronous execution and return a handle for incremental polling. Use this for callback-based tests where you need to interact with the execution while it's running.
      Parameters:
      input - the input to the function
      Returns:
      execution handle for polling and inspection
    • getOperation

      public TestOperation getOperation(String name)
      Returns the TestOperation for the given name from the last execution result.