Program: 5715
Project: 5715
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void testWordCountSparkSink() throws Exception {
  String inputName="String_Node_Str";
  String outputName="String_Node_Str";
  ETLStage source=new ETLStage("String_Node_Str",MockSource.getPlugin(inputName));
  Map<String,String> sinkProperties=new HashMap<>();
  sinkProperties.put("String_Node_Str","String_Node_Str");
  sinkProperties.put("String_Node_Str",outputName);
  ETLStage sink=new ETLStage("String_Node_Str",new ETLPlugin(WordCountSink.NAME,SparkSink.PLUGIN_TYPE,sinkProperties,null));
  ETLBatchConfig pipelineConfig=ETLBatchConfig.builder("String_Node_Str").addStage(source).addStage(sink).addConnection(source.getName(),sink.getName()).build();
  Id.Application pipelineId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(pipelineId,new AppRequest<>(APP_ARTIFACT,pipelineConfig));
  Schema inputSchema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)));
  DataSetManager<Table> inputManager=getDataset(inputName);
  List<StructuredRecord> inputRecords=new ArrayList<>();
  inputRecords.add(StructuredRecord.builder(inputSchema).set("String_Node_Str","String_Node_Str").build());
  inputRecords.add(StructuredRecord.builder(inputSchema).set("String_Node_Str","String_Node_Str").build());
  inputRecords.add(StructuredRecord.builder(inputSchema).set("String_Node_Str","String_Node_Str").build());
  MockSource.writeInput(inputManager,inputRecords);
  WorkflowManager workflowManager=appManager.getWorkflowManager(SmartWorkflow.NAME);
  workflowManager.start();
  workflowManager.waitForFinish(4,TimeUnit.MINUTES);
  DataSetManager<KeyValueTable> outputManager=getDataset(outputName);
  KeyValueTable output=outputManager.get();
  Assert.assertEquals(3L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(1L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(2L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(2L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(2L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(1L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(1L,Bytes.toLong(output.read("String_Node_Str")));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testWordCountSparkSink() throws Exception {
  String inputName="String_Node_Str";
  String outputName="String_Node_Str";
  ETLStage source=new ETLStage("String_Node_Str",MockSource.getPlugin(inputName));
  Map<String,String> sinkProperties=new HashMap<>();
  sinkProperties.put("String_Node_Str","String_Node_Str");
  sinkProperties.put("String_Node_Str",outputName);
  ETLStage sink=new ETLStage("String_Node_Str",new ETLPlugin(WordCountSink.NAME,SparkSink.PLUGIN_TYPE,sinkProperties,null));
  ETLBatchConfig pipelineConfig=ETLBatchConfig.builder("String_Node_Str").addStage(source).addStage(sink).addConnection(source.getName(),sink.getName()).build();
  ApplicationId pipelineId=NamespaceId.DEFAULT.app("String_Node_Str");
  ApplicationManager appManager=deployApplication(pipelineId,new AppRequest<>(APP_ARTIFACT,pipelineConfig));
  Schema inputSchema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)));
  DataSetManager<Table> inputManager=getDataset(inputName);
  List<StructuredRecord> inputRecords=new ArrayList<>();
  inputRecords.add(StructuredRecord.builder(inputSchema).set("String_Node_Str","String_Node_Str").build());
  inputRecords.add(StructuredRecord.builder(inputSchema).set("String_Node_Str","String_Node_Str").build());
  inputRecords.add(StructuredRecord.builder(inputSchema).set("String_Node_Str","String_Node_Str").build());
  MockSource.writeInput(inputManager,inputRecords);
  WorkflowManager workflowManager=appManager.getWorkflowManager(SmartWorkflow.NAME);
  workflowManager.start();
  workflowManager.waitForFinish(4,TimeUnit.MINUTES);
  DataSetManager<KeyValueTable> outputManager=getDataset(outputName);
  KeyValueTable output=outputManager.get();
  Assert.assertEquals(3L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(1L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(2L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(2L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(2L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(1L,Bytes.toLong(output.read("String_Node_Str")));
  Assert.assertEquals(1L,Bytes.toLong(output.read("String_Node_Str")));
}