### Question:
AbstractStepMetaJsonSerializer extends GenericStepOrJobEntryJsonSerializer<T> { protected void writeOutputFields( StepMeta parentStepMeta, JsonGenerator json ) throws IOException { TransMeta parentTransMeta = parentStepMeta.getParentTransMeta(); if ( parentTransMeta != null ) { try { RowMetaInterface stepFields = parentTransMeta.getStepFields( parentStepMeta ); writeFields( json, stepFields, JSON_PROPERTY_OUTPUT_FIELDS ); } catch ( KettleStepException e ) { LOGGER.warn( Messages.getString( "WARNING.Serialization.Step.OutputFields", parentStepMeta.getName() ), e ); } } } 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 testWriteOutputFields() throws Exception { serializer = new BaseStepMetaJsonSerializer( BaseStepMeta.class ); serializer.setLineageRepository( repo ); when( spyParent.getParentTransMeta() ).thenReturn( spyParentTrans ); 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 ); when( spyParentTrans.getStepFields( any( StepMeta.class ) ) ).thenReturn( rmi ); serializer.writeOutputFields( spyParent, json ); verify( json, times( 3 ) ).writeObject( any( IFieldInfo.class ) ); }