deleteMsgList.add(new DeleteMessageBatchRequestEntry("msg" + i, message.getReceiptHandle()));
i++;
}
try {
DeleteMessageBatchRequest batchDeleteRequest = new DeleteMessageBatchRequest(queueUrl, deleteMsgList);
cqs1.deleteMessageBatch(batchDeleteRequest);
} catch (AmazonServiceException ase) {
fail("exception where none expected");
}
logger.info("Delete a batch of messages with empty receipt handle");
try {
deleteMsgList.get(0).setId("somerandomid");
deleteMsgList.get(deleteMsgList.size() - 1).setId("some-random-id");
deleteMsgList.get(0).setReceiptHandle("somerandomestring");
DeleteMessageBatchRequest batchDeleteRequest = new DeleteMessageBatchRequest(queueUrl, deleteMsgList);
cqs1.deleteMessageBatch(batchDeleteRequest);
fail("missing expected exception");
} catch (AmazonServiceException ase) {
assertTrue("Did not get internal error exception", ase.getErrorCode().equals(CQSErrorCodes.InternalError.getCMBCode()));
}