Class TestRailClient
- java.lang.Object
-
- dev.aherscu.qa.testrail.reporter.TestRailClient
-
public class TestRailClient extends Object
-
-
Constructor Summary
Constructors Constructor Description TestRailClient(String base_url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getPassword()
Get/Set PasswordString
getUser()
Get/Set UserObject
sendGet(String uri)
Object
sendGet(String uri, String data)
Send GetObject
sendPost(String uri, Object data)
Send POSTvoid
setPassword(String password)
void
setUser(String user)
-
-
-
Constructor Detail
-
TestRailClient
public TestRailClient(String base_url)
-
-
Method Detail
-
getPassword
public String getPassword()
Get/Set PasswordReturns/sets the password used for authenticating the API requests.
- Returns:
- the password
-
setPassword
public void setPassword(String password)
-
getUser
public String getUser()
Get/Set UserReturns/sets the user used for authenticating the API requests.
- Returns:
- the user
-
setUser
public void setUser(String user)
-
sendGet
public Object sendGet(String uri, String data)
Send GetIssues a GET request (read) against the API and returns the result (as Object, see below).
Arguments:
uri The API method to call including parameters (e.g. get_case/1)
Returns the parsed JSON response as standard object which can either be an instance of JSONObject or JSONArray (depending on the API method). In most cases, this returns a JSONObject instance which is basically the same as java.util.Map.
If 'get_attachment/:attachment_id', returns a String
- Parameters:
uri
- uridata
- data- Returns:
- the response
-
sendPost
public Object sendPost(String uri, Object data)
Send POSTIssues a POST request (write) against the API and returns the result (as Object, see below).
Arguments:
uri The API method to call including parameters (e.g. add_case/1) data The data to submit as part of the request (e.g., a map) If adding an attachment, must be the path to the file
Returns the parsed JSON response as standard object which can either be an instance of JSONObject or JSONArray (depending on the API method). In most cases, this returns a JSONObject instance which is basically the same as java.util.Map.
- Parameters:
uri
- uridata
- data- Returns:
- the response
-
-