### Question:
XMLOutputMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) { for ( int i = 0; i < outputFields.length; i++ ) { XMLField field = outputFields[i]; ValueMetaInterface v = row.searchValueMeta( field.getFieldName() ); if ( v != null ) { v.setLength( field.getLength(), field.getPrecision() ); } } } XMLOutputMeta(); boolean isDateInFilename(); void setDateInFilename( boolean dateInFilename ); String getExtension(); void setExtension( String extension ); boolean isDoNotOpenNewFileInit(); void setDoNotOpenNewFileInit( boolean doNotOpenNewFileInit ); String getFileName(); void setFileName( String fileName ); int getSplitEvery(); void setSplitEvery( int splitEvery ); boolean isStepNrInFilename(); void setStepNrInFilename( boolean stepNrInFilename ); boolean isTimeInFilename(); void setTimeInFilename( boolean timeInFilename ); boolean isAddToResultFiles(); void setAddToResultFiles( boolean addtoresultfilenamesin ); boolean isSpecifyFormat(); void setSpecifyFormat( boolean SpecifyFormat ); String getDateTimeFormat(); void setDateTimeFormat( String date_time_format ); boolean isZipped(); void setZipped( boolean zipped ); XMLField[] getOutputFields(); void setOutputFields( XMLField[] outputFields ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); void allocate( int nrfields ); Object clone(); String getNewLine( String fformat ); void setDefault(); String[] getFiles( VariableSpace space ); String buildFilename( VariableSpace space, int stepnr, int splitnr, boolean ziparchive ); void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); RowMetaInterface getRequiredFields( VariableSpace space ); String getXML(); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepinfo, RowMetaInterface prev,
      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
      IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta,
      Trans trans ); StepDataInterface getStepData(); String getEncoding(); void setEncoding( String encoding ); String getMainElement(); void setMainElement( String mainElement ); String getRepeatElement(); void setRepeatElement( String repeatElement ); String getNameSpace(); void setNameSpace( String nameSpace ); void setOmitNullValues( boolean omitNullValues ); boolean isOmitNullValues(); boolean isServletOutput(); void setServletOutput( boolean servletOutput ); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
      ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); boolean passDataToServletOutput();  }### Answer:
@Test public void testGetFields() throws Exception { XMLOutputMeta xmlOutputMeta = new XMLOutputMeta(); xmlOutputMeta.setDefault(); XMLField xmlField = new XMLField(); xmlField.setFieldName( "aField" ); xmlField.setLength( 10 ); xmlField.setPrecision( 3 ); xmlOutputMeta.setOutputFields( new XMLField[] { xmlField } ); RowMetaInterface row = mock( RowMetaInterface.class ); RowMetaInterface rmi = mock( RowMetaInterface.class ); StepMeta nextStep = mock( StepMeta.class ); Repository repo = mock( Repository.class ); IMetaStore metastore = mock( IMetaStore.class ); ValueMetaInterface vmi = mock( ValueMetaInterface.class ); when( row.searchValueMeta( "aField" ) ).thenReturn( vmi ); xmlOutputMeta.getFields( row, "", new RowMetaInterface[] { rmi }, nextStep, new Variables(), repo, metastore ); verify( vmi ).setLength( 10, 3 ); }