### Question:
ApplicationIOProvider { public AwsResource getInput() { InputDescription desc = applicationDetailSupplier.get().inputDescriptions().get(0); String arn; if (desc.kinesisStreamsInputDescription() != null) { arn = desc.kinesisStreamsInputDescription().resourceARN(); } else { throw new IllegalStateException("Unknown type for input named: " + desc.namePrefix()); } return new AwsResource(arn); } ApplicationIOProvider(String applicationName);  ApplicationIOProvider(KinesisAnalyticsClient client, String applicationName); AwsResource getInput(); AwsResource getOutput(String name);  }### Answer:
@Test public void getInput_GivenApplicationDetailSpecifyingExactlyOneInput_ShouldReturnThatInput() { AwsResource expected = new AwsResource(streamArnPrefix + "example-stream-name"); configureInputs(inputStreamDescription(expected)); Assert.assertEquals(expected, wrapper.getInput()); }
@Test public void getInput_OnSecondInvocation_ShouldNotRequestApplicationDetail() { AwsResource expected = new AwsResource(streamArnPrefix + "example-stream-name"); configureInputs(inputStreamDescription(expected)); wrapper.getInput(); Mockito.verify(client) .describeApplication(DescribeApplicationRequest.builder().applicationName(applicationName).build()); wrapper.getInput(); Mockito.verifyNoMoreInteractions(client); }
@Test(expected = IllegalStateException.class) public void getInput_GivenInputThatDoesNotHaveKinesisStreamDescription_ShouldThrow() { configureInputs(InputDescription.builder().namePrefix("foo").build()); wrapper.getInput(); }
@Test public void getInput_GivenApplicationDetailSpecifyingMultipleInputs_ShouldReturnFirstInput() { AwsResource expected = new AwsResource(streamArnPrefix + "example-stream-name"); configureInputs(inputStreamDescription(expected), InputDescription.builder().namePrefix("b").build()); Assert.assertEquals(expected, wrapper.getInput()); }