@Override
  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
    throws KettleException {

    try {
      rep.saveStepAttribute( id_transformation, id_step, "passing_through_fields", passingThruFields );
      rep.saveStepAttribute( id_transformation, id_step, "dataLocation", getDataLocation() );
      rep.saveStepAttribute( id_transformation, id_step, "sourceFormat", getFormat() );
      rep.saveStepAttribute( id_transformation, id_step, "dataLocationType", dataLocationType );
      rep.saveStepAttribute( id_transformation, id_step, "schemaLocation", getSchemaLocation() );
      rep.saveStepAttribute( id_transformation, id_step, "schemaLocationType", schemaLocationType );
      rep.saveStepAttribute( id_transformation, id_step, "isCacheSchemas", isCacheSchemas() );
      rep.saveStepAttribute( id_transformation, id_step, "allowNullForMissingFields", isAllowNullForMissingFields() );

      for ( int i = 0; i < inputFields.length; i++ ) {
        AvroInputField field = inputFields[ i ];

        rep.saveStepAttribute( id_transformation, id_step, i, "path", field.getAvroFieldName() );
        rep.saveStepAttribute( id_transformation, id_step, i, "name", field.getPentahoFieldName() );
        rep.saveStepAttribute( id_transformation, id_step, i, "type", field.getTypeDesc() );
        AvroSpec.DataType avroDataType = field.getAvroType();
        if ( avroDataType != null && !avroDataType.equals( AvroSpec.DataType.NULL ) ) {
          rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", avroDataType.getName() );
        } else {
          rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", AvroTypeConverter.convertToAvroType( field.getTypeDesc() ) );
        }
        if ( field.getStringFormat() != null ) {
          rep.saveStepAttribute( id_transformation, id_step, i, "format", field.getStringFormat() );
        }
        String indexedValues = field.getIndexedValues();
        if ( indexedValues != null && indexedValues.length() > 0 ) {
          rep.saveStepAttribute( id_transformation, id_step, i, "indexed_vals", indexedValues );
        }
      }

      for ( int i = 0; i < lookupFields.size(); i++ ) {
        AvroLookupField field = lookupFields.get( i );

        rep.saveStepAttribute( id_transformation, id_step, i, "fieldName", field.getFieldName() );
        rep.saveStepAttribute( id_transformation, id_step, i, "variableName", field.getVariableName() );
        rep.saveStepAttribute( id_transformation, id_step, i, "defaultValue", field.getDefaultValue() );

      }

      super.saveRep( rep, metaStore, id_transformation, id_step );
    } catch ( Exception e ) {
      throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e );
    }
  }
@Test
  public void testSaveRep() throws KettleException {
    meta.setInputFields( Arrays.asList( field ) );

    meta.saveRep( rep, metaStore, id_transformation, id_step );
    verify( meta ).getDataLocation();
    verify( meta ).getSchemaLocation();

    verify( field ).getAvroFieldName();
    verify( field ).getPentahoFieldName();
    verify( field ).getTypeDesc();
  }