### Question:
UserRoleDelegate implements java.io.Serializable { public void createUser( IUser newUser ) throws KettleException { ensureHasPermissions(); ProxyPentahoUser user = UserRoleHelper.convertToPentahoProxyUser( newUser ); try { ProxyPentahoUser[] existingUsers = userRoleWebService.getUsers(); if ( existsAmong( existingUsers, user ) ) { throw userExistsException(); } } catch ( UserRoleException e ) { throw cannotCreateUserException( newUser, e ); } try { userRoleWebService.createUser( user ); if ( newUser instanceof IEEUser ) { userRoleWebService .setRoles( user, UserRoleHelper.convertToPentahoProxyRoles( ( (IEEUser) newUser ).getRoles() ) ); } lookupCache.insertUserToLookupSet( newUser ); fireUserRoleListChange(); } catch ( Exception e ) { if ( e.getCause().toString().contains( "org.pentaho.platform.api.engine.security.userroledao.AlreadyExistsException" ) ) { throw userExistsException(); } throw cannotCreateUserException( newUser, e ); } } 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 createUser_CreatesSuccessfully_WhenNameIsUnique() throws Exception { final String name = "user"; delegate.createUser( new UserInfo( name ) ); verify( roleWebService ).createUser( any( ProxyPentahoUser.class ) ); }