com.atlassian.jira.functest.framework.backdoor
Class UsersAndGroupsControl

java.lang.Object
  extended by com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient<T>
      extended by com.atlassian.jira.functest.framework.backdoor.BackdoorControl<UsersAndGroupsControl>
          extended by com.atlassian.jira.functest.framework.backdoor.UsersAndGroupsControl
All Implemented Interfaces:
FuncTestLogger

public class UsersAndGroupsControl
extends BackdoorControl<UsersAndGroupsControl>

Use this class from func/selenium/page-object tests that need to manipulate Users and Groups. Replaces many uses of UsersAndGroups. See com.atlassian.jira.dev.backdoor.UsersAndGroupsBackdoor in jira-func-test-plugin for backend.

Since:
v5.0

Nested Class Summary
 
Nested classes/interfaces inherited from class com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient
com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient.Method
 
Field Summary
 
Fields inherited from class com.atlassian.jira.functest.framework.backdoor.BackdoorControl
restPathRootLength
 
Fields inherited from class com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient
REST_VERSION
 
Constructor Summary
UsersAndGroupsControl(com.atlassian.jira.webtests.util.JIRAEnvironmentData environmentData)
           
 
Method Summary
 void addGroup(String groupName)
           
 void addUser(String username)
           
 void addUser(String username, String password, String displayName, String email)
           
 void addUser(String username, String password, String displayName, String email, boolean sendEmail)
           
 void addUsers(String usernamePrefix, String displayNamePrefix, int numberOfNewUsers)
          Makes a lot of new users, fast, and adds them to jira-users.
 void addUsersWithGroup(String usernamePrefix, String displayNamePrefix, int numberOfNewUsers, String groupName)
          Makes a lot of new users, fast, and adds them to the group specified (as well as jira-users).
 void addUserToGroup(String username, String groupName)
           
protected  com.sun.jersey.api.client.WebResource createResource()
          Creates the resource that corresponds to the root of the func-test REST API.
 void deleteUser(String username)
           
 void removeUserFromGroup(String username, String groupName)
           
 
Methods inherited from class com.atlassian.jira.functest.framework.backdoor.BackdoorControl
get, get, get, getId, log, log, post
 
Methods inherited from class com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient
anonymous, errorResponse, expanded, loginAs, loginAs, percentEncode, resourceRoot, setOf, toResponse, toResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsersAndGroupsControl

public UsersAndGroupsControl(com.atlassian.jira.webtests.util.JIRAEnvironmentData environmentData)
Method Detail

addUser

public void addUser(String username)

addUser

public void addUser(String username,
                    String password,
                    String displayName,
                    String email)

addUser

public void addUser(String username,
                    String password,
                    String displayName,
                    String email,
                    boolean sendEmail)

addUsers

public void addUsers(String usernamePrefix,
                     String displayNamePrefix,
                     int numberOfNewUsers)
Makes a lot of new users, fast, and adds them to jira-users. The created user will have a password matching their username and their email address will be: {usernamePrefix} + index + "@example.com"

Parameters:
usernamePrefix - prefix before each new username, e.g. "testuser" becomes "testuser0"
displayNamePrefix - prefix before each new username, e.g. "Test User " becomes "Test User 0"
numberOfNewUsers - number of users to add

addUsersWithGroup

public void addUsersWithGroup(String usernamePrefix,
                              String displayNamePrefix,
                              int numberOfNewUsers,
                              String groupName)
Makes a lot of new users, fast, and adds them to the group specified (as well as jira-users). The created user will have a password matching their username and their email address will be: {usernamePrefix} + index + "@example.com"

Parameters:
usernamePrefix - prefix before each new username, e.g. "testuser" becomes "testuser0"
displayNamePrefix - prefix before each new username, e.g. "Test User " becomes "Test User 0"
numberOfNewUsers - number of users to add
groupName - name of group to add all users to

deleteUser

public void deleteUser(String username)

addUserToGroup

public void addUserToGroup(String username,
                           String groupName)

removeUserFromGroup

public void removeUserFromGroup(String username,
                                String groupName)

addGroup

public void addGroup(String groupName)

createResource

protected com.sun.jersey.api.client.WebResource createResource()
Description copied from class: BackdoorControl
Creates the resource that corresponds to the root of the func-test REST API.

Overrides:
createResource in class BackdoorControl<UsersAndGroupsControl>
Returns:
a WebResource for the REST API root


Copyright © 2002-2012 Atlassian. All Rights Reserved.