Class CloudDurableTestRunner<I,O>
java.lang.Object
software.amazon.lambda.durable.testing.CloudDurableTestRunner<I,O>
- Type Parameters:
I- the handler input typeO- the handler output type
Test runner for durable Lambda functions deployed to AWS. Invokes a real Lambda function, polls execution history,
and returns structured test results.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <I,O> CloudDurableTestRunner<I, O> Creates a runner for the given function ARN with Class-based input/output types.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 customLambdaClientand Class-based input/output types.static <I,O> CloudDurableTestRunner<I, O> Creates a runner for the given function ARN with TypeToken-based input/output types.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 customLambdaClientand TypeToken-based input/output types.getOperation(String name) Returns theTestOperationfor the given name from the last execution result.Invokes the Lambda function, polls execution history until completion, and returns the result.startAsync(I input) Start an asynchronous execution and return a handle for incremental polling.withInvocationType(software.amazon.awssdk.services.lambda.model.InvocationType type) Returns a new runner with the specified Lambda invocation type.withPollInterval(Duration interval) Returns a new runner with the specified poll interval between history checks.withTimeout(Duration timeout) Returns a new runner with the specified maximum wait time for execution completion.
-
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 customLambdaClientand 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 customLambdaClientand TypeToken-based input/output types. -
withPollInterval
Returns a new runner with the specified poll interval between history checks. -
withTimeout
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
Invokes the Lambda function, polls execution history until completion, and returns the result. -
startAsync
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
Returns theTestOperationfor the given name from the last execution result.
-