Skip to content

Add unit tests for existing S3PostUploadSignedPolicy class and fix exception message #3897

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

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

GarrettBeatty
Copy link
Contributor

@GarrettBeatty GarrettBeatty commented Jun 30, 2025

Description

  1. Add unit tests to existing S3PostUploadSignedPolicy class
  2. Fix exception message format parsing. The string.Format was missing the parameter for {0} in the function call. The unit tests caught this issue.

Motivation and Context

For implementing #1901 we are moving the S3PostUploadSignedPolicy class out of the _bcl folder so that other frameworks (net standard/core 3.1, and the existing netframework) can utilize it. In order to ensure that we do not break anything during this move, i am adding unit tests which validate the current functionality. This way once we make changes in the future we can easily determine if we break things.

Please note that we only run unit tests in netframework but this should at least catch potential future issues for netframework. For other frameworks we can copy/run these unit tests in a console app when testing.

Testing

  1. Ran unit tests locally
  2. Dry run 6b777a12-a351-46a6-9b45-89f4f98ad46a pass

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

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

@GarrettBeatty GarrettBeatty changed the title Gcbeatty/presignedpostpolicyunit Add unit tests for existing S3PostUploadSignedPolicy class and fix exception message Jun 30, 2025
@GarrettBeatty GarrettBeatty marked this pull request as ready for review June 30, 2025 19:16
{
Policy = "testPolicy123",
Signature = "abc123signature",
AccessKeyId = "AKIAIOSFODNN7EXAMPLE",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GarrettBeatty GarrettBeatty requested a review from peterrsongg July 4, 2025 00:16
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