Class AbstractXrayService

java.lang.Object
de.qytera.qtaf.xray.service.AbstractXrayService
Direct Known Subclasses:
XrayCloudService, XrayServerService

public abstract class AbstractXrayService extends Object
A class for interfacing with Xray's API. Also provides methods for interfacing with Xray's underlying Jira instance.
  • Field Details

    • jwtToken

      protected String jwtToken
      JWT auth token that was fetched from the API
    • client

      protected final com.sun.jersey.api.client.Client client
      Jersey HTTP Client
    • logger

      protected final Logger logger
      The logger instance used for writing logs to stdout and stderr.
    • errorLogs

      protected final ErrorLogCollection errorLogs
      The collection used for persisting error messages.
  • Constructor Details

    • AbstractXrayService

      public AbstractXrayService()
  • Method Details

    • getXrayURL

      public abstract String getXrayURL()
      Get Xray URL
      Returns:
      Xray URL
    • getImportPath

      public abstract String getImportPath()
      Get Xray REST Import Path
      Returns:
      Xray REST Import Path
    • getIssueSearchPath

      public abstract String getIssueSearchPath()
      Returns the Jira instance's JQL search path.
      Returns:
      REST path for JQL queries
    • authorizationHeaderXray

      public abstract String authorizationHeaderXray()
      Authentication against Xray API.
      Returns:
      authorization header value
    • authorizationHeaderJira

      public abstract String authorizationHeaderJira()
      Authentication against Jira API.
      Returns:
      authorization header value
    • getJwtToken

      public String getJwtToken()
      Get JWT token
      Returns:
      jwt token
    • setJwtToken

      public AbstractXrayService setJwtToken(String jwtToken)
      Set jwtToken
      Parameters:
      jwtToken - JwtToken
      Returns:
      this
    • importExecution

      public XrayImportResponseDto importExecution(XrayImportRequestDto xrayImportDTO)
      Import a test execution
      Parameters:
      xrayImportDTO - Test execution DTO
      Returns:
      Test execution response DTO
    • searchJiraIssues

      public List<JiraIssueResponseDto> searchJiraIssues(Collection<String> testIssueKeys, AdditionalField... fields)
      Searches for the given Jira issues, including any additional fields in the response if provided.
      Parameters:
      testIssueKeys - the Jira issues to search for
      fields - additional fields to include in the response
      Returns:
      a list of found issues
      See Also:
    • getIssueIds

      protected Map<String,String> getIssueIds(Collection<String> testIssueKeys)
      Retrieve all issue IDs for the given test issues.
      Parameters:
      testIssueKeys - the test issues to retrieve the IDs for
      Returns:
      a mapping of test issue keys to their IDs
      See Also:
    • getTestSteps

      public abstract Map<String,XrayTestStepResponseDto[]> getTestSteps(Collection<String> testIssueKeys)
      Retrieve all test steps for the given test issues.
      Parameters:
      testIssueKeys - the test issues to retrieve the steps for
      Returns:
      a mapping of test issue keys to their steps