|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.bamboo.testutils.backdoor.BackdoorControl<T>
public class BackdoorControl<T extends BackdoorControl<T>>
Copied from jira-testkit-client
Nested Class Summary | |
---|---|
protected static class |
BackdoorControl.JsonMediaTypeFilter
Sets the Content-Type header to "" if not already set. |
Field Summary | |
---|---|
static String |
ADMIN_REST_PATH
|
static String |
API_REST_PATH
|
static String |
DEFAULT_REST_PATH
The default REST path for the TestKit resources. |
protected String |
rootPath
Base URL. |
Constructor Summary | |
---|---|
BackdoorControl(BambooEnvironmentData environmentData)
|
Method Summary | |
---|---|
protected com.sun.jersey.api.client.Client |
client()
Returns the Jersey client to use. |
protected com.sun.jersey.api.client.WebResource |
createResource()
Creates the resource that corresponds to the root of the TestKit REST API, using the values returned by getRestModulePath() . |
protected com.sun.jersey.api.client.WebResource |
createResource(TestUser user)
|
protected com.sun.jersey.api.client.WebResource |
createResourceForPath(String restModulePath,
String restModuleVersion,
TestUser user)
Creates the resource that corresponds to the root of a REST API. |
protected com.sun.jersey.api.client.WebResource |
createResourceForPath(String restModulePath,
TestUser user)
Creates the resource that corresponds to the root of a REST API. |
protected String |
get(com.sun.jersey.api.client.WebResource webResource)
Convenience method that simply calls WebResource.get(String.class) on the passed-in WebResource. |
protected BambooEnvironmentData |
getEnvironmentData()
|
protected String |
getRestModulePath()
Returns the REST path used in this plugin's atlassian-plugin.xml (e.g. |
protected static String |
percentEncode(String queryParam)
Percent-encode the % when stuffing it into a query param. |
PingResponse |
ping()
|
protected com.sun.jersey.api.client.WebResource |
resourceRoot(String url)
Creates a WebResource for the given URL. |
protected com.sun.jersey.api.client.WebResource |
resourceRoot(String url,
TestUser user)
Creates a WebResource for the given URL. |
void |
tearDown()
Cleanup resources |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_REST_PATH
public static final String API_REST_PATH
public static final String ADMIN_REST_PATH
protected final String rootPath
Constructor Detail |
---|
public BackdoorControl(@NotNull BambooEnvironmentData environmentData)
Method Detail |
---|
public PingResponse ping()
public void tearDown()
protected com.sun.jersey.api.client.Client client()
protected com.sun.jersey.api.client.WebResource resourceRoot(String url)
url
- a String containing a URL
protected com.sun.jersey.api.client.WebResource resourceRoot(String url, TestUser user)
url
- a String containing a URL
protected com.sun.jersey.api.client.WebResource createResource()
getRestModulePath()
. Note that the created WebResource
has the following properties: Content-Type: application/json
by
default (override with WebResource.type(javax.ws.rs.core.MediaType)
)createResource()
createResource()
,
getRestModulePath()
protected com.sun.jersey.api.client.WebResource createResource(TestUser user)
protected final com.sun.jersey.api.client.WebResource createResourceForPath(String restModulePath, TestUser user)
WebResource
has
the following properties: Content-Type: application/json
by default (override with WebResource.type(javax.ws.rs.core.MediaType)
)
restModulePath
- a String containing the REST path
getRestModulePath()
protected final com.sun.jersey.api.client.WebResource createResourceForPath(String restModulePath, String restModuleVersion, TestUser user)
WebResource
has
the following properties: Content-Type: application/json
by default (override with WebResource.type(javax.ws.rs.core.MediaType)
)
restModulePath
- a String containing the REST pathrestModuleVersion
- a String containing the REST module version
getRestModulePath()
protected String getRestModulePath()
atlassian-plugin.xml
(e.g. <rest path="...">
).
The default value is ""backdoor"".
atlassian-plugin.xml
(e.g. <rest path="...">
).protected final String get(com.sun.jersey.api.client.WebResource webResource)
WebResource.get(String.class)
on the passed-in WebResource.
This method is often used for mutative operations which should really be using a POST instead, but doing
a GET is much more convenient since you can do it right from your browser when testing a backdoor and this is
only testing code so it's OK.
webResource
- the WebResource to perform the GET onprotected static String percentEncode(String queryParam)
queryParam
- the query param value
protected BambooEnvironmentData getEnvironmentData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |