Class TestResult<O>
java.lang.Object
software.amazon.lambda.durable.testing.TestResult<O>
- Type Parameters:
O- the handler output type
Represents the result of a durable execution, providing access to the execution status, output, operations, and
history events.
-
Constructor Summary
ConstructorsConstructorDescriptionTestResult(ExecutionStatus status, String resultPayload, software.amazon.awssdk.services.lambda.model.ErrorObject error, List<TestOperation> operations, List<software.amazon.awssdk.services.lambda.model.Event> allEvents, TypeToken<O> resultType, SerDes serDes) -
Method Summary
Modifier and TypeMethodDescriptionOptional<software.amazon.awssdk.services.lambda.model.ErrorObject>getError()Returns the execution error, if present.List<software.amazon.awssdk.services.lambda.model.Event>getEventsForOperation(String operationName) Returns the raw history events for the given operation name, or an empty list if not found.Returns all operations that failed, were cancelled, timed out, or stopped.List<software.amazon.awssdk.services.lambda.model.Event>Returns all raw history events from the execution.getOperation(String name) Returns theTestOperationwith the given name, or null if not found.Returns all operations from the execution.Deserializes and returns the execution output if the result type is known.<T> TDeserializes and returns the execution output, throwing if the execution did not succeed.<T> TDeserializes and returns the execution output using a TypeToken for generic types.Returns the execution status (SUCCEEDED, FAILED, or PENDING).Returns all operations that completed successfully.booleanisFailed()Returns true if the execution failed.booleanReturns true if the execution completed successfully.
-
Constructor Details
-
TestResult
public TestResult(ExecutionStatus status, String resultPayload, software.amazon.awssdk.services.lambda.model.ErrorObject error, List<TestOperation> operations, List<software.amazon.awssdk.services.lambda.model.Event> allEvents, TypeToken<O> resultType, SerDes serDes)
-
-
Method Details
-
getStatus
Returns the execution status (SUCCEEDED, FAILED, or PENDING). -
getResult
Deserializes and returns the execution output, throwing if the execution did not succeed. -
getResult
Deserializes and returns the execution output using a TypeToken for generic types. -
getResult
Deserializes and returns the execution output if the result type is known. -
getError
Returns the execution error, if present. -
getOperations
Returns all operations from the execution. -
getOperation
Returns theTestOperationwith the given name, or null if not found. -
getHistoryEvents
Returns all raw history events from the execution. -
getEventsForOperation
public List<software.amazon.awssdk.services.lambda.model.Event> getEventsForOperation(String operationName) Returns the raw history events for the given operation name, or an empty list if not found. -
isSucceeded
public boolean isSucceeded()Returns true if the execution completed successfully. -
isFailed
public boolean isFailed()Returns true if the execution failed. -
getSucceededOperations
Returns all operations that completed successfully. -
getFailedOperations
Returns all operations that failed, were cancelled, timed out, or stopped.
-