public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {
    try {
      databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, TAG_ID_CONNECTION, databases );

      commitSize = rep.getStepAttributeString( id_step, TAG_COMMIT );
      if ( commitSize == null ) {
        long comSz = -1;
        try {
          comSz = rep.getStepAttributeInteger( id_step, TAG_COMMIT );
        } catch ( Exception ex ) {
          commitSize = "100";
        }
        if ( comSz >= 0 ) {
          commitSize = Long.toString( comSz );
        }
      }
      schemaName = rep.getStepAttributeString( id_step, TAG_SCHEMA );
      tableName = rep.getStepAttributeString( id_step, TAG_TABLE );

      int nrkeys = rep.countNrStepAttributes( id_step, TAG_KEY_FIELD );

      allocate( nrkeys );

      for ( int i = 0; i < nrkeys; i++ ) {
        keyFields[i].setKeyStream( rep.getStepAttributeString( id_step, i, TAG_KEY_NAME ) );
        keyFields[i].setKeyLookup( rep.getStepAttributeString( id_step, i, TAG_KEY_FIELD ) );
        keyFields[i].setKeyCondition( rep.getStepAttributeString( id_step, i, TAG_KEY_CONDITION ) );
        keyFields[i].setKeyStream2( rep.getStepAttributeString( id_step, i, TAG_KEY_NAME2 ) );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
              PKG, "DeleteMeta.Exception.UnexpectedErrorInReadingStepInfo" ), e );
    }
  }
@Test
  public void testReadRepToLoadKeys() throws KettleException {
    DeleteMeta deleteMeta = new DeleteMeta();
    Repository rep = mock( Repository.class );
    IMetaStore metaStore = mock( IMetaStore.class );
    ObjectId idStep = mock( ObjectId.class );
    List<DatabaseMeta> databases = new ArrayList<>();

    String keyNameValue = UUID.randomUUID().toString();
    String keyFieldValue = UUID.randomUUID().toString();
    String keyConditionValue = UUID.randomUUID().toString();
    String keyName2Value = UUID.randomUUID().toString();

    when( rep.countNrStepAttributes( idStep, "key_field" ) ).thenReturn( 1 );
    when( rep.getStepAttributeString( idStep, 0, "key_name" ) ).thenReturn( keyNameValue );
    when( rep.getStepAttributeString( idStep, 0, "key_field" ) ).thenReturn( keyFieldValue );
    when( rep.getStepAttributeString( idStep, 0, "key_condition" ) ).thenReturn( keyConditionValue );
    when( rep.getStepAttributeString( idStep, 0, "key_name2" ) ).thenReturn( keyName2Value );

    deleteMeta.readRep( rep, metaStore, idStep, databases );

    assertEquals( 1, ( (DeleteMeta.KeyFields[])
            getInternalState( deleteMeta, "keyFields" ) ).length );
    assertEquals( keyNameValue, ( (DeleteMeta.KeyFields[])
            getInternalState( deleteMeta, "keyFields" ) )[0].getKeyStream() );
    assertEquals( keyFieldValue, ( (DeleteMeta.KeyFields[])
            getInternalState( deleteMeta, "keyFields" ) )[0].getKeyLookup() );
    assertEquals( keyConditionValue, ( (DeleteMeta.KeyFields[])
            getInternalState( deleteMeta, "keyFields" ) )[0].getKeyCondition() );
    assertEquals( keyName2Value, ( (DeleteMeta.KeyFields[])
            getInternalState( deleteMeta, "keyFields" ) )[0].getKeyStream2() );
  }