public void saveUserInfo( IUser userInfo ) throws KettleException {
    normalizeUserInfo( userInfo );
    if ( !validateUserInfo( userInfo ) ) {
      throw new KettleException( BaseMessages.getString( KettleDatabaseRepositorySecurityProvider.class,
        "KettleDatabaseRepositorySecurityProvider.ERROR_0001_UNABLE_TO_CREATE_USER" ) );
    }

    if ( userInfo.getObjectId() != null ) {
      // not a message for UI
      throw new IllegalArgumentException( "Use updateUser() for updating" );
    }

    String userLogin = userInfo.getLogin();
    ObjectId exactMatch = userDelegate.getUserID( userLogin );
    if ( exactMatch != null ) {
      // found the corresponding record in db, prohibit creation!
      throw new KettleException( BaseMessages.getString( KettleDatabaseRepositorySecurityProvider.class,
        "KettleDatabaseRepositorySecurityProvider.ERROR_0001_USER_NAME_ALREADY_EXISTS" ) );
    }

    userDelegate.saveUserInfo( userInfo );
  }
@Test( expected = KettleException.class )
  public void saveUserInfo_NormalizesInfo_FailsIfStillBreaches() throws Exception {
    provider.saveUserInfo( new UserInfo( "    " ) );
  }