com.atlassian.jira.functest.rules
Class RestRule

java.lang.Object
  extended by org.junit.rules.ExternalResource
      extended by 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

Constructor Summary
RestRule(FuncTestCase testCase)
           
 
Method Summary
 void after()
           
 void before()
           
 com.meterware.httpunit.WebResponse DELETE(String url)
           
 com.meterware.httpunit.WebResponse GET(String url)
           
 com.meterware.httpunit.WebResponse GET(String url, Map<String,String> headers)
           
 URI getBaseUriPlus(Iterable<String> paths)
           
 URI getBaseUriPlus(String... paths)
           
 String getBaseUrl()
           
 String getBaseUrlPlus(Iterable<String> paths)
           
 String getBaseUrlPlus(String... paths)
           
 JSONObject getJSON(String url, String... expand)
           
 URI getRestApiUri(Iterable<String> paths)
           
 URI getRestApiUri(String... paths)
           
 String getRestApiUrl(String... paths)
           
 com.meterware.httpunit.WebResponse POST(String url, JSONObject json)
           
 com.meterware.httpunit.WebResponse POST(String url, String postBody)
           
 com.meterware.httpunit.WebResponse PUT(String url, JSONObject json)
           
 com.meterware.httpunit.WebResponse PUT(String url, String postBody)
           
 
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
 

Constructor Detail

RestRule

public RestRule(FuncTestCase testCase)
Method Detail

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.