### Question:
AbstractStepMetaJsonSerializer extends GenericStepOrJobEntryJsonSerializer<T> { protected void writeInputFields( T meta, JsonGenerator json ) throws IOException { IFieldLineageMetadataProvider fieldLineageProvider = getFieldLineageMetadataProvider( meta ); Map<String, RowMetaInterface> fieldMap = fieldLineageProvider.getInputFields( meta ); List<RowMetaInterface> fieldMetaList = new ArrayList<RowMetaInterface>(); if ( !MapUtils.isEmpty( fieldMap ) ) { for ( RowMetaInterface rowMetaInterface : fieldMap.values() ) { fieldMetaList.add( rowMetaInterface ); } } writeFields( json, fieldMetaList, JSON_PROPERTY_INPUT_FIELDS ); } protected  AbstractStepMetaJsonSerializer( Class<T> aClass ); protected  AbstractStepMetaJsonSerializer( Class<T> aClass, LineageRepository repo ); IStepAnalyzerProvider getStepAnalyzerProvider(); void setStepAnalyzerProvider( IStepAnalyzerProvider stepAnalyzerProvider ); static final String JSON_PROPERTY_TRANSFORMS; static final String JSON_PROPERTY_INPUT_FIELDS; static final String JSON_PROPERTY_OUTPUT_FIELDS; static final String JSON_PROPERTY_MAPPINGS; }### Answer:
@Test public void testWriteInputFields() throws Exception { serializer = new BaseStepMetaJsonSerializer( BaseStepMeta.class ); serializer.setLineageRepository( repo ); when( spyParent.getParentTransMeta() ).thenReturn( spyParentTrans ); IFieldLineageMetadataProvider mapper = mock( IFieldLineageMetadataProvider.class ); AbstractStepMetaJsonSerializer spy = spy( serializer ); when( spy.getFieldLineageMetadataProvider( spyMeta ) ).thenReturn( mapper ); RowMetaInterface rmi = mock( RowMetaInterface.class ); List<ValueMetaInterface> vml = new ArrayList<ValueMetaInterface>(); ValueMetaInterface col1 = mock( ValueMetaInterface.class ); ValueMetaInterface col2 = mock( ValueMetaInterface.class ); ValueMetaInterface col3 = mock( ValueMetaInterface.class ); vml.add( col1 ); vml.add( col2 ); vml.add( col3 ); when( rmi.getValueMetaList() ).thenReturn( vml ); HashMap<String, RowMetaInterface> fieldMetaMap = new HashMap<String, RowMetaInterface>( 1 ); fieldMetaMap.put( "prev step name", rmi ); when( mapper.getInputFields( spyMeta ) ).thenReturn( fieldMetaMap ); spy.writeInputFields( spyMeta, json ); verify( json, times( 3 ) ).writeObject( any( IFieldInfo.class ) ); }