### Question:
PurRepositorySecurityManager implements IRoleSupportSecurityManager, IUserRoleListChangeListener,
    java.io.Serializable, RepositorySecurityUserValidator, RepositorySecurityRoleValidator { 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 ); } PurRepositorySecurityManager( PurRepository repository, PurRepositoryMeta repositoryMeta, IUser user,
      ServiceManager serviceManager ); UserRoleDelegate getUserRoleDelegate(); void setUserRoleDelegate( UserRoleDelegate userRoleDelegate ); PurRepository getRepository(); boolean supportsMetadata(); boolean supportsRevisions(); boolean supportsUsers(); void delUser( ObjectId id_user ); ObjectId getUserID( String login ); ObjectId[] getUserIDs(); IUser loadUserInfo( String login ); IUser loadUserInfo( String login, String password ); void renameUser( ObjectId id_user, String newname ); void saveUserInfo( IUser user ); @Override boolean validateUserInfo( IUser user ); @Override void normalizeUserInfo( IUser user ); void createRole( IRole newRole ); @Override boolean validateRoleInfo( IRole role ); @Override void normalizeRoleInfo( IRole role ); void deleteRoles( List<IRole> roles ); void deleteUsers( List<IUser> users ); IRole getRole( String name ); List<IRole> getRoles(); List<IRole> getDefaultRoles(); void updateRole( IRole role ); void updateUser( IUser user ); void delUser( String name ); void deleteRole( String name ); List<IUser> getUsers(); void setRoles( List<IRole> roles ); void setUsers( List<IUser> users ); IRole constructRole(); IUser constructUser(); void onChange(); static Log getLogger(); boolean isManaged();  }### Answer:
@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() ); }
@Test( expected = KettleException.class ) public void saveUserInfo_NormalizesInfo_FailsIfStillBreaches() throws Exception { UserInfo info = new UserInfo( " " ); manager.saveUserInfo( info ); }