@Test public void shouldCreateMetaDataFromEmptySurroundingSteps() { DynamicActionMetadata metadata = metadataHandler.createMetadata(aggregateStep, Collections.emptyList(), Collections.emptyList()); Assert.assertEquals(StepMetadataHelper.NO_SHAPE, metadata.inputShape()); Assert.assertEquals(StepMetadataHelper.NO_SHAPE, metadata.outputShape()); }
@Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); return new DynamicActionMetadata.Builder() .inputShape(inputShape) .outputShape(outputShape) .build(); }
AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); return new DynamicActionMetadata.Builder() .inputShape(inputShape) .outputShape(outputShape) .build(); } }
AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); return new DynamicActionMetadata.Builder() .inputShape(inputShape) .outputShape(outputShape) .build(); }  }
AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); return new DynamicActionMetadata.Builder() .inputShape(inputShape) .outputShape(outputShape) .build(); }  @Override boolean canHandle(StepKind kind); @Override DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps); @Override DynamicActionMetadata handle(DynamicActionMetadata metadata); }
AggregateMetadataHandler implements StepMetadataHandler { @Override public DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps) { DataShape inputShape = StepMetadataHelper.getFirstWithInputShape(subsequentSteps) .flatMap(Step::inputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); DataShape outputShape = StepMetadataHelper.getLastWithOutputShape(previousSteps) .flatMap(Step::outputDataShape) .orElse(StepMetadataHelper.NO_SHAPE); return new DynamicActionMetadata.Builder() .inputShape(inputShape) .outputShape(outputShape) .build(); }  @Override boolean canHandle(StepKind kind); @Override DynamicActionMetadata createMetadata(Step step, List<Step> previousSteps, List<Step> subsequentSteps); @Override DynamicActionMetadata handle(DynamicActionMetadata metadata); static final String BODY; }