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 );
  }
@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() );
  }