Class FailureExpectation

  • All Implemented Interfaces:
    ToNode

    public final class FailureExpectation
    extends java.lang.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 Detail

      • 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 java.util.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.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object