Class TestResult<O>

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

public class TestResult<O> extends Object
Represents the result of a durable execution, providing access to the execution status, output, operations, and history events.
  • Method Details

    • getStatus

      public ExecutionStatus getStatus()
      Returns the execution status (SUCCEEDED, FAILED, or PENDING).
    • getResult

      public <T> T getResult(Class<T> resultType)
      Deserializes and returns the execution output, throwing if the execution did not succeed.
    • getResult

      public <T> T getResult(TypeToken<T> resultType)
      Deserializes and returns the execution output using a TypeToken for generic types.
    • getError

      public Optional<software.amazon.awssdk.services.lambda.model.ErrorObject> getError()
      Returns the execution error, if present.
    • getOperations

      public List<TestOperation> getOperations()
      Returns all operations from the execution.
    • getOperation

      public TestOperation getOperation(String name)
      Returns the TestOperation with the given name, or null if not found.
    • getHistoryEvents

      public List<software.amazon.awssdk.services.lambda.model.Event> 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

      public List<TestOperation> getSucceededOperations()
      Returns all operations that completed successfully.
    • getFailedOperations

      public List<TestOperation> getFailedOperations()
      Returns all operations that failed, were cancelled, timed out, or stopped.