public void saveUserInfo( IUser user ) throws KettleException {
    normalizeUserInfo( user );
    if ( !validateUserInfo( user ) ) {
      throw new KettleException( BaseMessages.getString( PurRepositorySecurityManager.class,
          "PurRepositorySecurityManager.ERROR_0001_INVALID_NAME" ) );
    }
    userRoleDelegate.createUser( user );
  }
@Test
  public void saveUserInfo_NormalizesInfo_PassesIfNoViolations() throws Exception {
    IUser info = new UserInfo( "login    " );

    ArgumentCaptor<IUser> captor = ArgumentCaptor.forClass( IUser.class );
    manager.saveUserInfo( info );
    verify( roleDelegate ).createUser( captor.capture() );

    info = captor.getValue();
    assertEquals( "Spaces should be trimmed", "login", info.getLogin() );
  }