}
logger.info("Change a batch of message visibility timeout with same supplied id");
try {
ChangeMessageVisibilityBatchRequest batchRequest = new ChangeMessageVisibilityBatchRequest(queueUrl, msgList);
cqs1.changeMessageVisibilityBatch(batchRequest);
fail("missing expected exception");
} catch (AmazonServiceException ase) {
//assertTrue("Did not get distinct id excpetion", ase.getErrorCode().contains(CQSErrorCodes.BatchEntryIdsNotDistinct.getCMBCode()));
}
logger.info("Change a batch of messages with empty or invalid supplied id");
try {
msgList.get(0).setId("bad.id");
ChangeMessageVisibilityBatchRequest batchRequest = new ChangeMessageVisibilityBatchRequest(queueUrl, msgList);
cqs1.changeMessageVisibilityBatch(batchRequest);
fail("missing expected exception");
} catch (AmazonServiceException ase) {
assertTrue("Did not get invalid batch entry id exception", ase.getErrorCode().contains(CQSErrorCodes.InvalidBatchEntryId.getCMBCode()));
}
logger.info("Change a batch of messages with empty ReceiptHandle:");
try {
msgList.get(0).setId("somerandomid");
msgList.get(msgList.size() - 1).setId("some-random-id");
msgList.get(0).setReceiptHandle("somerandomestring");
ChangeMessageVisibilityBatchRequest batchRequest = new ChangeMessageVisibilityBatchRequest(queueUrl, msgList);
cqs1.changeMessageVisibilityBatch(batchRequest);
fail("missing expected exception");
} catch (AmazonServiceException ase) {
assertTrue("Did not get internal error exception", ase.getErrorCode().contains(CQSErrorCodes.BatchEntryIdsNotDistinct.getCMBCode()));
}