java.lang.Object
com.yahoo.vespa.hosted.controller.api.integration.organization.MockIssueHandler
All Implemented Interfaces:
IssueHandler

public class MockIssueHandler extends Object implements IssueHandler
Author:
jvenstad
  • Constructor Details

    • MockIssueHandler

      @Inject public MockIssueHandler()
    • MockIssueHandler

      public MockIssueHandler(Clock clock)
  • Method Details

    • file

      public IssueId file(Issue issue)
      Description copied from interface: IssueHandler
      File an issue with its given property or the default, and with the specific assignee, if present.
      Specified by:
      file in interface IssueHandler
      Parameters:
      issue - The issue to file.
      Returns:
      ID of the created issue.
    • findAllBySimilarity

      public List<IssueInfo> findAllBySimilarity(Issue issue)
      Description copied from interface: IssueHandler
      Returns all open issues similar to the given.
      Specified by:
      findAllBySimilarity in interface IssueHandler
      Parameters:
      issue - The issue to search for; relevant fields are the summary and the owner (propertyId).
      Returns:
      All open, similar issues.
    • update

      public void update(IssueId issueId, String description)
      Description copied from interface: IssueHandler
      Update the description of the issue with the given ID.
      Specified by:
      update in interface IssueHandler
      Parameters:
      issueId - ID of the issue to comment on.
      description - The updated description.
    • commentOn

      public void commentOn(IssueId issueId, String comment)
      Description copied from interface: IssueHandler
      Add a comment to the issue with the given ID.
      Specified by:
      commentOn in interface IssueHandler
      Parameters:
      issueId - ID of the issue to comment on.
      comment - The comment to add.
    • isOpen

      public boolean isOpen(IssueId issueId)
      Description copied from interface: IssueHandler
      Returns whether the issue is still under investigation.
      Specified by:
      isOpen in interface IssueHandler
      Parameters:
      issueId - ID of the issue to examine.
      Returns:
      Whether the given issue is under investigation.
    • isActive

      public boolean isActive(IssueId issueId, Duration maxInactivity)
      Description copied from interface: IssueHandler
      Returns whether there has been significant activity on the issue within the given duration.
      Specified by:
      isActive in interface IssueHandler
      Parameters:
      issueId - ID of the issue to examine.
      Returns:
      Whether the given issue is actively worked on.
    • assigneeOf

      public Optional<User> assigneeOf(IssueId issueId)
      Description copied from interface: IssueHandler
      Returns the user assigned to the given issue, if any.
      Specified by:
      assigneeOf in interface IssueHandler
      Parameters:
      issueId - ID of the issue for which to find the assignee.
      Returns:
      The user responsible for fixing the given issue, if found.
    • assigneeIdOf

      public Optional<AccountId> assigneeIdOf(IssueId issueId)
      Description copied from interface: IssueHandler
      Returns the account id assigned to the given issue, if any.
      Specified by:
      assigneeIdOf in interface IssueHandler
      Parameters:
      issueId - ID of the issue for which to find the assignee.
      Returns:
      The account id of the user responsible for fixing the given issue, if found.
    • reassign

      public boolean reassign(IssueId issueId, User assignee)
      Description copied from interface: IssueHandler
      Reassign the issue with the given ID to the given user, and returns the outcome of this.
      Specified by:
      reassign in interface IssueHandler
      Parameters:
      issueId - ID of the issue to be reassigned.
      assignee - User to which the issue shall be assigned.
      Returns:
      Whether the reassignment was successful.
    • addWatcher

      public boolean addWatcher(IssueId issueId, String watcher)
      Description copied from interface: IssueHandler
      Reassign the issue with the given ID to the given user, and returns the outcome of this.
      Specified by:
      addWatcher in interface IssueHandler
      Parameters:
      issueId - ID of the issue to be watched.
      watcher - watcher to add to the issue.
      Returns:
      Whether adding the watcher was successful.
    • escalate

      public Optional<User> escalate(IssueId issueId, Contact contact)
      Description copied from interface: IssueHandler
      Escalate an issue filed with the given property.
      Specified by:
      escalate in interface IssueHandler
      Parameters:
      issueId - ID of the issue to escalate.
      Returns:
      User that was assigned issue as a result of the escalation, if any
    • issueExists

      public boolean issueExists(Issue issue)
      Description copied from interface: IssueHandler
      Returns whether there exists an issue with an exactly matching summary.
      Specified by:
      issueExists in interface IssueHandler
      Parameters:
      issue - The summary of the issue.
      Returns:
      Whether the issue exists.
    • projectInfo

      public ProjectInfo projectInfo(String projectKey)
      Description copied from interface: IssueHandler
      Returns information about project identified by the project key
      Specified by:
      projectInfo in interface IssueHandler
      Parameters:
      projectKey - The project key to find information for
      Returns:
      Project info for project
    • addAttachment

      public void addAttachment(IssueId id, String filename, Supplier<InputStream> contentAsStream)
      Description copied from interface: IssueHandler
      Upload an attachment to the issue, with indicated filename, from the given input stream.
      Specified by:
      addAttachment in interface IssueHandler
    • close

      public MockIssueHandler close(IssueId issueId)
    • issues

    • addProject

      public void addProject(String projectKey, ProjectInfo projectInfo)