Program: 5609
Project: 5609
Buggy source:
@Test public void testGenerateSpec(){
  ETLBatchConfig etlConfig=ETLBatchConfig.builder("String_Node_Str").addStage(new ETLStage("String_Node_Str",MOCK_SOURCE)).addStage(new ETLStage("String_Node_Str",MOCK_SINK)).addStage(new ETLStage("String_Node_Str",MOCK_SINK)).addStage(new ETLStage("String_Node_Str",MOCK_TRANSFORM_A)).addStage(new ETLStage("String_Node_Str",MOCK_TRANSFORM_A)).addStage(new ETLStage("String_Node_Str",MOCK_TRANSFORM_B)).addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").build();
  BatchPipelineSpec actual=specGenerator.generateSpec(etlConfig);
  Map<String,String> emptyMap=ImmutableMap.of();
  PipelineSpec expected=BatchPipelineSpec.builder().addStage(StageSpec.builder("String_Node_Str",new PluginSpec(BatchSource.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).setOutputSchema(SCHEMA_A).addOutputs("String_Node_Str","String_Node_Str","String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(BatchSink.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchema("String_Node_Str",SCHEMA_B).addInputs("String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(BatchSink.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchemas(ImmutableMap.<String,Schema>of("String_Node_Str",SCHEMA_A,"String_Node_Str",SCHEMA_A,"String_Node_Str",SCHEMA_A)).addInputs("String_Node_Str","String_Node_Str","String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(Transform.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchema("String_Node_Str",SCHEMA_A).setOutputSchema(SCHEMA_A).addInputs("String_Node_Str").addOutputs("String_Node_Str","String_Node_Str","String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(Transform.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchemas(ImmutableMap.<String,Schema>of("String_Node_Str",SCHEMA_A,"String_Node_Str",SCHEMA_A)).setOutputSchema(SCHEMA_A).addInputs("String_Node_Str","String_Node_Str").addOutputs("String_Node_Str","String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(Transform.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchemas(ImmutableMap.<String,Schema>of("String_Node_Str",SCHEMA_A,"String_Node_Str",SCHEMA_A)).setOutputSchema(SCHEMA_B).addInputs("String_Node_Str","String_Node_Str").addOutputs("String_Node_Str").build()).addConnections(etlConfig.getConnections()).setResources(etlConfig.getResources()).setStageLoggingEnabled(etlConfig.isStageLoggingEnabled()).build();
  Assert.assertEquals(expected,actual);
}

Fixed version (ground truth):
@Test public void testGenerateSpec(){
  ETLBatchConfig etlConfig=ETLBatchConfig.builder("String_Node_Str").addStage(new ETLStage("String_Node_Str",MOCK_SOURCE)).addStage(new ETLStage("String_Node_Str",MOCK_SINK)).addStage(new ETLStage("String_Node_Str",MOCK_SINK)).addStage(new ETLStage("String_Node_Str",MOCK_TRANSFORM_A)).addStage(new ETLStage("String_Node_Str",MOCK_TRANSFORM_A)).addStage(new ETLStage("String_Node_Str",MOCK_TRANSFORM_B)).addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").addConnection("String_Node_Str","String_Node_Str").build();
  BatchPipelineSpec actual=specGenerator.generateSpec(etlConfig);
  Map<String,String> emptyMap=ImmutableMap.of();
  PipelineSpec expected=BatchPipelineSpec.builder().addStage(StageSpec.builder("String_Node_Str",new PluginSpec(BatchSource.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).setOutputSchema(SCHEMA_A).addOutputs("String_Node_Str","String_Node_Str","String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(BatchSink.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchema("String_Node_Str",SCHEMA_B).addInputs("String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(BatchSink.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchemas(ImmutableMap.of("String_Node_Str",SCHEMA_A,"String_Node_Str",SCHEMA_A,"String_Node_Str",SCHEMA_A)).addInputs("String_Node_Str","String_Node_Str","String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(Transform.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchema("String_Node_Str",SCHEMA_A).setOutputSchema(SCHEMA_A).addInputs("String_Node_Str").addOutputs("String_Node_Str","String_Node_Str","String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(Transform.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchemas(ImmutableMap.of("String_Node_Str",SCHEMA_A,"String_Node_Str",SCHEMA_A)).setOutputSchema(SCHEMA_A).addInputs("String_Node_Str","String_Node_Str").addOutputs("String_Node_Str","String_Node_Str").build()).addStage(StageSpec.builder("String_Node_Str",new PluginSpec(Transform.PLUGIN_TYPE,"String_Node_Str",emptyMap,ARTIFACT_ID)).addInputSchemas(ImmutableMap.of("String_Node_Str",SCHEMA_A,"String_Node_Str",SCHEMA_A)).setOutputSchema(SCHEMA_B).addInputs("String_Node_Str","String_Node_Str").addOutputs("String_Node_Str").build()).addConnections(etlConfig.getConnections()).setResources(etlConfig.getResources()).setStageLoggingEnabled(etlConfig.isStageLoggingEnabled()).build();
  Assert.assertEquals(expected,actual);
}