public class ApplicationResourceTest extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
APPLICATION_RESOURCE |
protected static long |
CROWD_APPLICATION_ID |
protected static String |
CROWD_APPLICATION_NAME |
RestTestFixture |
fixture |
protected static String |
REST_SERVICE_NAME |
protected static String |
USER_NAME |
protected static String |
USER_PASSWORD |
Constructor and Description |
---|
ApplicationResourceTest() |
Modifier and Type | Method and Description |
---|---|
protected long |
getApplicationId()
Returns the application ID.
|
protected 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.
|
RestServer |
getRestServer() |
protected com.sun.jersey.api.client.WebResource |
getRootWebResource(String userName,
String password)
Returns the "root" WebResource.
|
protected com.sun.jersey.api.client.WebResource |
getWebResource(String userName,
String password,
URI uri)
Returns the WebResource with the specified URI.
|
void |
setRestServer(RestServer restServer) |
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 |
testAddApplicationWithDuplicateNameProducesConflictResponseCode() |
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.
|
protected static final String USER_NAME
protected static final String USER_PASSWORD
protected static final String APPLICATION_RESOURCE
protected static final long CROWD_APPLICATION_ID
protected static final String CROWD_APPLICATION_NAME
protected static final String REST_SERVICE_NAME
public RestTestFixture fixture
protected long getApplicationId()
protected String getApplicationName()
protected ApplicationType getApplicationType()
protected javax.ws.rs.core.UriBuilder getBaseUriBuilder()
protected com.sun.jersey.api.client.WebResource getRootWebResource(String userName, String password)
userName
- name of the userpassword
- password of the userprotected com.sun.jersey.api.client.WebResource getWebResource(String userName, String password, URI uri)
userName
- name of the userpassword
- password of the useruri
- URI of the resourcepublic void testGetApplicationByName() throws Exception
Exception
public void testGetApplicationByName_NotFound() throws Exception
Exception
public void testGetApplicationById() throws Exception
Exception
public void testGetApplicationById_NotFound() throws Exception
Exception
public void testWrongPassword() throws Exception
Exception
public void testAddApplication() throws Exception
Exception
public void testAddApplication_NoPassword() throws Exception
Exception
public void testAddApplication_NoName() throws Exception
Exception
public void testAddApplication_NoType() throws Exception
Exception
public void testAddRemoteAddress() throws Exception
Exception
public void testAddApplicationWithRequestAddress()
public void testAddApplicationWithRequestAddress_WithProxy()
public void testAddApplicationWithDuplicateNameProducesConflictResponseCode() throws Exception
Exception
public RestServer getRestServer()
public void setRestServer(RestServer restServer)
Copyright © 2019 Atlassian. All rights reserved.