Class AuthenticationResourceTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.atlassian.crowd.acceptance.tests.rest.service.RestCrowdServiceAcceptanceTestCase
com.atlassian.crowd.acceptance.tests.rest.service.AuthenticationResourceTest
- All Implemented Interfaces:
junit.framework.Test
Note that this test class is reused in JIRA via inheritance. Please be mindful of that when making changes to this
class.
-
Field Summary
Fields inherited from class com.atlassian.crowd.acceptance.tests.rest.service.RestCrowdServiceAcceptanceTestCase
ADMIN_PASSWORD, ADMIN_USERNAME, APPLICATION_NAME, APPLICATION_PASSWORD, ATTRIBUTES_RESOURCE, AUTHENTICATION_RESOURCE, EEEEP_PASSWORD, EEEEP_USERNAME, EVENTS_RESOURCE, GROUP_BADGERS, GROUP_BADGERS_DESCRIPTION, GROUP_CROWD_ADMINS, GROUP_CROWD_TESTERS, GROUP_CROWD_USERS, GROUPS_RESOURCE, MT, NON_ADMIN_USER_NAME, NON_ADMIN_USER_PASSWORD, NON_CROWD_USER_PASSWORD, NON_CROWD_USER_USERNAME, NON_EXISTENT_GROUP, NON_EXISTENT_USER, PENNY_USERNAME, REST_SERVICE_NAME, restServer, SECOND_ADMIN_PASSWORD, SECOND_ADMIN_USERNAME, SESSION_RESOURCE, USERNAME_PARAM, USERS_RESOURCE, WEBHOOKS_RESOURCE
-
Constructor Summary
ConstructorDescriptionConstructs a test case with the given name.AuthenticationResourceTest
(String name, RestServer restServer) Constructs a test case with the given name, using the given RestServer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
Tests that the Authentication resource correctly authenticates a valid user.void
Tests that the Authentication resource will successfully authenticate a user that is not explicitly in an authorised group of the application but is in a directory where all the users are allowed to authenticate with the application.void
Tests that the Authentication resource will return a 400 (Bad Request) status if the user authentication details are incorrect.void
Tests that the Authentication resource will only authenticate the first user that it finds with the specified username.void
Tests that the Authentication resource will return a 400 (Bad Request) status if the user is inactive.void
Tests that the Authentication resource will successfully authenticate a nested user.void
Tests that the Authentication resource will return a 400 (Bad Request) status if there is no such user.void
Tests that the Authentication resource will return a 400 (Bad Request) status if the authentication for the user is correct but the user is not a member of an authorised group of the application.Methods inherited from class com.atlassian.crowd.acceptance.tests.rest.service.RestCrowdServiceAcceptanceTestCase
authenticateUser, authenticateUser, deactivateUser, getBaseUriBuilder, getBaseUriBuilder, getBaseUriBuilder, getRootWebTarget, getServerUriBuilder, getWebTarget, getWebTarget, requestEvents, requestEventToken, setRestServer, setUp, tearDown
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
-
Constructor Details
-
AuthenticationResourceTest
Constructs a test case with the given name.- Parameters:
name
- the test name
-
AuthenticationResourceTest
Constructs a test case with the given name, using the given RestServer.- Parameters:
name
- the test namerestServer
- the RestServer
-
-
Method Details
-
testUserAuthentication
public void testUserAuthentication()Tests that the Authentication resource correctly authenticates a valid user. -
testUserAuthentication_BadCredentials
public void testUserAuthentication_BadCredentials()Tests that the Authentication resource will return a 400 (Bad Request) status if the user authentication details are incorrect. -
testUserAuthentication_InactiveUser
public void testUserAuthentication_InactiveUser()Tests that the Authentication resource will return a 400 (Bad Request) status if the user is inactive. -
testUserAuthentication_NoUser
public void testUserAuthentication_NoUser()Tests that the Authentication resource will return a 400 (Bad Request) status if there is no such user. -
testUserAuthentication_UnauthorisedGroupUser
public void testUserAuthentication_UnauthorisedGroupUser()Tests that the Authentication resource will return a 400 (Bad Request) status if the authentication for the user is correct but the user is not a member of an authorised group of the application. -
testUserAuthentication_AllowAllToAuthenticate
public void testUserAuthentication_AllowAllToAuthenticate()Tests that the Authentication resource will successfully authenticate a user that is not explicitly in an authorised group of the application but is in a directory where all the users are allowed to authenticate with the application. -
testUserAuthentication_CommonUserUnauthorised
public void testUserAuthentication_CommonUserUnauthorised()Tests that the Authentication resource will only authenticate the first user that it finds with the specified username. i.e. even though there is another user in the second directory with a matching username and password, it will only use the credentials of the first user. -
testUserAuthentication_NestedUser
public void testUserAuthentication_NestedUser()Tests that the Authentication resource will successfully authenticate a nested user. -
testAuthenticationNotify_shouldProcessDefaultGroups
public void testAuthenticationNotify_shouldProcessDefaultGroups() -
testAuthenticationNotify_shouldErrorIfNotAllowedToLogin
public void testAuthenticationNotify_shouldErrorIfNotAllowedToLogin() -
testAuthenticationNotify_shouldRequireAuth
public void testAuthenticationNotify_shouldRequireAuth()
-