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

Issue #3365 - adding response metadata into enhanced response objects #3413

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

petercipov
Copy link

@petercipov petercipov commented Sep 7, 2022

Motivation and Context

Issue #3365

Modifications

  • pass DynamoDbResponseMetadata into ?ItemEnhancedResponse classes

Testing

  • added test classes to cover that metadata object is passed

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@petercipov petercipov changed the title Issue #3365 - adding request metadata into enhanced response objects Issue #3365 - adding response metadata into enhanced response objects Sep 7, 2022
@petercipov petercipov marked this pull request as ready for review September 7, 2022 21:08
@petercipov petercipov requested a review from a team as a code owner September 7, 2022 21:08
Copy link
Contributor

@cenedhryn cenedhryn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for very thorough unit testing!

Please add functional tests too and update BasicCrudTest and AsyncBasicCrudTest. It should be sufficient with updating or adding one test case per test file. I'd recommend updating if there's a decent test case to piggy back, because the test classes are already very long.

return result;
}

@NotThreadSafe
public static final class Builder<T> {
public DynamoDbResponseMetadata responseMetadata;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be private as in DeleteItemEnhancedResponse

Nit: put it as the last instance variable for consistency

return result;
}

@NotThreadSafe
public static final class Builder<T> {
public DynamoDbResponseMetadata responseMetadata;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be private as in DeleteItemEnhancedResponse

Nit: put it as the last instance variable for consistency

DynamoDbResponseMetadata dynamoDbResponseMetadata =
DynamoDbResponseMetadata.create(DefaultAwsResponseMetadata.create(metadataMap));

DeleteItemEnhancedResponse<FakeItem> containsItemCollectionMetrics = DeleteItemEnhancedResponse.builder(FakeItem.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: update name of variable to reference ResponseMetadata

DynamoDbResponseMetadata dynamoDbResponseMetadata =
DynamoDbResponseMetadata.create(DefaultAwsResponseMetadata.create(metadataMap));

PutItemEnhancedResponse<FakeItem> containsItemCollectionMetrics = PutItemEnhancedResponse.builder(FakeItem.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: update name of variable to reference ResponseMetadata

DynamoDbResponseMetadata dynamoDbResponseMetadata =
DynamoDbResponseMetadata.create(DefaultAwsResponseMetadata.create(metadataMap));

UpdateItemEnhancedResponse<FakeItem> containsItemCollectionMetrics = UpdateItemEnhancedResponse.builder(FakeItem.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: update name of variable to reference ResponseMetadata

@petercipov
Copy link
Author

@cenedhryn Thank you for your time on review, I have pushed my changes with requested changes.

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

Successfully merging this pull request may close these issues.

2 participants