@@ -212,6 +212,33 @@ func TestSendMessageBatchChecksum(t *testing.T) {
212
212
}
213
213
}
214
214
215
+ func TestSendMessageBatchChecksumFailed (t * testing.T ) {
216
+ req := svc .SendMessageBatchRequest (& sqs.SendMessageBatchInput {
217
+ Entries : []sqs.SendMessageBatchRequestEntry {
218
+ {Id : aws .String ("1" ), MessageBody : aws .String ("test" )},
219
+ {Id : aws .String ("2" ), MessageBody : aws .String ("test" )},
220
+ {Id : aws .String ("3" ), MessageBody : aws .String ("test" )},
221
+ {Id : aws .String ("4" ), MessageBody : aws .String ("test" )},
222
+ },
223
+ })
224
+ req .Handlers .Send .PushBack (func (r * request.Request ) {
225
+ body := ioutil .NopCloser (bytes .NewReader ([]byte ("" )))
226
+ r .HTTPResponse = & http.Response {StatusCode : 200 , Body : body }
227
+ r .Data = & sqs.SendMessageBatchOutput {
228
+ Failed : []sqs.BatchResultErrorEntry {
229
+ {Id : aws .String ("1" ), Code : aws .String ("test" ), Message : aws .String ("test" ), SenderFault : aws .Bool (false )},
230
+ {Id : aws .String ("2" ), Code : aws .String ("test" ), Message : aws .String ("test" ), SenderFault : aws .Bool (false )},
231
+ {Id : aws .String ("3" ), Code : aws .String ("test" ), Message : aws .String ("test" ), SenderFault : aws .Bool (false )},
232
+ {Id : aws .String ("4" ), Code : aws .String ("test" ), Message : aws .String ("test" ), SenderFault : aws .Bool (false )},
233
+ },
234
+ }
235
+ })
236
+ _ , err := req .Send ()
237
+ if err != nil {
238
+ t .Errorf ("expect no error, got %v" , err )
239
+ }
240
+ }
241
+
215
242
func TestSendMessageBatchChecksumInvalid (t * testing.T ) {
216
243
req := svc .SendMessageBatchRequest (& sqs.SendMessageBatchInput {
217
244
Entries : []sqs.SendMessageBatchRequestEntry {
0 commit comments