-
Notifications
You must be signed in to change notification settings - Fork 917
Expand protocol test coverage for json1.0, query and cbor #6245
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
Conversation
…ling protocol tests - avoid behavior changes in this PR
...core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/HeadersAssertion.java
Show resolved
Hide resolved
...ore/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/JsonBodyAssertion.java
Show resolved
Hide resolved
|
@@ -302,6 +302,11 @@ public String getEnumValueName(String enumValue) { | |||
// Special cases | |||
result = result.replace("textORcsv", "TEXT_OR_CSV"); | |||
|
|||
// leading digits, add a prefix | |||
if (result.matches("^\\d.*")) { | |||
result = "VALUE_" + result; |
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.
I understand the java limitation of not being able to have a number as an enum value, but can you explain how this substitution works in practice?
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.
When the value has leading digits (eg: 0
or 123_some_value
) the regex will match, and then we just prefix it with "VALUE", so we end up with VALUE_0
and VALUE_123_SOME_VALUE
for those cases.
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
This PR does three things (detailed in modifications section below):
Motivation and Context
This is a followup/expansion of #6230.
This change improves our protocol test coverage for the json1.0, query and cbor protocols and ensures that all cases covered by the official Smithy protocol tests are run.
Modifications
SDK Behavior changes:
Protocol Test Runner updates:
1.0
to be equal1
)host
given (allowing configuring custom endpoint)Protocol Test Suite changes/Additions:
FAQ
Why add a new query protocol service instead of replacing the existing one?
The existing query model/service is used in a large number of custom/hand written tests cases (eg: QueryExceptionTests). Adding a new service for the new protocol test suite allows us to leave these existing tests alone.
Testing
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License