Skip to content
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

Can't Stub attribute values with Aws::DynamoDB::Client. #770

Closed
trevorrowe opened this issue Apr 7, 2015 · 3 comments
Closed

Can't Stub attribute values with Aws::DynamoDB::Client. #770

trevorrowe opened this issue Apr 7, 2015 · 3 comments

Comments

@trevorrowe
Copy link
Member

See original issue for more information: amazon-archives/aws-sdk-core-ruby#218

@trevorrowe
Copy link
Member Author

I spent some time working on this. I started by working on a patch that would convert the simplified attribute value formats back into the serialized format with types. This would ensure the response stubbing plugin would succeed at validating the data. Followed by that I had to then also reverse the data format because the normal response handlers were not firing. This was a code-smell to me.

The response stubbing plugin correctly exercises all of the request handlers that build the request. Once it reaches the send handler it simply sets the response data and then returns. This prevents any of response handlers from being exercised.

There was a related issue in the previous repo (amazon-archives/aws-sdk-core-ruby#197) where the response stub skipped over the response handlers, preventing stubs that sets a response target from sending data to the target IO object. This specific limitation was addressed then. I can certainly address this new bug with not supporting attribute values but then I feel like there will be something else in the future.

I think the correct way to resolve this issue is to re-work the response stubbing to take the stub data and to marshal it down to an actual HTTP response with headers, status code and a body. By doing this all of the response handlers will fire as normally ensuring that all of the service customizations work as intended.

I'm jotting down these notes here. I'm not sure I have time to do the feature work required right now and I want a log of what I discovered.

@acoulton
Copy link

@trevorrowe thanks very much for fixing this.

@trevorrowe
Copy link
Member Author

No problem! Thanks for being patient. The new response stubbing implementation should be much more reliable. Let me know if anything does not work as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants