### Question:
PurRepositorySecurityManager implements IRoleSupportSecurityManager, IUserRoleListChangeListener,
    java.io.Serializable, RepositorySecurityUserValidator, RepositorySecurityRoleValidator { public void createRole( IRole newRole ) throws KettleException { normalizeRoleInfo( newRole ); if ( !validateRoleInfo( newRole ) ) { throw new KettleException( BaseMessages.getString( PurRepositorySecurityManager.class, "PurRepositorySecurityManager.ERROR_0001_INVALID_NAME" ) ); } userRoleDelegate.createRole( newRole ); } 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 createRole_NormalizesInfo_PassesIfNoViolations() throws Exception { IRole info = new EERoleInfo( "role ", "" ); ArgumentCaptor<IRole> captor = ArgumentCaptor.forClass( IRole.class ); manager.createRole( info ); verify( roleDelegate ).createRole( captor.capture() ); info = captor.getValue(); assertEquals( "Spaces should be trimmed", "role", info.getName() ); }
@Test( expected = KettleException.class ) public void createRole_NormalizesInfo_FailsIfStillBreaches() throws Exception { IRole info = new EERoleInfo( " ", "" ); manager.createRole( info ); }