com.atlassian.crowd.acceptance.tests.rest.service
Class AuthenticationResourceTest

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

public class AuthenticationResourceTest
extends RestCrowdServiceAcceptanceTestCase

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
APPLICATION_NAME, APPLICATION_PASSWORD, ATTRIBUTES_RESOURCE, AUTHENTICATION_RESOURCE, GROUPS_RESOURCE, REST_SERVICE_NAME, SESSION_RESOURCE, USERS_RESOURCE
 
Constructor Summary
AuthenticationResourceTest(String name)
          Constructs 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
 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.
 void testUserAuthentication_BadCredentials()
          Tests that the Authentication resource will return a 400 (Bad Request) status if the user authentication details are incorrect.
 void testUserAuthentication_CommonUserUnauthorised()
          Tests that the Authentication resource will only authenticate the first user that it finds with the specified username.
 void testUserAuthentication_NestedUser()
          Tests that the Authentication resource will successfully authenticate a nested user.
 void testUserAuthentication_NoUser()
          Tests that the Authentication resource will return a 400 (Bad Request) status if there is no such user.
 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.
 void testUserAuthentication()
          Tests that the Authentication resource correctly authenticates a valid user.
 
Methods inherited from class com.atlassian.crowd.acceptance.tests.rest.service.RestCrowdServiceAcceptanceTestCase
authenticateUser, getBaseUriBuilder, getRootWebResource, getWebResource, setRestServer, setUp, statusToString, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
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, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuthenticationResourceTest

public AuthenticationResourceTest(String name)
Constructs a test case with the given name.

Parameters:
name - the test name

AuthenticationResourceTest

public AuthenticationResourceTest(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 Detail

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_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.



Copyright © 2012 Atlassian. All Rights Reserved.