Class EventStreamTestCase

java.lang.Object
software.amazon.smithy.protocoltests.traits.eventstream.EventStreamTestCase
All Implemented Interfaces:
ToSmithyBuilder<EventStreamTestCase>

public final class EventStreamTestCase extends Object implements ToSmithyBuilder<EventStreamTestCase>
A single event stream test case.
  • Method Details

    • getId

      public String getId()
      Get the test case identifier.

      This identifier can be used by protocol test implementations to filter out unsupported test cases by ID, to generate test case names, etc. No two test cases can share the same ID.

      Returns:
      Returns the test case identifier.
    • getProtocol

      public ShapeId getProtocol()
      Returns:
      Returns the protocol the test case applies to.
    • getInitialRequestParams

      public Optional<ObjectNode> getInitialRequestParams()
      Returns:
      Returns the initial request's parameters as an ObjectNode.
    • getInitialRequest

      public Optional<ObjectNode> getInitialRequest()
      Returns:
      Returns the initial request as an ObjectNode.
    • getInitialRequestShape

      public Optional<ShapeId> getInitialRequestShape()
      Returns:
      Returns a shape describing the structure of the initial request.
    • getInitialResponseParams

      public Optional<ObjectNode> getInitialResponseParams()
      Returns:
      Returns the initial response's parameters as an ObjectNode.
    • getInitialResponse

      public Optional<ObjectNode> getInitialResponse()
      Returns:
      Returns the initial response as an ObjectNode.
    • getInitialResponseShape

      public Optional<ShapeId> getInitialResponseShape()
      Returns:
      Returns a shape describing the structure of the initial response.
    • getEvents

      public List<Event> getEvents()
      Gets the list of events under test.

      Each event must be sent in the order presented. Implementations MAY send events concurrently.

      Returns:
      Returns the list of events under test.
    • getExpectation

      public TestExpectation getExpectation()
      Returns:
      Returns the expected result of the test case.
    • getVendorParams

      public Optional<ObjectNode> getVendorParams()
      Gets any additional vendor-specific parameters.

      This could include credentials, endpoint configuration, or anything else that may impact the protocol's serialization of events.

      Returns:
      Returns vendor-specific parameters as an ObjectNode.
    • getVendorParamsShape

      public Optional<ShapeId> getVendorParamsShape()
      Returns:
      Returns a shape describing the structure of the vendor params.
    • getDocumentation

      public Optional<String> getDocumentation()
      Returns:
      Returns documentation to write out at the beginning of the test case.
    • getAppliesTo

      public Optional<AppliesTo> getAppliesTo()
      Returns:
      Returns what sort of implementation the test case applies to.
    • toBuilder

      public EventStreamTestCase.Builder toBuilder()
      Description copied from interface: ToSmithyBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToSmithyBuilder<EventStreamTestCase>
      Returns:
      Returns the test case as a builder
    • builder

      public static EventStreamTestCase.Builder builder()
      Creates a builder for an EventStreamTestCase.
      Returns:
      Returns a newly-created builder.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object