@Test public void getOutput_GivenLambdaDestination_ShouldReturnLambdaArn() { AwsResource lambda = new AwsResource( "arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecords" ); LambdaOutputDescription lambdaOutputDescription = LambdaOutputDescription.builder() .resourceARN(lambda.getArn()).build(); OutputDescription d = OutputDescription.builder().name(lambda.getResource()) .lambdaOutputDescription(lambdaOutputDescription).build(); configureOutputs(d); Assert.assertEquals(lambda, wrapper.getOutput(lambda.getResource())); }
public AwsResource getOutput(String name) { Optional<OutputDescription> optionalOutputDescription = applicationDetailSupplier.get() .outputDescriptions().stream() .filter(d -> d.name().equalsIgnoreCase(name)) .findFirst(); if (!optionalOutputDescription.isPresent()) { String outputs = applicationDetailSupplier.get().outputDescriptions().stream() .map(OutputDescription::name) .collect(Collectors.joining(",")); throw new IllegalArgumentException("no output by name: " + name + "; outputs: " + outputs); } OutputDescription desc = optionalOutputDescription.get(); String arn; if (desc.kinesisStreamsOutputDescription() != null) { arn = desc.kinesisStreamsOutputDescription().resourceARN(); } else if (desc.kinesisFirehoseOutputDescription() != null) { arn = desc.kinesisFirehoseOutputDescription().resourceARN(); } else if (desc.lambdaOutputDescription() != null) { arn = desc.lambdaOutputDescription().resourceARN(); } else { throw new IllegalStateException("Unknown destination for output named " + name); } return new AwsResource(arn); }
ApplicationIOProvider { public AwsResource getOutput(String name) { Optional<OutputDescription> optionalOutputDescription = applicationDetailSupplier.get() .outputDescriptions().stream() .filter(d -> d.name().equalsIgnoreCase(name)) .findFirst(); if (!optionalOutputDescription.isPresent()) { String outputs = applicationDetailSupplier.get().outputDescriptions().stream() .map(OutputDescription::name) .collect(Collectors.joining(",")); throw new IllegalArgumentException("no output by name: " + name + "; outputs: " + outputs); } OutputDescription desc = optionalOutputDescription.get(); String arn; if (desc.kinesisStreamsOutputDescription() != null) { arn = desc.kinesisStreamsOutputDescription().resourceARN(); } else if (desc.kinesisFirehoseOutputDescription() != null) { arn = desc.kinesisFirehoseOutputDescription().resourceARN(); } else if (desc.lambdaOutputDescription() != null) { arn = desc.lambdaOutputDescription().resourceARN(); } else { throw new IllegalStateException("Unknown destination for output named " + name); } return new AwsResource(arn); } }
ApplicationIOProvider { public AwsResource getOutput(String name) { Optional<OutputDescription> optionalOutputDescription = applicationDetailSupplier.get() .outputDescriptions().stream() .filter(d -> d.name().equalsIgnoreCase(name)) .findFirst(); if (!optionalOutputDescription.isPresent()) { String outputs = applicationDetailSupplier.get().outputDescriptions().stream() .map(OutputDescription::name) .collect(Collectors.joining(",")); throw new IllegalArgumentException("no output by name: " + name + "; outputs: " + outputs); } OutputDescription desc = optionalOutputDescription.get(); String arn; if (desc.kinesisStreamsOutputDescription() != null) { arn = desc.kinesisStreamsOutputDescription().resourceARN(); } else if (desc.kinesisFirehoseOutputDescription() != null) { arn = desc.kinesisFirehoseOutputDescription().resourceARN(); } else if (desc.lambdaOutputDescription() != null) { arn = desc.lambdaOutputDescription().resourceARN(); } else { throw new IllegalStateException("Unknown destination for output named " + name); } return new AwsResource(arn); } ApplicationIOProvider(String applicationName);  ApplicationIOProvider(KinesisAnalyticsClient client, String applicationName); }
ApplicationIOProvider { public AwsResource getOutput(String name) { Optional<OutputDescription> optionalOutputDescription = applicationDetailSupplier.get() .outputDescriptions().stream() .filter(d -> d.name().equalsIgnoreCase(name)) .findFirst(); if (!optionalOutputDescription.isPresent()) { String outputs = applicationDetailSupplier.get().outputDescriptions().stream() .map(OutputDescription::name) .collect(Collectors.joining(",")); throw new IllegalArgumentException("no output by name: " + name + "; outputs: " + outputs); } OutputDescription desc = optionalOutputDescription.get(); String arn; if (desc.kinesisStreamsOutputDescription() != null) { arn = desc.kinesisStreamsOutputDescription().resourceARN(); } else if (desc.kinesisFirehoseOutputDescription() != null) { arn = desc.kinesisFirehoseOutputDescription().resourceARN(); } else if (desc.lambdaOutputDescription() != null) { arn = desc.lambdaOutputDescription().resourceARN(); } else { throw new IllegalStateException("Unknown destination for output named " + name); } return new AwsResource(arn); } ApplicationIOProvider(String applicationName);  ApplicationIOProvider(KinesisAnalyticsClient client, String applicationName); AwsResource getInput(); AwsResource getOutput(String name); }
ApplicationIOProvider { public AwsResource getOutput(String name) { Optional<OutputDescription> optionalOutputDescription = applicationDetailSupplier.get() .outputDescriptions().stream() .filter(d -> d.name().equalsIgnoreCase(name)) .findFirst(); if (!optionalOutputDescription.isPresent()) { String outputs = applicationDetailSupplier.get().outputDescriptions().stream() .map(OutputDescription::name) .collect(Collectors.joining(",")); throw new IllegalArgumentException("no output by name: " + name + "; outputs: " + outputs); } OutputDescription desc = optionalOutputDescription.get(); String arn; if (desc.kinesisStreamsOutputDescription() != null) { arn = desc.kinesisStreamsOutputDescription().resourceARN(); } else if (desc.kinesisFirehoseOutputDescription() != null) { arn = desc.kinesisFirehoseOutputDescription().resourceARN(); } else if (desc.lambdaOutputDescription() != null) { arn = desc.lambdaOutputDescription().resourceARN(); } else { throw new IllegalStateException("Unknown destination for output named " + name); } return new AwsResource(arn); } ApplicationIOProvider(String applicationName);  ApplicationIOProvider(KinesisAnalyticsClient client, String applicationName); AwsResource getInput(); AwsResource getOutput(String name);  }