public RowMetaInterface getPrevInfoFields( String stepname ) throws KettleStepException {
    return getPrevInfoFields( findStep( stepname ) );
  }
@Test
  public void testGetPrevInfoFields() throws KettleStepException {
    DataGridMeta dgm1 = new DataGridMeta();
    dgm1.setFieldName( new String[] { "id", "colA" } );
    dgm1.allocate( 2 );
    dgm1.setFieldType( new String[] {
      ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_INTEGER ),
      ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_STRING ) } );
    List<List<String>> dgm1Data = new ArrayList<>();
    dgm1Data.add( asList( "1", "A" ) );
    dgm1Data.add( asList( "2", "B" ) );
    dgm1.setDataLines( dgm1Data );

    DataGridMeta dgm2 = new DataGridMeta();
    dgm2.allocate( 1 );
    dgm2.setFieldName( new String[] { "moreData" } );
    dgm2.setFieldType( new String[] {
      ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_STRING ) } );
    List<List<String>> dgm2Data = new ArrayList<>();
    dgm2Data.add( List.of( "Some Informational Data" ) );
    dgm2.setDataLines( dgm2Data );

    StepMeta dg1 = new StepMeta( "input1", dgm1 );
    StepMeta dg2 = new StepMeta( "input2", dgm2 );

    final String UDJC_METHOD =
      "public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { return "
        + "false; }";
    UserDefinedJavaClassMeta udjcMeta = new UserDefinedJavaClassMeta();
    udjcMeta.getInfoStepDefinitions().add( new InfoStepDefinition( dg2.getName(), dg2.getName(), dg2, "info_data" ) );
    udjcMeta.replaceDefinitions( singletonList(
      new UserDefinedJavaClassDef( UserDefinedJavaClassDef.ClassType.TRANSFORM_CLASS, "MainClass", UDJC_METHOD ) ) );

    StepMeta udjc = new StepMeta( "PDI-14910", udjcMeta );

    TransHopMeta hop1 = new TransHopMeta( dg1, udjc, true );
    TransHopMeta hop2 = new TransHopMeta( dg2, udjc, true );
    transMeta.addStep( dg1 );
    transMeta.addStep( dg2 );
    transMeta.addStep( udjc );
    transMeta.addTransHop( hop1 );
    transMeta.addTransHop( hop2 );

    RowMetaInterface row;
    row = transMeta.getPrevInfoFields( udjc );
    assertNotNull( row );
    assertEquals( 1, row.size() );
    assertEquals( "moreData", row.getValueMeta( 0 ).getName() );
    assertEquals( ValueMetaInterface.TYPE_STRING, row.getValueMeta( 0 ).getType() );
  }