|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.acceptance.tests.rest.service.ApplicationResourceTest
public class ApplicationResourceTest
Tests for the Application resource
| Field Summary | |
|---|---|
protected static java.lang.String |
APPLICATION_RESOURCE
|
protected static long |
CROWD_APPLICATION_ID
|
protected static java.lang.String |
CROWD_APPLICATION_NAME
|
protected static java.lang.String |
REST_SERVICE_NAME
|
protected static java.lang.String |
USER_NAME
|
protected static java.lang.String |
USER_PASSWORD
|
| Constructor Summary | |
|---|---|
ApplicationResourceTest()
|
|
| Method Summary | |
|---|---|
protected long |
getApplicationId()
Returns the application ID. |
protected java.lang.String |
getApplicationName()
Returns the application name. |
protected ApplicationType |
getApplicationType()
Returns the application type. |
protected javax.ws.rs.core.UriBuilder |
getBaseUriBuilder()
Returns the base URI of the REST service. |
protected com.sun.jersey.api.client.WebResource |
getRootWebResource(java.lang.String userName,
java.lang.String password)
Returns the "root" WebResource. |
protected com.sun.jersey.api.client.WebResource |
getWebResource(java.lang.String userName,
java.lang.String password,
java.net.URI uri)
Returns the WebResource with the specified URI. |
void |
setUp()
|
void |
tearDown()
|
void |
testAddApplication_NoName()
Tests that adding an application with no name will fail with a 400 (Bad Request) with a reason of Illegal Argument. |
void |
testAddApplication_NoPassword()
Tests that adding an application with no password will fail with a 400 (Bad Request) with a reason of Invalid Credential. |
void |
testAddApplication_NoType()
Tests that adding an application with no type will fail with a 400 (Bad Request) with a reason of Illegal Argument. |
void |
testAddApplication()
Tests that adding an application is successful. |
void |
testAddApplicationWithRequestAddress_WithProxy()
Tests adding an application with the request address included, and simulating a proxy being involved (i.e. |
void |
testAddApplicationWithRequestAddress()
Tests adding an application with the request address included. |
void |
testAddRemoteAddress()
Tests that adding a remote address is successful. |
void |
testGetApplicationById_NotFound()
Tests that retrieving a non-existent application by ID will return a 404 (Not Found) response with a reason of Application Not Found. |
void |
testGetApplicationById()
Tests that the REST service allows an application to be retrieved by ID |
void |
testGetApplicationByName_NotFound()
Tests that retrieving a non-existent application by name will return a 404 (Not Found) response with a reason of Application Not Found. |
void |
testGetApplicationByName()
Tests that the REST service allows an application to be retrieved by name |
void |
testWrongPassword()
Tests that the REST service does not allow a user to access the Application Management API if an incorrect user password has been given. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String USER_NAME
protected static final java.lang.String USER_PASSWORD
protected static final java.lang.String APPLICATION_RESOURCE
protected static final long CROWD_APPLICATION_ID
protected static final java.lang.String CROWD_APPLICATION_NAME
protected static final java.lang.String REST_SERVICE_NAME
| Constructor Detail |
|---|
public ApplicationResourceTest()
| Method Detail |
|---|
public void setUp()
throws java.lang.Exception
java.lang.Exception
public void tearDown()
throws java.lang.Exception
java.lang.Exceptionprotected long getApplicationId()
protected java.lang.String getApplicationName()
protected ApplicationType getApplicationType()
protected javax.ws.rs.core.UriBuilder getBaseUriBuilder()
protected com.sun.jersey.api.client.WebResource getRootWebResource(java.lang.String userName,
java.lang.String password)
userName - name of the userpassword - password of the user
protected com.sun.jersey.api.client.WebResource getWebResource(java.lang.String userName,
java.lang.String password,
java.net.URI uri)
userName - name of the userpassword - password of the useruri - URI of the resource
public void testGetApplicationByName()
throws java.lang.Exception
java.lang.Exception
public void testGetApplicationByName_NotFound()
throws java.lang.Exception
java.lang.Exception
public void testGetApplicationById()
throws java.lang.Exception
java.lang.Exception
public void testGetApplicationById_NotFound()
throws java.lang.Exception
java.lang.Exception
public void testWrongPassword()
throws java.lang.Exception
java.lang.Exception
public void testAddApplication()
throws java.lang.Exception
java.lang.Exception
public void testAddApplication_NoPassword()
throws java.lang.Exception
java.lang.Exception
public void testAddApplication_NoName()
throws java.lang.Exception
java.lang.Exception
public void testAddApplication_NoType()
throws java.lang.Exception
java.lang.Exception
public void testAddRemoteAddress()
throws java.lang.Exception
java.lang.Exceptionpublic void testAddApplicationWithRequestAddress()
public void testAddApplicationWithRequestAddress_WithProxy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||