public abstract class RestCrowdServiceAcceptanceTestCase
extends junit.framework.TestCase
Modifier | Constructor and Description |
---|---|
protected |
RestCrowdServiceAcceptanceTestCase(String name)
Constructs a test case with the given name.
|
protected |
RestCrowdServiceAcceptanceTestCase(String name,
RestServer restServer)
Constructs a test case with the given name, using the given RestServer.
|
Modifier and Type | Method and Description |
---|---|
protected UserEntity |
authenticateUser(String username,
String password)
Authenticate a user with the specified username and password against the 'crowd' application.
|
protected UserEntity |
authenticateUser(String username,
String password,
String applicationName,
String applicationPassword)
Authenticate a user with the specified username and password.
|
protected void |
deactivateUser(String username) |
protected javax.ws.rs.core.UriBuilder |
getBaseUriBuilder()
Returns the base URI of the REST service.
|
protected javax.ws.rs.core.UriBuilder |
getBaseUriBuilder(String serviceName) |
protected javax.ws.rs.core.UriBuilder |
getBaseUriBuilder(String serviceName,
String version) |
protected com.sun.jersey.api.client.WebResource |
getRootWebResource(String applicationName,
String password)
Returns the "root" WebResource.
|
protected javax.ws.rs.core.UriBuilder |
getServerUriBuilder() |
protected com.sun.jersey.api.client.WebResource |
getWebResource(String applicationName,
String password,
URI uri)
Returns the WebResource with the specified URI.
|
protected com.sun.jersey.api.client.WebResource |
getWebResource(URI uri)
Returns the WebResource with the specified URI, retrieved anonymously.
|
protected EventEntityList |
requestEvents(String eventToken) |
String |
requestEventToken() |
void |
setRestServer(RestServer restServer)
Sets the RestServer instance to test against.
|
void |
setUp() |
protected void |
tearDown() |
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
protected static final String APPLICATION_NAME
protected static final String APPLICATION_PASSWORD
protected static final String GROUPS_RESOURCE
protected static final String ATTRIBUTES_RESOURCE
protected static final String USERS_RESOURCE
protected static final String AUTHENTICATION_RESOURCE
protected static final String SESSION_RESOURCE
protected static final String WEBHOOKS_RESOURCE
protected static final String EVENTS_RESOURCE
protected static final javax.ws.rs.core.MediaType MT
protected static final String REST_SERVICE_NAME
protected static final String USERNAME_PARAM
public static final String ADMIN_USERNAME
public static final String ADMIN_PASSWORD
public static final String EEEEP_USERNAME
public static final String EEEEP_PASSWORD
public static final String PENNY_USERNAME
public static final String NON_EXISTENT_USER
public static final String NON_ADMIN_USER_NAME
public static final String NON_ADMIN_USER_PASSWORD
public static final String NON_CROWD_USER_USERNAME
public static final String NON_CROWD_USER_PASSWORD
public static final String SECOND_ADMIN_USERNAME
public static final String SECOND_ADMIN_PASSWORD
public static final String GROUP_BADGERS
public static final String GROUP_BADGERS_DESCRIPTION
public static final String GROUP_CROWD_ADMINS
public static final String GROUP_CROWD_TESTERS
public static final String GROUP_CROWD_USERS
public static final String NON_EXISTENT_GROUP
protected RestServer restServer
protected RestCrowdServiceAcceptanceTestCase(String name)
name
- the test nameprotected RestCrowdServiceAcceptanceTestCase(String name, RestServer restServer)
name
- the test namerestServer
- the RestServerpublic void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
protected void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
public final void setRestServer(RestServer restServer)
restServer
- a RestServerprotected javax.ws.rs.core.UriBuilder getBaseUriBuilder()
protected javax.ws.rs.core.UriBuilder getBaseUriBuilder(String serviceName)
protected javax.ws.rs.core.UriBuilder getBaseUriBuilder(String serviceName, String version)
protected javax.ws.rs.core.UriBuilder getServerUriBuilder()
protected com.sun.jersey.api.client.WebResource getRootWebResource(String applicationName, String password)
applicationName
- name of the applicationpassword
- password of the applicationprotected com.sun.jersey.api.client.WebResource getWebResource(String applicationName, String password, URI uri)
applicationName
- name of the applicationpassword
- password of the applicationuri
- URI of the resourceprotected com.sun.jersey.api.client.WebResource getWebResource(URI uri)
protected UserEntity authenticateUser(String username, String password)
username
- usernamepassword
- passwordcom.sun.jersey.api.client.UniformInterfaceException
- if the status of the HTTP response is greater than or equal to 300.protected UserEntity authenticateUser(String username, String password, String applicationName, String applicationPassword)
username
- usernamepassword
- passwordapplicationName
- The application to authenticate against.applicationPassword
- The password for the application.com.sun.jersey.api.client.UniformInterfaceException
- if the status of the HTTP response is greater than or equal to 300.protected void deactivateUser(String username)
public String requestEventToken()
protected EventEntityList requestEvents(String eventToken)
Copyright © 2020 Atlassian. All rights reserved.