public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {
    try {
      sourcefilenamefield = rep.getStepAttributeString( id_step, "sourcefilenamefield" );
      targetfilenamefield = rep.getStepAttributeString( id_step, "targetfilenamefield" );
      baseFolderField = rep.getStepAttributeString( id_step, "baseFolderField" );
      operationType =
        getOperationTypeByCode( Const.NVL( rep.getStepAttributeString( id_step, "operation_type" ), "" ) );
      addresultfilenames = rep.getStepAttributeBoolean( id_step, "addresultfilenames" );
      overwritezipentry = rep.getStepAttributeBoolean( id_step, "overwritezipentry" );
      createparentfolder = rep.getStepAttributeBoolean( id_step, "createparentfolder" );
      keepsourcefolder = rep.getStepAttributeBoolean( id_step, "keepsourcefolder" );
      movetofolderfield = rep.getStepAttributeString( id_step, "movetofolderfield" );

    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "ZipFileMeta.Exception.UnexpectedErrorReadingStepInfo" ), e );
    }
  }
@Test
  public void testReadRep() throws Exception {
    ZipFileMeta zipFileMeta = new ZipFileMeta();
    Repository rep = mock( Repository.class );
    IMetaStore metastore = mock( IMetaStore.class );
    DatabaseMeta dbMeta = mock( DatabaseMeta.class );

    StringObjectId oid = new StringObjectId( "oid" );

    when( rep.getStepAttributeString( oid, "sourcefilenamefield" ) ).thenReturn( SOURCE_FILENAME );
    when( rep.getStepAttributeString( oid, "targetfilenamefield" ) ).thenReturn( TARGET_FILENAME );
    when( rep.getStepAttributeString( oid, "baseFolderField" ) ).thenReturn( BASE_FOLDER );
    when( rep.getStepAttributeString( oid, "operation_type" ) ).thenReturn( OPERATION_TYPE );
    when( rep.getStepAttributeBoolean( oid, "addresultfilenames" ) ).thenReturn( ADD_RESULT_FILENAME );
    when( rep.getStepAttributeBoolean( oid, "overwritezipentry" ) ).thenReturn( OVERWRITE_ZIP_ENTRY );
    when( rep.getStepAttributeBoolean( oid, "createparentfolder" ) ).thenReturn( CREATE_PARENT_FOLDER );
    when( rep.getStepAttributeBoolean( oid, "keepsourcefolder" ) ).thenReturn( KEEP_SOURCE_FOLDER );
    when( rep.getStepAttributeString( oid, "movetofolderfield" ) ).thenReturn( MOVE_TO_FOLDER_FIELD );

    zipFileMeta.readRep( rep, metastore, oid, Collections.singletonList( dbMeta ) );

    assertEquals( SOURCE_FILENAME, zipFileMeta.getDynamicSourceFileNameField() );
    assertEquals( TARGET_FILENAME, zipFileMeta.getDynamicTargetFileNameField() );
    assertEquals( BASE_FOLDER, zipFileMeta.getBaseFolderField() );
    assertEquals( ZipFileMeta.getOperationTypeByDesc( OPERATION_TYPE ), zipFileMeta.getOperationType() );
    assertEquals( MOVE_TO_FOLDER_FIELD, zipFileMeta.getMoveToFolderField() );
    assertTrue( zipFileMeta.isaddTargetFileNametoResult() );
    assertTrue( zipFileMeta.isOverwriteZipEntry() );
    assertTrue( zipFileMeta.isKeepSouceFolder() );
    assertTrue( zipFileMeta.isCreateParentFolder() );

    Mockito.reset( rep, metastore );
    StringObjectId transid = new StringObjectId( "transid" );
    zipFileMeta.saveRep( rep, metastore, transid, oid );
    verify( rep ).saveStepAttribute( transid, oid, "sourcefilenamefield", SOURCE_FILENAME );
    verify( rep ).saveStepAttribute( transid, oid, "targetfilenamefield", TARGET_FILENAME );
    verify( rep ).saveStepAttribute( transid, oid, "baseFolderField", BASE_FOLDER );
    verify( rep ).saveStepAttribute( transid, oid, "operation_type", OPERATION_TYPE );
    verify( rep ).saveStepAttribute( transid, oid, "addresultfilenames", ADD_RESULT_FILENAME );
    verify( rep ).saveStepAttribute( transid, oid, "overwritezipentry", OVERWRITE_ZIP_ENTRY );
    verify( rep ).saveStepAttribute( transid, oid, "createparentfolder", CREATE_PARENT_FOLDER );
    verify( rep ).saveStepAttribute( transid, oid, "keepsourcefolder", KEEP_SOURCE_FOLDER );
    verify( rep ).saveStepAttribute( transid, oid, "movetofolderfield", MOVE_TO_FOLDER_FIELD );

    Mockito.verifyNoMoreInteractions( rep, metastore );
  }