Golang How should I write the return value of the S3.SelectObjectContent mock?
0
I'm unit testing the process using S3's SelectObjectContent.
Replace SelectObjectContent with a mock of s3iface.
But I don't know how to create a mock response to get the e.Payload.
Please tell me how to get e.Payload by the SelectObjectContent mock.
process
resp, err := svc.SelectObjectContent(params)
if err != nil {
return err
}
defer resp.EventStream.Close()
for event := range resp.EventStream.Events() {
switch e := event.(type) {
case *s3.RecordsEvent:
fmt.Println(string(e.Payload))
}
}