Class Expectation

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

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

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

  • Method Details

    • success

      public static Expectation success()
      Returns:
      Creates an expectation that the service call for a smoke test case is successful.
    • failure

      public static Expectation failure(FailureExpectation failure)
      Parameters:
      failure - The failure to expect.
      Returns:
      Creates an expectation that the service call for a smoke test case will result in the given failure.
    • fromNode

      public static Expectation fromNode(Node node)
      Creates a Expectation from a Node.
      Parameters:
      node - Node to deserialize into a Expectation.
      Returns:
      Returns the created Expectation.
    • isSuccess

      public boolean isSuccess()
      Returns:
      Whether the service call is expected to succeed.
    • isFailure

      public boolean isFailure()
      Returns:
      Whether the service call is expected to fail.
    • getFailure

      public Optional<FailureExpectation> getFailure()
      Returns:
      The expected failure, if this expectation is a failure expectation.
    • 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.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object