Class EventStreamTestsTraitValidator

java.lang.Object
software.amazon.smithy.model.validation.AbstractValidator
software.amazon.smithy.protocoltests.traits.eventstream.EventStreamTestsTraitValidator
All Implemented Interfaces:
Validator

public final class EventStreamTestsTraitValidator extends AbstractValidator
Validates event stream test cases. It performs the following validations for each test case:
  • Validates that the initial request params match the modeled initial request.
  • Validates that the initial request matches the initial request shape if set.
  • Validates that the initial response params match the modeled initial response.
  • Validates that the initial response matches the initial response shape if set.
  • Validates that the vendor params match the vendor params shape if set.
  • Validates that there is at least one event or initial message defined.
  • Validates that the ID is unique.
For each event in the test case, the following validations are performed:
  • If the event is a REQUEST event and it has params, validates that the operation has an input stream.
  • If the event is a RESPONSE event and it has params, validates that the operation has an output stream.
  • If the event has params, validates that it matches an event in the event stream.
  • If the body media type is set to XML or JSON, validate that the body parseable.
  • \
  • Validates that the vendor params match the vendor params shape if set.
  • Constructor Details

    • EventStreamTestsTraitValidator

      public EventStreamTestsTraitValidator()
  • Method Details

    • validate

      public List<ValidationEvent> validate(Model model)
      Description copied from interface: Validator
      Validates a model and returns a list of validation events.
      Parameters:
      model - Model to validate.
      Returns:
      List of validation events.