}
logger.info("Receive messages with invalid max number of messages");
try {
ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);
receiveMessageRequest.setVisibilityTimeout(10);
receiveMessageRequest.setMaxNumberOfMessages(12);
cqs1.receiveMessage(receiveMessageRequest).getMessages();
fail("missing expected exception");
} catch (AmazonServiceException ase) {
assertTrue("Did not get an invalid value exception", ase.getErrorCode().contains(CQSErrorCodes.InvalidParameterValue.getCMBCode()));
}
logger.info("Receive messages with invalid max number of messages");
try {
ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);
receiveMessageRequest.setVisibilityTimeout(10);
receiveMessageRequest.setMaxNumberOfMessages(0);
cqs1.receiveMessage(receiveMessageRequest).getMessages();
fail("missing expected exception");
} catch (AmazonServiceException ase) {
assertTrue("Did not get an invalid value exception", ase.getErrorCode().contains(CQSErrorCodes.InvalidParameterValue.getCMBCode()));
}