This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
s3manageriface.UploadWithIterator conflicting use cases #5034
Labels
documentation
This is a problem with documentation.
needs-triage
This issue or PR still needs to be triaged.
Describe the issue
Original issue: #1810
I cant see how the linked unit test in this post references s3manageriface.UploadWithIterator (i get that things might have moved on but it seems to have removed it all together), it just seems to setup a http server as the session url and then just uses the normal Uploader type as a client but with an overiden server.url. I usually mock the API iface service (for example SSMAPI) and normally do the same when mocking the S3 upload for example to make sure that the unit test catches the call but in this case i cant due to the UploadWithIterator missing from the UploaderAPI.
As the UploadWithIterator is a function on Uploader type (https://pkg.go.dev/github.com/aws/aws-sdk-go/service/s3/s3manager#Uploader.UploadWithIterator), how am i supposed to mock that function with an interface (https://pkg.go.dev/github.com/aws/[email protected]/service/s3/s3manager/s3manageriface#UploadWithIterator) and intercept the calls? This might be my basic knowledge of Go but this doesnt seem to function like all the other AWSSDK iface services i have used.
If i was to do this without unit tests (:/) i would just use the Uploader type then use its UploadWithIterator. My normal route to writing unit tests would then be to convert the Uploader to UploaderAPI so i could mock the upload\batch function (guessing here as not been able to do it) and then just continue to unit test UploadWithIterator on that but i cant.
TL;DR;
Is there a minimal unit test i can reference for it with corresponding main code?
Links
https://pkg.go.dev/github.com/aws/aws-sdk-go/service/s3/s3manager#Uploader.UploadWithIterator
The text was updated successfully, but these errors were encountered: