Class UsersResourceTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.atlassian.crowd.acceptance.tests.rest.service.RestCrowdServiceAcceptanceTestCase
com.atlassian.crowd.acceptance.tests.rest.service.UsersResourceTest
All Implemented Interfaces:
junit.framework.Test

public class UsersResourceTest extends RestCrowdServiceAcceptanceTestCase
Tests UsersResource.

Note that this test class is reused in JIRA via inheritance. Please be mindful of that when making changes to this class.

  • Constructor Details

    • UsersResourceTest

      public UsersResourceTest(String name)
      Constructs a test case with the given name.
      Parameters:
      name - the test name
    • UsersResourceTest

      public UsersResourceTest(String name, RestServer restServer)
      Constructs a test case with the given name, using the given RestServer.
      Parameters:
      name - the test name
      restServer - the RestServer
  • Method Details

    • testGetUser

      public void testGetUser()
      Tests retrieving a valid user. Checks that all the user details are correct.
    • testGetUserByKey

      public void testGetUserByKey()
    • testGetUser_InvalidApplicationCredentials

      public void testGetUser_InvalidApplicationCredentials()
      Tests that attempting to access the UserResource with an InvalidPassword returns a 401 (Unauthorized) response.
    • testGetUser_NonExistent

      public void testGetUser_NonExistent()
      Tests that retrieving a non-existent user returns a 404 (Not Found) response.
    • testGetUserWithAttributes

      public void testGetUserWithAttributes()
      Tests retrieving a user with attributes.
    • testGetUserWithAttributesByKey

      public void testGetUserWithAttributesByKey()
    • testAddUser

      public void testAddUser() throws Exception
      Tests adding a new user.
      Throws:
      Exception
    • testAddUserWithAttributes

      public void testAddUserWithAttributes() throws Exception
      Tests adding a new user with attributes, and ensuring that they are stored correctly.
      Throws:
      Exception
    • testAddUser_NoPasswordProvided

      public void testAddUser_NoPasswordProvided()
      Tests that adding a user without providing a password will return a 400 (Bad Request) response.
    • testAddUser_AtlassianSecurityPasswordProvided

      public void testAddUser_AtlassianSecurityPasswordProvided()
    • testAddUser_UserAlreadyExists

      public void testAddUser_UserAlreadyExists() throws Exception
      Throws:
      Exception
    • testUpdateUser

      public void testUpdateUser()
      Tests that a user is successfully updated.
    • testUpdateUser_WrongUserUri

      public void testUpdateUser_WrongUserUri()
      Tests that sending an updated user with a wrong user URI (i.e. a URI for another user) will return a 400 (Bad Request) response.
    • testUpdateUserWithDifferentCaseInUrlIsAccepted

      public void testUpdateUserWithDifferentCaseInUrlIsAccepted()
    • testUpdateUserWithDifferentCaseInEntityIsAccepted

      public void testUpdateUserWithDifferentCaseInEntityIsAccepted()
    • testUpdateUserWithDifferentEntityNameShouldNotRenameUser

      public void testUpdateUserWithDifferentEntityNameShouldNotRenameUser()
    • testRenameUserShouldRenameUserWhenProvidedWithOldUsername

      public void testRenameUserShouldRenameUserWhenProvidedWithOldUsername()
    • testRenameUserShouldRenameUserWhenProvidedWithOldUsernameAndNewNameOfDifferentCase

      public void testRenameUserShouldRenameUserWhenProvidedWithOldUsernameAndNewNameOfDifferentCase()
    • testRenameUserShouldFailWhenUserWithProvidedUsernameDoesNotExist

      public void testRenameUserShouldFailWhenUserWithProvidedUsernameDoesNotExist()
    • testRenameUserShouldFailWhenNewUsernameIsAlreadyInUse

      public void testRenameUserShouldFailWhenNewUsernameIsAlreadyInUse()
    • testUpdateUserPassword

      public void testUpdateUserPassword()
      Tests updating a user password.
    • testDeleteUserPasswordRejectsOldPassword

      public void testDeleteUserPasswordRejectsOldPassword()
      Tests that deleting a user's password restricts the user from logging in with their old password.
    • testStoreUserAttributes

      public void testStoreUserAttributes()
      Test store user attributes.
    • testDeleteUserAttribute

      public void testDeleteUserAttribute()
      Tests deleting a user attribute.
    • testDeleteNonExistentUserAttributeSucceeds

      public void testDeleteNonExistentUserAttributeSucceeds()
    • testDeleteUser

      public void testDeleteUser()
      Tests deleting a user.
    • testExpireAllPasswords

      public void testExpireAllPasswords()
    • testAddUserToGroup

      public void testAddUserToGroup()
      Tests adding a user to a group.
    • testAddUserToGroup_NonExistentGroup

      public void testAddUserToGroup_NonExistentGroup()
      Tests that adding a user to a non-existent group returns a 400 (Bad Request) response.
    • testAddUserToGroup_NonExistentUser

      public void testAddUserToGroup_NonExistentUser()
      Tests that adding a non-existent user to a group returns a 404 (Not Found) response.
    • testAddUserToGroup_MembershipAlreadyExists

      public void testAddUserToGroup_MembershipAlreadyExists()
    • testRemoveUserFromGroup

      public void testRemoveUserFromGroup()
      Tests removing a user from a group.
    • testGetNestedGroup

      public void testGetNestedGroup()
      Tests retrieving a nested group membership.
    • testGetNestedGroups

      public void testGetNestedGroups()
      Tests getting the nested groups.
    • testGetNestedGroupReturns404WhenGroupDoesNotExist

      public void testGetNestedGroupReturns404WhenGroupDoesNotExist()
    • testGetNestedGroupReturns404WhenUserDoesNotExist

      public void testGetNestedGroupReturns404WhenUserDoesNotExist()
    • testGetNestedGroupReturns404WhenUserAndGroupDoNotExist

      public void testGetNestedGroupReturns404WhenUserAndGroupDoNotExist()
    • testGetNestedGroupsReturns404WhenUserDoesNotExist

      public void testGetNestedGroupsReturns404WhenUserDoesNotExist()
    • testGetDirectGroup

      public void testGetDirectGroup()
    • testGetDirectGroups

      public void testGetDirectGroups()
    • testGetDirectGroupReturns404WhenGroupDoesNotExist

      public void testGetDirectGroupReturns404WhenGroupDoesNotExist()
    • testGetDirectGroupReturns404WhenUserDoesNotExist

      public void testGetDirectGroupReturns404WhenUserDoesNotExist()
    • testGetDirectGroupReturns404WhenUserAndGroupDoNotExist

      public void testGetDirectGroupReturns404WhenUserAndGroupDoNotExist()
    • testGetDirectGroupsReturns404WhenUserDoesNotExist

      public void testGetDirectGroupsReturns404WhenUserDoesNotExist()
    • testGetDirectGroupsWithAttributes

      public void testGetDirectGroupsWithAttributes()
    • testRequestForAvatarForUnspecifiedUserIsNotFound

      public void testRequestForAvatarForUnspecifiedUserIsNotFound()