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

Update Test for createObject Function #112

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

khadijahazward
Copy link
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Related Pull Requests (remove if not relevant)

  • Pull request 1
  • Pull request 2

One line release note:

  • One line describing the feature/improvement/fix made by this PR

Type of change

Please delete options that are not relevant.

  • 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 not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Ballerina Version:
  • Operating System:
  • Java SDK:

Checklist:

Security checks

};

Client amazonS3Client = check new(amazonS3Config);
_ = check amazonS3Client->createObject(testBucketName, fileName, content, userMetadataHeaders = metadata);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we test if the metadata was correctly added by getting the object and checking the metadata?

Copy link
Contributor Author

@khadijahazward khadijahazward Jul 26, 2024

Choose a reason for hiding this comment

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

The getObject function does not retrieve user-defined metadata. I only updated the createObject function to add user-defined metadata. Is there any other way to test it without using the getObject function?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do something similar to what we did for the doc-ui GET endpoint? Calling the s3 url with range=0 and check the headers of the response?

http:Response|error response = httpClient->get("objectUrl", {"Range": "bytes=0-0"});

Copy link
Contributor

Choose a reason for hiding this comment

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

This improvement will be tracked in ballerina-platform/ballerina-library#6989

@tharindu-nw tharindu-nw merged commit 36e52f3 into ballerina-platform:master Sep 12, 2024
2 checks passed
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