### Question:
SqsQueueResource { public String queueArn() throws AmazonClientException { if (queueArn == null) { final GetQueueAttributesRequest request = new GetQueueAttributesRequest(queueUrl) .withAttributeNames(SQS_QUEUE_ARN_ATTRIBUTE); final GetQueueAttributesResult getQueueAttributesResult = amazonSqsClient.getQueueAttributes(request); queueArn = getQueueAttributesResult.getAttributes().get(SQS_QUEUE_ARN_ATTRIBUTE); } return queueArn; } 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 shouldReturnQueueArn() { final String queueArn = randomString(); final Map<String, String> attributes = Collections.singletonMap(QueueAttributeName.QueueArn.toString(), queueArn); final GetQueueAttributesResult mockGetQueueAttributesResult = mock(GetQueueAttributesResult.class); when(mockGetQueueAttributesResult.getAttributes()).thenReturn(attributes); final ArgumentCaptor<GetQueueAttributesRequest> captor = ArgumentCaptor .forClass(GetQueueAttributesRequest.class); when(amazonSqsClient.getQueueAttributes(captor.capture())).thenReturn(mockGetQueueAttributesResult); final String returnedQueueArn = sqsQueueResource.queueArn(); final GetQueueAttributesRequest getQueueAttributesRequest = captor.getValue(); assertEquals(queueUrl, getQueueAttributesRequest.getQueueUrl()); assertEquals(Arrays.asList(QueueAttributeName.QueueArn.toString()), getQueueAttributesRequest.getAttributeNames()); assertEquals(queueArn, returnedQueueArn); }