void prepareExecutionResultsFileFields( RowMetaInterface row, StepMeta nextStep ) throws KettleStepException {
    if ( nextStep != null && resultFilesTargetStepMeta != null && nextStep.equals( resultFilesTargetStepMeta ) ) {
      addFieldToRow( row, resultFilesFileNameField, ValueMetaInterface.TYPE_STRING );
    }
  }
@Test
  public void testPrepareExecutionResultsFileFields() throws Exception {
    TransExecutorMeta meta = new TransExecutorMeta();
    meta = spy( meta );

    RowMetaInterface row = mock( RowMetaInterface.class );
    StepMeta nextStep = mock( StepMeta.class );

    meta.setResultFilesTargetStepMeta( nextStep );
    meta.setResultFilesFileNameField( "file_name" );

    StepMeta parent = mock( StepMeta.class );
    doReturn( parent ).when( meta ).getParentStepMeta();
    when( parent.getName() ).thenReturn( "parent step" );

    meta.prepareExecutionResultsFileFields( row, nextStep );

    // make sure we get the name of the parent step meta... used for the origin step
    verify( parent ).getName();
    ArgumentCaptor<ValueMetaInterface> argumentCaptor = ArgumentCaptor.forClass( ValueMetaInterface.class );
    verify( row ).addValueMeta( argumentCaptor.capture() );
    assertEquals( "parent step", argumentCaptor.getValue().getOrigin() );
  }