-
Notifications
You must be signed in to change notification settings - Fork 863
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
Pure refactoring of UpdateItemOperation tests #2910
Pure refactoring of UpdateItemOperation tests #2910
Conversation
PRIMARY_CONTEXT, | ||
null); | ||
UpdateItemRequest.Builder expectedRequestBuilder = ddbRequestBuilder(ddbKey(item.getId(), item.getSort())); | ||
expectedRequestBuilder.expressionAttributeValues(expectedValues); |
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.
Nit: I think it helps readability to chain the builder method calls together, rather than repeatedly reference expectedRequestBuilder
. Same feedback for other locations.
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.
Agreed... I stopped refactoring these types of tests after a while because I'll be adding quite a few similar ones, and I didn't want to end up having to back out of some optimization. I would like to simplify the handling of the updateExpression/expressionNames/expressionMaps/conditionals to a point where it's easy to glance at a test and quickly see the significant bits. Expect to see something in the next PR.
UpdateItemRequest request = updateItemOperation.generateRequest(FakeItemWithSort.getTableSchema(), PRIMARY_CONTEXT, null); | ||
|
||
|
||
String expectedUpdateExpression = "SET " + OTHER_ATTRIBUTE_1_NAME + " = " + OTHER_ATTRIBUTE_1_VALUE + |
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.
Nit: As soon as we exceed a single concatenation operator, I usually find String.format(..)
to be more readable.
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.
Yeah, didn't love this setup either but again, because we're releasing support of the full range of UpdateExpression, there will be a lot of different types of expression strings so it'll be rectified when those are added.
Kudos, SonarCloud Quality Gate passed! |
Revert "Support Non proxy host settings in the ProxyConfiguration for Crt http client. (#4962)"
It's a big class and we'll need to add more tests.