public RowMetaInterface getStepFields( String stepname ) throws KettleStepException {
    StepMeta stepMeta = findStep( stepname );
    if ( stepMeta != null ) {
      return getStepFields( stepMeta );
    } else {
      return null;
    }
  }
@Test
  public void prevStepFieldsAreIncludedInGetStepFields() throws KettleStepException {

    TransMeta transMeta = new TransMeta( new Variables() );
    StepMeta prevStep1 = testStep( "prevStep1", emptyList(), asList( "field1", "field2" ) );
    StepMeta prevStep2 = testStep( "prevStep2", emptyList(), asList( "field3", "field4", "field5" ) );

    StepMeta someStep = testStep( "step", List.of( "prevStep1" ), List.of( "outputField" ) );

    StepMeta after = new StepMeta( "after", new DummyTransMeta() );

    wireUpTestTransMeta( transMeta, prevStep1, prevStep2, someStep, after );

    RowMetaInterface results = transMeta.getStepFields( someStep, after, mock( ProgressMonitorListener.class ) );

    assertThat( 4, equalTo( results.size() ) );
    assertThat( new String[] { "field3", "field4", "field5", "outputField" }, equalTo( results.getFieldNames() ) );
  }