com.atlassian.jira.functest.rules
Class RestRule
java.lang.Object
org.junit.rules.ExternalResource
com.atlassian.jira.functest.rules.RestRule
- All Implemented Interfaces:
- org.junit.rules.TestRule
public class RestRule
- extends org.junit.rules.ExternalResource
Rule for using REST.
- Since:
- v4.2
Methods inherited from class org.junit.rules.ExternalResource |
apply |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RestRule
public RestRule(FuncTestCase testCase)
getBaseUrl
public String getBaseUrl()
getBaseUrlPlus
public String getBaseUrlPlus(String... paths)
getBaseUrlPlus
public String getBaseUrlPlus(Iterable<String> paths)
getBaseUriPlus
public URI getBaseUriPlus(Iterable<String> paths)
getBaseUriPlus
public URI getBaseUriPlus(String... paths)
getRestApiUrl
public String getRestApiUrl(String... paths)
getRestApiUri
public URI getRestApiUri(String... paths)
getRestApiUri
public URI getRestApiUri(Iterable<String> paths)
getJSON
public JSONObject getJSON(String url,
String... expand)
throws JSONException
- Throws:
JSONException
GET
public com.meterware.httpunit.WebResponse GET(String url)
throws IOException,
SAXException
- Throws:
IOException
SAXException
GET
public com.meterware.httpunit.WebResponse GET(String url,
Map<String,String> headers)
throws IOException,
SAXException
- Throws:
IOException
SAXException
DELETE
public com.meterware.httpunit.WebResponse DELETE(String url)
throws IOException,
SAXException
- Throws:
IOException
SAXException
POST
public com.meterware.httpunit.WebResponse POST(String url,
JSONObject json)
throws IOException,
SAXException
- Throws:
IOException
SAXException
POST
public com.meterware.httpunit.WebResponse POST(String url,
String postBody)
throws IOException,
SAXException
- Throws:
IOException
SAXException
PUT
public com.meterware.httpunit.WebResponse PUT(String url,
JSONObject json)
throws IOException,
SAXException
- Throws:
IOException
SAXException
PUT
public com.meterware.httpunit.WebResponse PUT(String url,
String postBody)
throws IOException,
SAXException
- Throws:
IOException
SAXException
before
public void before()
- Overrides:
before
in class org.junit.rules.ExternalResource
after
public void after()
- Overrides:
after
in class org.junit.rules.ExternalResource
Copyright © 2002-2014 Atlassian. All Rights Reserved.