Class PlansControl
- java.lang.Object
-
- com.atlassian.bamboo.testutils.backdoor.BackdoorControl<PlansControl>
-
- com.atlassian.bamboo.testutils.backdoor.PlansControl
-
public class PlansControl extends BackdoorControl<PlansControl>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
BackdoorControl.AddXsrfNoCheckTokenFilter, BackdoorControl.JsonMediaTypeFilter
-
-
Field Summary
Fields Modifier and Type Field Description static com.atlassian.pageobjects.elements.query.Poller.WaitTimeoutDEFAULT_BUILD_WAIT_TIMEOUT-
Fields inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
ADMIN_REST_PATH, API_REST_PATH, DEFAULT_REST_PATH, rootPath
-
-
Constructor Summary
Constructors Constructor Description PlansControl(@NotNull BambooEnvironmentData environmentData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlansControladdCreatedPlan(PlanKey planKey)Register plan created outside backdoor, so it would be removed on cleanupPlansControladdCustomRequirement(@NotNull PlanKey jobKey, @NotNull String requirementKey)RestRequirementaddGetCustomRequirement(@NotNull PlanKey jobKey, @NotNull String requirementKey)PlansControladdPlanVariable(PlanKey planKey, String variableName, String variableValue)RestPlanclonePlan(PlanKey planKeyToClone, PlanKey newPlanKey)Clone planPlansControlcreateArtifact(PlanKey producerJobKey, Consumer<TestArtifactDetails.Builder> consumer)RestPlanBranchcreateBranch(PlanKey planKey, String vcsBranch, String branchName)com.atlassian.bamboo.specs.api.model.plan.PlanPropertiescreateOrUpdatePlan(TestUser user, com.atlassian.bamboo.specs.api.builders.plan.Plan plan)com.atlassian.bamboo.specs.api.model.plan.PlanPropertiescreatePlan(com.atlassian.bamboo.specs.api.builders.plan.Plan plan)PlanKeycreatePlan(TestBuildDetails buildDetails)PlansControldeleteAllPlans()Marks all top level plans as deleted.PlansControldeleteAllPlansInProject(String projectKey)Marks all top level plans within a project as deleted.voiddeleteBuildResult(@NotNull PlanResultKey planResultKey)PlansControldeletePlan(@NotNull PlanKey planKey)Delete planPlansControldeletePlanQuietly(@NotNull PlanKey planKey)Delete plan quietlyPlansControldeletePlanVariable(PlanKey planKey, String variableName)PlansControldisablePlan(@NotNull PlanKey planKey)Disable planbooleandoesPlanExistAsRecord(@NotNull PlanKey planKey)PlansControlenablePlan(@NotNull PlanKey planKey)Enable planRestBranchesgetAllBranches(PlanKey key)Get all branches for chainRestPlanBranchgetBranchByName(PlanKey key, String branchName)Get branches with given name for chaincom.atlassian.pageobjects.elements.query.TimedQuery<RestPlanBranch>getBranchByNameTimed(PlanKey key, String branchName)Get branches with given name for chain as a timed queryResultgetBuildResult(PlanKey planKey, int buildNumber)Get build resultResultgetBuildResult(PlanResultKey planResultKey)Get build resultResultgetBuildResultWithArtifacts(PlanResultKey planResultKey)Get build resultRestDockerPipelineConfigurationgetDockerPipelineConfiguration(String jobKey)List<RestJob>getJobs(PlanKey planKey)longgetPlanId(PlanKey key)List<String>getPlanLabels(@NotNull PlanKey planKey)List<RestRepository>getPlanRepositories(@NotNull PlanKey planKey)StringgetPlanRootArtifactDirectory(PlanKey planKey)Get the plan directory information for the plan@NotNull List<RestVariableDefinition>getPlanVariables(@NotNull PlanKey planKey)List<RestRequirement>getRequirementsForJob(@NotNull PlanKey jobKey)RestStageListgetStages(PlanKey planKey)@NotNull List<String>getTriggerNames(@NotNull PlanKey planKey)@NotNull List<RestTrigger>getTriggers(@NotNull PlanKey planKey)booleanisPlanEnabled(@NotNull PlanKey planKey)voidrerun(@NotNull PlanResultKey planResultKey)Rebuild completed build.voidrerunFailedJobs(@NotNull PlanResultKey planResultKey)voidsetPlanLabels(@NotNull PlanKey planKey, @NotNull List<String> labels)voidtearDown()Cleanup resourcesvoidtriggerBackgroundDeletionAndWait()Trigger background plan deletion and wait up to 30s for its completion.TriggerPlanBuildertriggerBuild()PlansControltriggerBuild(PlanKey planKey)Trigger buildPlansControltriggerBuild(PlanKey planKey, Map<String,String> params)Trigger buildPlansControltriggerBuildAndAwaitCompletion(PlanKey planKey)Trigger build and wait for the completionPlansControltriggerBuildAndAwaitCompletion(PlanKey planKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)Trigger build and wait for the completionPlansControltriggerBuildAndAwaitFailure(PlanKey planKey, int expectStatusCode)PlansControltriggerBuildAndAwaitSuccess(@NotNull PlanKey planKey)RestQueuedBuildtriggerBuildWithResponse(PlanKey planKey, Map<String,String> parameters)io.restassured.path.json.JsonPathwaitForBuildWithResponse(PlanResultKey key, org.hamcrest.Matcher<io.restassured.path.json.JsonPath> matcher, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)PlansControlwaitForCompletedBuild(PlanKey planKey, int buildNumber)Waits for a build that is completed (builds stopped are not included)PlansControlwaitForCompletedBuild(PlanKey planKey, int buildNumber, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout waitTimeout)PlansControlwaitForCompletedBuild(PlanResultKey key)Wait for a build to completePlansControlwaitForCompletedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)PlansControlwaitForFailedBuild(@NotNull PlanKey planKey, int buildNumber)PlansControlwaitForFailedBuild(@NotNull PlanResultKey planResultKey)PlansControlwaitForFailedBuild(@NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)PlansControlwaitForFinishedBuild(PlanKey planKey, int buildNumber)Wait until build is finished (either completed or stopped)@NotNull PlansControlwaitForQueuedBuild(PlanResultKey key)@NotNull PlansControlwaitForQueuedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)@NotNull PlansControlwaitForQueuedOrStartedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)PlansControlwaitForStartedBuild(PlanKey planKey, int buildNumber)@NotNull PlansControlwaitForStartedBuild(PlanResultKey key)@NotNull PlansControlwaitForStartedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)PlansControlwaitForSuccessfulBuild(@NotNull PlanKey planKey, int buildNumber)PlansControlwaitForSuccessfulBuild(@NotNull PlanResultKey planResultKey)PlansControlwaitForSuccessfulBuild(@NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)RestPlanBranchwaitUntilBranchIsCreated(PlanKey key, String branchName)Wait unit plan branch with given name is created for chainRestPlanBranchwaitUntilBranchIsCreatedAndEnabled(PlanKey key, String branchName)Wait unit plan branch with given name is created and enabled for chainStringwaitUntilPlanIsAffectedInFailedSpecsRun(PlanKey planKey, int buildNumber)voidwaitUntilPlanIsAffectedInSuccessfulSpecsRun(PlanKey planKey, int buildNumber)voidwaitUntilPlanIsUpdated(PlanKey planKey, int buildNumber)-
Methods inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
client, createResource, createResourceForPath, get, getEnvironmentData, getRestModulePath, percentEncode, ping, post, resourceRoot
-
-
-
-
Constructor Detail
-
PlansControl
public PlansControl(@NotNull @NotNull BambooEnvironmentData environmentData)
-
-
Method Detail
-
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, usetriggerBackgroundDeletionAndWait()afterwards.
-
deleteAllPlansInProject
public PlansControl deleteAllPlansInProject(String projectKey)
Marks all top level plans within a project as deleted. To await the actual data deletion, usetriggerBackgroundDeletionAndWait()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 triggeredparams- 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)
-
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
-
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:BackdoorControlCleanup resources- Overrides:
tearDownin classBackdoorControl<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)
-
-