Skip to content
Unverified Commit 907c0f3f authored by david-perez's avatar david-perez Committed by GitHub
Browse files

Fix server protocol response body assertion (#1141)

In server protocol tests, we were asserting that the returned server
response body matched *exactly* the body field in the protocol tests.
However, Smithy protocol tests are written with readability in mind, and
as such this field contains formatted bodies with abundant spacing and
newlines. For example:

```
Diff < left / right > :
<"{\n    \"stringValue\": \"string\",\n    \"documentValue\": {\n        \"foo\": \"bar\"\n    }\n}"
>b"{\"documentValue\":{\"foo\":\"bar\"},\"stringValue\":\"string\"}"
```

This commit changes the response body assertion to use
`aws_smithy_protocol_test::validate_body`, a helper function that takes
these formatting differences into account using the configured protocol
test `bodyMediaType` field.

This change makes many response protocol tests pass.
parent 11c61f65
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment