Class FailureExpectation

java.lang.Object
software.amazon.smithy.smoketests.traits.FailureExpectation
All Implemented Interfaces:
ToNode

public final class FailureExpectation extends Object implements ToNode
Defines the expected failure of a service call for a smoke test case.

This can be any error response, or a specific error response.

  • Method Details

    • anyError

      public static FailureExpectation anyError()
      Returns:
      Creates a failure expectation that the service call will result in any error response.
    • errorWithId

      public static FailureExpectation errorWithId(ShapeId errorId)
      Parameters:
      errorId - Shape ID of the expected error.
      Returns:
      Creates a failure expectation that the service call will result in an error matching the given shape ID.
    • getErrorId

      public Optional<ShapeId> getErrorId()
      Gets the ID of the expected error shape.

      If present, it indicates the call should throw a matching error. Otherwise, the call should throw any error.

      Returns:
      The ID of the expected error shape.
    • toNode

      public Node toNode()
      Description copied from interface: ToNode
      Converts a value to a Node.
      Specified by:
      toNode in interface ToNode
      Returns:
      Returns the creates Node.
    • fromNode

      public static FailureExpectation fromNode(Node node)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object