### Question:
GetXMLDataStepAnalyzer extends ExternalResourceStepAnalyzer<GetXMLDataMeta> { @Override protected Map<String, RowMetaInterface> getInputRowMetaInterfaces( GetXMLDataMeta meta ) { Map<String, RowMetaInterface> inputRows = getInputFields( meta ); if ( inputRows == null ) { inputRows = new HashMap<>(); } boolean isInFields = meta.isInFields(); boolean isAFile = meta.getIsAFile(); boolean isAUrl = meta.isReadUrl(); if ( !isInFields || isAFile || isAUrl ) { RowMetaInterface stepFields = getOutputFields( meta ); RowMetaInterface clone = stepFields.clone(); for ( RowMetaInterface rowMetaInterface : inputRows.values() ) { for ( ValueMetaInterface valueMetaInterface : rowMetaInterface.getValueMetaList() ) { try { clone.removeValueMeta( valueMetaInterface.getName() ); } catch ( KettleValueException e ) { } } } inputRows.put( RESOURCE, clone ); } return inputRows; }  @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); @Override Set<ComponentDerivationRecord> getChangeRecords( GetXMLDataMeta meta ); @Override IMetaverseNode createResourceNode( IExternalResourceInfo resource ); @Override String getResourceInputNodeType(); @Override String getResourceOutputNodeType(); @Override boolean isOutput(); @Override boolean isInput();  }### Answer:
@Test public void testGetInputRowMetaInterfaces_isInFields() throws Exception { when( parentTransMeta.getPrevStepNames( parentStepMeta ) ).thenReturn( null ); RowMetaInterface rowMetaInterface = mock( RowMetaInterface.class ); doReturn( rowMetaInterface ).when( analyzer ).getOutputFields( meta ); when( meta.isInFields() ).thenReturn( true ); when( meta.getIsAFile() ).thenReturn( false ); when( meta.isReadUrl() ).thenReturn( false ); Map<String, RowMetaInterface> rowMetaInterfaces = analyzer.getInputRowMetaInterfaces( meta ); assertNotNull( rowMetaInterfaces ); assertEquals( 0, rowMetaInterfaces.size() ); }
@Test public void testGetInputRowMetaInterfaces_isNotInField() throws Exception { Map<String, RowMetaInterface> inputs = new HashMap<>(); RowMetaInterface inputRmi = mock( RowMetaInterface.class ); List<ValueMetaInterface> vmis = new ArrayList<>(); ValueMetaInterface vmi = new ValueMeta( "filename" ); vmis.add( vmi ); when( inputRmi.getValueMetaList() ).thenReturn( vmis ); inputs.put( "test", inputRmi ); doReturn( inputs ).when( analyzer ).getInputFields( meta ); when( parentTransMeta.getPrevStepNames( parentStepMeta ) ).thenReturn( null ); RowMetaInterface rowMetaInterface = new RowMeta(); rowMetaInterface.addValueMeta( vmi ); ValueMetaInterface vmi2 = new ValueMeta( "otherField" ); rowMetaInterface.addValueMeta( vmi2 ); doReturn( rowMetaInterface ).when( analyzer ).getOutputFields( meta ); when( meta.isInFields() ).thenReturn( false ); when( meta.getIsAFile() ).thenReturn( false ); when( meta.isReadUrl() ).thenReturn( false ); Map<String, RowMetaInterface> rowMetaInterfaces = analyzer.getInputRowMetaInterfaces( meta ); assertNotNull( rowMetaInterfaces ); assertEquals( 2, rowMetaInterfaces.size() ); RowMetaInterface metaInterface = rowMetaInterfaces.get( ExternalResourceStepAnalyzer.RESOURCE ); assertEquals( 1, metaInterface.size() ); assertEquals( "otherField", metaInterface.getFieldNames()[0] ); }