### Question:
SqsQueueResource { public void sendMessage(final String messageBody) throws AmazonClientException { final SendMessageRequest sendMessageRequest = new SendMessageRequest(queueUrl, messageBody); doSendRequest(sendMessageRequest); } SqsQueueResource(final String queueName, final String queueUrl, final AmazonSQS amazonSqsClient); void sendMessage(final String messageBody); void sendDelayedMessage(final String messageBody, final int delaySeconds); List<Message> receiveMessages(); List<Message> receiveMessages(final int waitTimeSeconds, final int maxMessages); void deleteMessage(final String receiptHandle); void setPolicy(final Policy policy); String queueArn(); String getQueueName();  }### Answer:
@Test public void shouldSendMessage_withMessageBody() { final String messageBody = randomString(); sqsQueueResource.sendMessage(messageBody); final ArgumentCaptor<SendMessageRequest> captor = ArgumentCaptor.forClass(SendMessageRequest.class); verify(amazonSqsClient).sendMessage(captor.capture()); final SendMessageRequest sendMessageRequest = captor.getValue(); assertEquals(queueUrl, sendMessageRequest.getQueueUrl()); assertEquals(messageBody, sendMessageRequest.getMessageBody()); assertNull(sendMessageRequest.getDelaySeconds()); }
@Test public void shouldThrowException_onExceptionForSendMessage() { final String messageBody = randomString(); doThrow(AmazonClientException.class).when(amazonSqsClient).sendMessage(any(SendMessageRequest.class)); AmazonClientException thrownException = null; try { sqsQueueResource.sendMessage(messageBody); } catch (final AmazonClientException e) { thrownException = e; } assertNotNull(thrownException); }