-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial implementation of @httpMalformedRequestTests #871
Initial implementation of @httpMalformedRequestTests #871
Conversation
smithy-protocol-test-traits/src/main/resources/META-INF/smithy/smithy.test.smithy
Show resolved
Hide resolved
smithy-protocol-test-traits/src/main/resources/META-INF/smithy/smithy.test.smithy
Outdated
Show resolved
Hide resolved
01958af
to
c2dfdbd
Compare
@httpMalformedRequestTests allow server implementations to generate tests that exercise how the implementation deals with requests that are rejected before they reach the customer's business logic. See smithy-lang/smithy#871 for more information.
smithy-protocol-test-traits/src/main/resources/META-INF/smithy/smithy.test.smithy
Outdated
Show resolved
Hide resolved
headers: {"X-Foo": "baz"}, | ||
body: """ | ||
{ | ||
"message" : "Invalid JSON" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same test as above but checking body v/s bodyMessageRegex? The regex has ": .*" but it doesn't here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can either specify body (exact match) or a regex for the message. this test is simply "can we deserialize all of these fields"
...software/amazon/smithy/protocoltests/traits/errorfiles/all-malformed-request-features.smithy
Outdated
Show resolved
Hide resolved
@httpMalformedRequestTests allow server implementations to generate tests that exercise how the implementation deals with requests that are rejected before they reach the customer's business logic. See smithy-lang/smithy#871 for more information.
988b1e8
to
7f0abec
Compare
smithy-protocol-test-traits/src/main/resources/META-INF/smithy/smithy.test.smithy
Outdated
Show resolved
Hide resolved
smithy-protocol-test-traits/src/main/resources/META-INF/smithy/smithy.test.smithy
Show resolved
Hide resolved
ae17dbe
to
23e58ec
Compare
...ain/java/software/amazon/smithy/protocoltests/traits/HttpMalformedRequestTestsValidator.java
Show resolved
Hide resolved
...a/software/amazon/smithy/protocoltests/traits/ParameterizedHttpMalformedRequestTestCase.java
Outdated
Show resolved
Hide resolved
23e58ec
to
8a45b5d
Compare
Sets up the trait and serialization/deserialization of all of its members. This trait allows server implementations to generate tests that reject invalid requests before those requests are bound to a Smithy-generated implementation class, or before the deserialized request is handed off to application code.
8a45b5d
to
d57756e
Compare
@httpMalformedRequestTests allow server implementations to generate tests that exercise how the implementation deals with requests that are rejected before they reach the customer's business logic. See smithy-lang/smithy#871 for more information.
@httpMalformedRequestTests allow server implementations to generate tests that exercise how the implementation deals with requests that are rejected before they reach the customer's business logic. See smithy-lang/smithy#871 for more information.
Description of changes:
Sets up the trait and serialization/deserialization of all of its members. This
trait allows server implementations to generate tests that reject invalid
requests before those requests are bound to a Smithy-generated implementation
class, or before the deserialized request is handed off to application code.
I'm going to keep this in draft mode for feedback while I work on generating tests from it to make sure this is actually useful.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.