### Question:
Stack { public StackResourceDetail describeResource(final String logicalResourceId) { final DescribeStackResourceRequest request = new DescribeStackResourceRequest() .withLogicalResourceId(logicalResourceId).withStackName(name); final DescribeStackResourceResult result = cloudFormationClient.describeStackResource(request); return result.getStackResourceDetail(); } Stack(final AmazonCloudFormation cloudFormationClient, final String name); StackResourceDetail describeResource(final String logicalResourceId); String physicalResourceId(final String logicalResourceId); com.amazonaws.services.cloudformation.model.Stack describe();  }### Answer:
@Test public void shouldReturnStackResourceDetail_withLogicalResourceId() { final String logicalResourceId = randomString(); final StackResourceDetail stackResourceDetail = new StackResourceDetail(); final DescribeStackResourceResult describeStackResourceResult = new DescribeStackResourceResult() .withStackResourceDetail(stackResourceDetail); final DescribeStackResourceRequest expectedRequest = new DescribeStackResourceRequest() .withLogicalResourceId(logicalResourceId).withStackName(stackName); when(mockCloudFormationClient.describeStackResource(expectedRequest)).thenReturn(describeStackResourceResult); final StackResourceDetail result = stack.describeResource(logicalResourceId); assertSame(stackResourceDetail, result); }