Class RunAttachmentRequestBuilder

java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.test.attachments.RunAttachmentRequestBuilder

public class RunAttachmentRequestBuilder extends BaseRequestBuilder
Provides functionality to work with Test run attachments Api.
  • Constructor Details

    • RunAttachmentRequestBuilder

      public RunAttachmentRequestBuilder(String organizationUrl, AccessTokenCredential accessTokenCredential)
      Instantiates a new RequestBuilder instance and sets the default values.
      Parameters:
      organizationUrl - Represents organization location request url.
      accessTokenCredential - Access token credential object.
  • Method Details

    • createAsync

      public CompletableFuture<TestAttachmentReference> createAsync(int runId, TestAttachmentRequestModel requestModel) throws AzDException
      Attach a file to a test run.
      Parameters:
      runId - ID of the test run against which attachment has to be uploaded.
      requestModel - Request body to create the result attachment.
      Returns:
      TestAttachmentReference TestAttachmentReference
      Throws:
      AzDException - Default Api exception handler.
    • getContentAsync

      public CompletableFuture<InputStream> getContentAsync(int attachmentId, int runId) throws AzDException
      Download a test run attachment by its ID.
      Parameters:
      attachmentId - ID of the test result attachment to be downloaded.
      runId - ID of the test run that contains the result.
      Returns:
      InputStream of attachment content.
      Throws:
      AzDException - Default Api exception handler.
    • getAsZipAsync

      public CompletableFuture<InputStream> getAsZipAsync(int attachmentId, int runId) throws AzDException
      Download a test result attachment by its ID.
      Parameters:
      attachmentId - ID of the test result attachment to be downloaded.
      runId - ID of the test run that contains the result.
      Returns:
      InputStream of attachment content as zip file.
      Throws:
      AzDException - Default Api exception handler.
    • listAsync

      public CompletableFuture<TestAttachments> listAsync(int runId) throws AzDException
      Get list of test run attachments reference.
      Parameters:
      runId - ID of the test run that contains the result.
      Returns:
      List of TestAttachment TestAttachments
      Throws:
      AzDException - Default Api exception handler.
    • create

      public TestAttachmentReference create(int runId, TestAttachmentRequestModel requestModel) throws AzDException
      Attach a file to a test run.
      Parameters:
      runId - ID of the test run against which attachment has to be uploaded.
      requestModel - Request body to create the result attachment.
      Returns:
      TestAttachmentReference TestAttachmentReference
      Throws:
      AzDException - Default Api exception handler.
    • getContent

      public InputStream getContent(int attachmentId, int runId) throws AzDException
      Download a test run attachment by its ID.
      Parameters:
      attachmentId - ID of the test result attachment to be downloaded.
      runId - ID of the test run that contains the result.
      Returns:
      InputStream of attachment content.
      Throws:
      AzDException - Default Api exception handler.
    • getAsZip

      public InputStream getAsZip(int attachmentId, int runId) throws AzDException
      Download a test result attachment by its ID.
      Parameters:
      attachmentId - ID of the test result attachment to be downloaded.
      runId - ID of the test run that contains the result.
      Returns:
      InputStream of attachment content as zip file.
      Throws:
      AzDException - Default Api exception handler.
    • list

      public TestAttachments list(int runId) throws AzDException
      Get list of test run attachments reference.
      Parameters:
      runId - ID of the test run that contains the result.
      Returns:
      List of TestAttachment TestAttachments
      Throws:
      AzDException - Default Api exception handler.