### Question:
SqsQueueResource { public void deleteMessage(final String receiptHandle) throws AmazonClientException { final DeleteMessageRequest deleteMessageRequest = new DeleteMessageRequest(queueUrl, receiptHandle); amazonSqsClient.deleteMessage(deleteMessageRequest); } 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 shouldDeleteMessage_withReceiptHandle() { final String receiptHandle = randomString(); sqsQueueResource.deleteMessage(receiptHandle); final ArgumentCaptor<DeleteMessageRequest> captor = ArgumentCaptor.forClass(DeleteMessageRequest.class); verify(amazonSqsClient).deleteMessage(captor.capture()); final DeleteMessageRequest deleteMessageRequest = captor.getValue(); assertEquals(queueUrl, deleteMessageRequest.getQueueUrl()); assertEquals(receiptHandle, deleteMessageRequest.getReceiptHandle()); }
@Test public void shouldThrowException_onExceptionForDeleteMessage() { doThrow(AmazonClientException.class).when(amazonSqsClient).deleteMessage(any(DeleteMessageRequest.class)); final String receiptHandle = randomString(); AmazonClientException thrownException = null; try { sqsQueueResource.deleteMessage(receiptHandle); } catch (final AmazonClientException e) { thrownException = e; } assertNotNull(thrownException); }