### Question:
UserRoleDelegate implements java.io.Serializable { public void createRole( IRole newRole ) throws KettleException { ensureHasPermissions(); ProxyPentahoRole role = UserRoleHelper.convertToPentahoProxyRole( newRole ); try { ProxyPentahoRole[] existingRoles = userRoleWebService.getRoles(); if ( existsAmong( existingRoles, role ) ) { throw roleExistsException(); } } catch ( UserRoleException e ) { throw cannotCreateRoleException( newRole, e ); } try { userRoleWebService.createRole( role ); userRoleWebService.setUsers( role, UserRoleHelper.convertToPentahoProxyUsers( newRole.getUsers() ) ); lookupCache.insertRoleToLookupSet( newRole ); fireUserRoleListChange(); } catch ( UserRoleException e ) { throw cannotCreateRoleException( newRole, e ); } catch ( Exception e ) { if ( e.getCause().toString().contains( "org.pentaho.platform.api.engine.security.userroledao.AlreadyExistsException" ) ) { throw roleExistsException(); } } } UserRoleDelegate( IRoleSupportSecurityManager rsm, PurRepositoryMeta repositoryMeta, IUser userInfo,
      Log logger, ServiceManager serviceManager );   UserRoleDelegate( Log logger, IUserRoleListWebService userDetailsRoleListWebService,
      IUserRoleWebService userRoleWebService ); void updateUserRoleInfo(); boolean isManaged(); void createUser( IUser newUser ); void deleteUsers( List<IUser> users ); void deleteUser( String name ); void setUsers( List<IUser> users ); IUser getUser( String name, String password ); IUser getUser( String name ); List<IUser> getUsers(); void updateUser( IUser user ); void createRole( IRole newRole ); void deleteRoles( List<IRole> roles ); IRole getRole( String name ); List<IRole> getRoles(); List<IRole> getDefaultRoles(); void updateRole( IRole role ); void deleteRole( String name ); void setRoles( List<IRole> roles ); void addUserRoleListChangeListener( IUserRoleListChangeListener listener ); void removeUserRoleListChangeListener( IUserRoleListChangeListener listener );  }### Answer:
@Test public void createRole_CreatesSuccessfully_WhenNameIsUnique() throws Exception { final String name = "role"; delegate.createRole( new EERoleInfo( name ) ); verify( roleWebService ).createRole( any( ProxyPentahoRole.class ) ); }