Class PlansControl

java.lang.Object
com.atlassian.bamboo.testutils.backdoor.BackdoorControl<PlansControl>
com.atlassian.bamboo.testutils.backdoor.PlansControl

public class PlansControl extends BackdoorControl<PlansControl>
  • Field Details

    • DEFAULT_BUILD_WAIT_TIMEOUT

      public static final com.atlassian.pageobjects.elements.query.Poller.WaitTimeout DEFAULT_BUILD_WAIT_TIMEOUT
  • Constructor Details

  • Method Details

    • doesPlanExistAsRecord

      public boolean doesPlanExistAsRecord(@NotNull @NotNull PlanKey planKey)
    • isPlanEnabled

      public boolean isPlanEnabled(@NotNull @NotNull PlanKey planKey)
    • addCreatedPlan

      public PlansControl addCreatedPlan(PlanKey planKey)
      Register plan created outside backdoor, so it would be removed on cleanup
    • deletePlan

      public PlansControl deletePlan(@NotNull @NotNull PlanKey planKey)
      Delete plan
      Parameters:
      planKey - key of a Plan
    • deletePlanQuietly

      public PlansControl deletePlanQuietly(@NotNull @NotNull PlanKey planKey)
      Delete plan quietly
      Parameters:
      planKey - key of a Plan
    • enablePlan

      public PlansControl enablePlan(@NotNull @NotNull PlanKey planKey)
      Enable plan
      Parameters:
      planKey - key of a Plan
    • disablePlan

      public PlansControl disablePlan(@NotNull @NotNull PlanKey planKey)
      Disable plan
      Parameters:
      planKey - key of a Plan
    • deleteAllPlans

      public PlansControl deleteAllPlans()
      Marks all top level plans as deleted. To await the actual data deletion, use triggerBackgroundDeletionAndWait() afterwards.
    • deleteAllPlansInProject

      public PlansControl deleteAllPlansInProject(String projectKey)
      Marks all top level plans within a project as deleted. To await the actual data deletion, use triggerBackgroundDeletionAndWait() afterwards.
    • triggerBackgroundDeletionAndWait

      public void triggerBackgroundDeletionAndWait()
      Trigger background plan deletion and wait up to 30s for its completion.
    • getBranchByName

      public RestPlanBranch getBranchByName(PlanKey key, String branchName) throws Exception
      Get branches with given name for chain
      Throws:
      Exception
    • getBranchByNameTimed

      public com.atlassian.pageobjects.elements.query.TimedQuery<RestPlanBranch> getBranchByNameTimed(PlanKey key, String branchName) throws Exception
      Get branches with given name for chain as a timed query
      Throws:
      Exception
    • waitUntilBranchIsCreated

      public RestPlanBranch waitUntilBranchIsCreated(PlanKey key, String branchName) throws Exception
      Wait unit plan branch with given name is created for chain
      Throws:
      Exception
    • waitUntilBranchIsCreatedAndEnabled

      public RestPlanBranch waitUntilBranchIsCreatedAndEnabled(PlanKey key, String branchName) throws Exception
      Wait unit plan branch with given name is created and enabled for chain
      Throws:
      Exception
    • getAllBranches

      public RestBranches getAllBranches(PlanKey key) throws Exception
      Get all branches for chain
      Throws:
      Exception
    • createBranch

      public RestPlanBranch createBranch(PlanKey planKey, String vcsBranch, String branchName)
    • clonePlan

      public RestPlan clonePlan(PlanKey planKeyToClone, PlanKey newPlanKey) throws Exception
      Clone plan
      Throws:
      Exception
    • triggerBuild

      public TriggerPlanBuilder triggerBuild()
    • triggerBuild

      public PlansControl triggerBuild(PlanKey planKey)
      Trigger build
      Parameters:
      planKey - which will be triggered
    • triggerBuildAndAwaitFailure

      public PlansControl triggerBuildAndAwaitFailure(PlanKey planKey, int expectStatusCode)
    • triggerBuild

      public PlansControl triggerBuild(PlanKey planKey, Map<String,String> params)
      Trigger build
      Parameters:
      planKey - which will be triggered
      params - additional params to be passed to the build
    • rerun

      public void rerun(@NotNull @NotNull PlanResultKey planResultKey)
      Rebuild completed build.
      Parameters:
      planResultKey - build result to be rerun
    • rerunFailedJobs

      public void rerunFailedJobs(@NotNull @NotNull PlanResultKey planResultKey)
    • triggerBuildWithResponse

      public RestQueuedBuild triggerBuildWithResponse(PlanKey planKey, Map<String,String> parameters)
    • triggerCustomRevisionBuildWithResponse

      public RestQueuedBuild triggerCustomRevisionBuildWithResponse(PlanKey planKey, String rev, Map<String,String> parameters)
    • triggerBuildAndAwaitCompletion

      public PlansControl triggerBuildAndAwaitCompletion(PlanKey planKey)
      Trigger build and wait for the completion
      Parameters:
      planKey - key of the plan to trigger
    • triggerBuildAndAwaitCompletion

      public PlansControl triggerBuildAndAwaitCompletion(PlanKey planKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
      Trigger build and wait for the completion
      Parameters:
      planKey - key of the plan to trigger
    • getBuildResult

      public Result getBuildResult(PlanResultKey planResultKey)
      Get build result
    • getBuildResultWithArtifacts

      public Result getBuildResultWithArtifacts(PlanResultKey planResultKey)
      Get build result
    • getBuildResult

      public Result getBuildResult(PlanKey planKey, int buildNumber) throws Exception
      Get build result
      Throws:
      Exception
    • triggerBuildAndAwaitSuccess

      public PlansControl triggerBuildAndAwaitSuccess(@NotNull @NotNull PlanKey planKey)
    • waitForSuccessfulBuild

      public PlansControl waitForSuccessfulBuild(@NotNull @NotNull PlanResultKey planResultKey)
    • waitForSuccessfulBuild

      public PlansControl waitForSuccessfulBuild(@NotNull @NotNull PlanKey planKey, int buildNumber)
    • waitForSuccessfulBuild

      public PlansControl waitForSuccessfulBuild(@NotNull @NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
    • waitForFailedBuild

      public PlansControl waitForFailedBuild(@NotNull @NotNull PlanResultKey planResultKey)
    • waitForFailedBuild

      public PlansControl waitForFailedBuild(@NotNull @NotNull PlanKey planKey, int buildNumber)
    • waitForFailedBuild

      public PlansControl waitForFailedBuild(@NotNull @NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
    • waitForCompletedBuild

      public PlansControl waitForCompletedBuild(PlanResultKey key)
      Wait for a build to complete
      Parameters:
      key - plan result key
    • waitForCompletedBuild

      public PlansControl waitForCompletedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
      Throws:
      AssertionError - if build is not completed
    • waitForCompletedBuild

      public PlansControl waitForCompletedBuild(PlanKey planKey, int buildNumber)
      Waits for a build that is completed (builds stopped are not included)
    • waitUntilPlanIsUpdated

      public void waitUntilPlanIsUpdated(PlanKey planKey, int buildNumber)
    • waitUntilPlanIsAffectedInSuccessfulSpecsRun

      public void waitUntilPlanIsAffectedInSuccessfulSpecsRun(PlanKey planKey, int buildNumber)
    • waitUntilPlanIsAffectedInFailedSpecsRun

      public String waitUntilPlanIsAffectedInFailedSpecsRun(PlanKey planKey, int buildNumber)
    • waitForCompletedBuild

      public PlansControl waitForCompletedBuild(PlanKey planKey, int buildNumber, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout waitTimeout)
    • waitForStartedBuild

      public PlansControl waitForStartedBuild(PlanKey planKey, int buildNumber)
    • waitForStartedBuild

      @NotNull public @NotNull PlansControl waitForStartedBuild(PlanResultKey key)
    • waitForStartedBuild

      @NotNull public @NotNull PlansControl waitForStartedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
    • waitForQueuedBuild

      @NotNull public @NotNull PlansControl waitForQueuedBuild(PlanResultKey key)
    • waitForQueuedBuild

      @NotNull public @NotNull PlansControl waitForQueuedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
    • waitForQueuedOrStartedBuild

      @NotNull public @NotNull PlansControl waitForQueuedOrStartedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
    • waitForFinishedBuild

      public PlansControl waitForFinishedBuild(PlanKey planKey, int buildNumber)
      Wait until build is finished (either completed or stopped)
    • waitForBuildWithResponse

      public io.restassured.path.json.JsonPath waitForBuildWithResponse(PlanResultKey key, org.hamcrest.Matcher<io.restassured.path.json.JsonPath> matcher, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
    • getStages

      public RestStageList getStages(PlanKey planKey) throws Exception
      Throws:
      Exception
    • getJobs

      public List<RestJob> getJobs(PlanKey planKey) throws Exception
      Throws:
      Exception
    • createPlan

      public com.atlassian.bamboo.specs.api.model.plan.PlanProperties createPlan(com.atlassian.bamboo.specs.api.builders.plan.Plan plan) throws Exception
      Throws:
      Exception
    • createOrUpdatePlan

      public com.atlassian.bamboo.specs.api.model.plan.PlanProperties createOrUpdatePlan(TestUser user, com.atlassian.bamboo.specs.api.builders.plan.Plan plan) throws Exception
      Throws:
      Exception
    • createPlan

      public PlanKey createPlan(TestBuildDetails buildDetails) throws Exception
      Throws:
      Exception
    • tearDown

      public void tearDown()
      Description copied from class: BackdoorControl
      Cleanup resources
      Overrides:
      tearDown in class BackdoorControl<PlansControl>
    • deleteBuildResult

      public void deleteBuildResult(@NotNull @NotNull PlanResultKey planResultKey) throws Exception
      Throws:
      Exception
    • getPlanVariables

      @NotNull public @NotNull List<RestVariableDefinition> getPlanVariables(@NotNull @NotNull PlanKey planKey)
    • getTriggerNames

      @NotNull public @NotNull List<String> getTriggerNames(@NotNull @NotNull PlanKey planKey)
    • getTriggers

      @NotNull public @NotNull List<RestTrigger> getTriggers(@NotNull @NotNull PlanKey planKey)
    • addPlanVariable

      public PlansControl addPlanVariable(PlanKey planKey, String variableName, String variableValue)
    • deletePlanVariable

      public PlansControl deletePlanVariable(PlanKey planKey, String variableName)
    • createArtifact

      public PlansControl createArtifact(PlanKey producerJobKey, Consumer<TestArtifactDetails.Builder> consumer)
    • getPlanRootArtifactDirectory

      public String getPlanRootArtifactDirectory(PlanKey planKey)
      Get the plan directory information for the plan
      Parameters:
      planKey -
      Returns:
    • addCustomRequirement

      public PlansControl addCustomRequirement(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull String requirementKey)
    • addGetCustomRequirement

      public RestRequirement addGetCustomRequirement(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull String requirementKey)
    • getRequirementsForJob

      public List<RestRequirement> getRequirementsForJob(@NotNull @NotNull PlanKey jobKey)
    • getPlanId

      public long getPlanId(PlanKey key)
    • getDockerPipelineConfiguration

      public RestDockerPipelineConfiguration getDockerPipelineConfiguration(String jobKey)
    • getPlanRepositories

      public List<RestRepository> getPlanRepositories(@NotNull @NotNull PlanKey planKey)
    • getPlanLabels

      public List<String> getPlanLabels(@NotNull @NotNull PlanKey planKey)
    • setPlanLabels

      public void setPlanLabels(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull List<String> labels)
    • triggerChangeDetection

      public void triggerChangeDetection(@NotNull @NotNull PlanKey planKey)