### Question:
AbstractStepMetaJsonSerializer extends GenericStepOrJobEntryJsonSerializer<T> { protected void writeFieldMappings( T meta, JsonGenerator json, SerializerProvider serializerProvider ) throws IOException { json.writeArrayFieldStart( JSON_PROPERTY_MAPPINGS ); IFieldLineageMetadataProvider mapper = getFieldLineageMetadataProvider( meta ); try { Set<IFieldMapping> fieldMappings = mapper.getFieldMappings( meta ); if ( fieldMappings != null ) { for ( IFieldMapping fieldMapping : fieldMappings ) { json.writeObject( fieldMapping ); } } } catch ( MetaverseAnalyzerException e ) { LOGGER.warn( Messages.getString( "WARNING.Serialization.Step.WriteFieldMappings", meta.getParentStepMeta().getName() ), e ); } json.writeEndArray(); } 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 testWriteFieldMappings() throws Exception { Set<IFieldMapping> mappings = new HashSet<IFieldMapping>(); FieldMapping fieldMapping1 = new FieldMapping( "full name", "first name" ); FieldMapping fieldMapping2 = new FieldMapping( "full name", "last name" ); mappings.add( fieldMapping1 ); mappings.add( fieldMapping2 ); IFieldLineageMetadataProvider mapper = mock( IFieldLineageMetadataProvider.class ); AbstractStepMetaJsonSerializer spy = spy( serializer ); when( spy.getFieldLineageMetadataProvider( spyMeta ) ).thenReturn( mapper ); when( mapper.getFieldMappings( spyMeta ) ).thenReturn( mappings ); spy.writeFieldMappings( spyMeta, json, provider ); verify( json ).writeObject( fieldMapping1 ); verify( json ).writeObject( fieldMapping2 ); }