Class ApplicationResourceTest

java.lang.Object
com.atlassian.crowd.acceptance.tests.rest.service.ApplicationResourceTest

public class ApplicationResourceTest extends Object
Tests for the Application resource
Since:
2.2
  • Field Details

  • Constructor Details

    • ApplicationResourceTest

      public ApplicationResourceTest()
  • Method Details

    • getApplicationId

      protected long getApplicationId()
      Returns the application ID.
      Returns:
      application ID
    • getApplicationName

      protected String getApplicationName()
      Returns the application name.
      Returns:
      application name
    • getApplicationType

      protected ApplicationType getApplicationType()
      Returns the application type.
      Returns:
      application type
    • getBaseUriBuilder

      protected javax.ws.rs.core.UriBuilder getBaseUriBuilder()
      Returns the base URI of the REST service.
      Returns:
      UriBuilder
    • getRootWebTarget

      protected javax.ws.rs.client.WebTarget getRootWebTarget(String userName, String password)
      Returns the "root" WebResource. This is the resource that's at the / of the crowd-rest-plugin plugin namespace.
      Parameters:
      userName - name of the user
      password - password of the user
      Returns:
      root WebResource
    • getWebTarget

      protected javax.ws.rs.client.WebTarget getWebTarget(String userName, String password, URI uri)
      Returns the WebResource with the specified URI.
      Parameters:
      userName - name of the user
      password - password of the user
      uri - URI of the resource
      Returns:
      WebResource
    • testGetApplicationByName

      public void testGetApplicationByName() throws Exception
      Tests that the REST service allows an application to be retrieved by name
      Throws:
      Exception
    • testGetApplicationByName_NotFound

      public void testGetApplicationByName_NotFound() throws Exception
      Tests that retrieving a non-existent application by name will return a 404 (Not Found) response with a reason of Application Not Found.
      Throws:
      Exception
    • testGetApplicationById

      public void testGetApplicationById() throws Exception
      Tests that the REST service allows an application to be retrieved by ID
      Throws:
      Exception
    • testGetApplicationById_NotFound

      public void testGetApplicationById_NotFound() throws Exception
      Tests that retrieving a non-existent application by ID will return a 404 (Not Found) response with a reason of Application Not Found.
      Throws:
      Exception
    • testWrongPassword

      public void testWrongPassword() throws Exception
      Tests that the REST service does not allow a user to access the Application Management API if an incorrect user password has been given.
      Throws:
      Exception
    • testAddApplication

      public void testAddApplication() throws Exception
      Tests that adding an application is successful.
      Throws:
      Exception
    • testAddApplication_NoPassword

      public void testAddApplication_NoPassword() throws Exception
      Tests that adding an application with no password will fail with a 400 (Bad Request) with a reason of Invalid Credential.
      Throws:
      Exception
    • testAddApplication_NoName

      public void testAddApplication_NoName() throws Exception
      Tests that adding an application with no name will fail with a 400 (Bad Request) with a reason of Illegal Argument.
      Throws:
      Exception
    • testAddApplication_NoType

      public void testAddApplication_NoType() throws Exception
      Tests that adding an application with no type will fail with a 400 (Bad Request) with a reason of Illegal Argument.
      Throws:
      Exception
    • testAddRemoteAddress

      public void testAddRemoteAddress() throws Exception
      Tests that adding a remote address is successful.
      Throws:
      Exception
    • testAddApplicationWithRequestAddress

      public void testAddApplicationWithRequestAddress()
      Tests adding an application with the request address included. Checks that the application is able to connect to the Crowd REST service after adding the application.
    • testAddApplicationWithRequestAddress_WithProxy

      public void testAddApplicationWithRequestAddress_WithProxy()
      Tests adding an application with the request address included, and simulating a proxy being involved (i.e. the X-Forwarded-For header set). Checks that the application is able to connect to the Crowd REST service after adding the application.
    • testAddApplicationWithDuplicateNameProducesConflictResponseCode

      public void testAddApplicationWithDuplicateNameProducesConflictResponseCode() throws Exception
      Throws:
      Exception
    • shouldUpdateExistingApplication

      public void shouldUpdateExistingApplication()
    • shouldNotUpdateWhenAppEntityLacksId

      public void shouldNotUpdateWhenAppEntityLacksId()
    • getRestServer

      public RestServer getRestServer()
    • setRestServer

      public void setRestServer(RestServer restServer)