Object XrayClient
-
- All Implemented Interfaces:
public class XrayClient
-
-
Field Summary
Fields Modifier and Type Field Description private final XrayApixraypublic final static XrayClientINSTANCE
-
Method Summary
Modifier and Type Method Description final List<XrayTest>getTestPlanTests(String testPlanKey)Return all the tests contained in the test plan given in parameter. final List<XrayTest>getTests(String testKey)final List<XrayTestStep>getTestSteps(String testKey)Ask the Jira API for the steps of a given test. final SearchIssueResultgetKeyOfSearchedIssue(String jql)This functions will search for the issue using the JQL query given in parameters and return the identifier of the retrieved issue. final JiraTestProjectgetProjectFromIssue(String issueKey)final JiraIssuecreateNewTestExecutionIssue(XrayTestExecutionCreation textExectuionFields)Create a new Test execution issue in Jira. final Response<ResponseBody>sendTestExecution(XrayTestExecution execution)Send the test execution to Jira. final StringgetAttachmentToString(XrayAttachment attachment)This function converts an attachment file into a String. final JiraIssuecreateTest(JiraTest test)final ResponseBodysaveStep(String testKey, XrayBuildTestStep step)final <Error class: unknown class>deleteStep(String testKey, Long stepId)final <Error class: unknown class>getIssue(String issueKey)final ResponseBodyaddPrecondition(String preConditionKey, String jiraId)final ResponseBodyupdateTest(String jiraId, JiraTest test)final JiraAttachmentuploadAttachment(String issueId, String name, String content)final UnitlinkTest(String key1, String key2)final List<String>getLabels(String key)final List<String>getLinkedIssues(String key, String linkedField)final Response<ResponseBody>addTestToTestPlan(String test, String testPlan)final List<XrayTestPlan>getProjectTestPlans(String project)final XrayApigetXray()-
-
Method Detail
-
getTestPlanTests
final List<XrayTest> getTestPlanTests(String testPlanKey)
Return all the tests contained in the test plan given in parameter. First of all, the function will gather all tests of the given test plan, and then, it will retrieve the Xray issue for each test.
- Parameters:
testPlanKey- Identifier of the test plan to obtain its tests.- Returns:
a list of XrayTest to represent all tests of the targeted test plan.
-
getTestSteps
final List<XrayTestStep> getTestSteps(String testKey)
Ask the Jira API for the steps of a given test.
- Parameters:
testKey- is the identifier of the test to retrieve the steps.- Returns:
a list of steps as a XrayTestStep object.
-
getKeyOfSearchedIssue
final SearchIssueResult getKeyOfSearchedIssue(String jql)
This functions will search for the issue using the JQL query given in parameters and return the identifier of the retrieved issue. This function will return a result only if there is only one issue retrieved by the JQL query.
- Parameters:
jql- is the query format of Jira to search for issues.- Returns:
The identifier of the retrieved issue in String format.
-
getProjectFromIssue
final JiraTestProject getProjectFromIssue(String issueKey)
-
createNewTestExecutionIssue
final JiraIssue createNewTestExecutionIssue(XrayTestExecutionCreation textExectuionFields)
Create a new Test execution issue in Jira.
-
sendTestExecution
final Response<ResponseBody> sendTestExecution(XrayTestExecution execution)
Send the test execution to Jira.
- Parameters:
execution- is the result of the test execution.- Returns:
the answer of Jira after the test execution reception.
-
getAttachmentToString
final String getAttachmentToString(XrayAttachment attachment)
This function converts an attachment file into a String.
- Parameters:
attachment- is the attachment stored as an XrayAttachment object linked to a test step.- Returns:
the content of the attachment in String format.
-
createTest
final JiraIssue createTest(JiraTest test)
-
saveStep
final ResponseBody saveStep(String testKey, XrayBuildTestStep step)
-
deleteStep
final <Error class: unknown class> deleteStep(String testKey, Long stepId)
-
addPrecondition
final ResponseBody addPrecondition(String preConditionKey, String jiraId)
-
updateTest
final ResponseBody updateTest(String jiraId, JiraTest test)
-
uploadAttachment
final JiraAttachment uploadAttachment(String issueId, String name, String content)
-
getLinkedIssues
final List<String> getLinkedIssues(String key, String linkedField)
-
addTestToTestPlan
final Response<ResponseBody> addTestToTestPlan(String test, String testPlan)
-
getProjectTestPlans
final List<XrayTestPlan> getProjectTestPlans(String project)
-
-
-
-