Class PlansControl
java.lang.Object
com.atlassian.bamboo.testutils.backdoor.BackdoorControl<PlansControl>
com.atlassian.bamboo.testutils.backdoor.PlansControl
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
BackdoorControl.AddXsrfNoCheckTokenFilter, BackdoorControl.JsonMediaTypeFilter
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.atlassian.pageobjects.elements.query.Poller.WaitTimeout
Fields inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
ADMIN_REST_PATH, API_REST_PATH, DEFAULT_REST_PATH, XSRF_NO_CHECK, XSRF_TOKEN_HEADER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCreatedPlan
(PlanKey planKey) Register plan created outside backdoor, so it would be removed on cleanupaddCustomRequirement
(@NotNull PlanKey jobKey, @NotNull String requirementKey) addGetCustomRequirement
(@NotNull PlanKey jobKey, @NotNull String requirementKey) addPlanVariable
(PlanKey planKey, String variableName, String variableValue) Clone plancreateArtifact
(PlanKey producerJobKey, Consumer<TestArtifactDetails.Builder> consumer) createBranch
(PlanKey planKey, String vcsBranch, String branchName) com.atlassian.bamboo.specs.api.model.plan.PlanProperties
createOrUpdatePlan
(TestUser user, com.atlassian.bamboo.specs.api.builders.plan.Plan plan) com.atlassian.bamboo.specs.api.model.plan.PlanProperties
createPlan
(com.atlassian.bamboo.specs.api.builders.plan.Plan plan) createPlan
(TestBuildDetails buildDetails) Marks all top level plans as deleted.deleteAllPlansInProject
(String projectKey) Marks all top level plans within a project as deleted.void
deleteBuildResult
(@NotNull PlanResultKey planResultKey) deletePlan
(@NotNull PlanKey planKey) Delete plandeletePlanQuietly
(@NotNull PlanKey planKey) Delete plan quietlydeletePlanVariable
(PlanKey planKey, String variableName) disablePlan
(@NotNull PlanKey planKey) Disable planboolean
doesPlanExistAsRecord
(@NotNull PlanKey planKey) enablePlan
(@NotNull PlanKey planKey) Enable plangetAllBranches
(PlanKey key) Get all branches for chaingetBranchByName
(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 querygetBuildResult
(PlanKey planKey, int buildNumber) Get build resultgetBuildResult
(PlanResultKey planResultKey) Get build resultgetBuildResultWithArtifacts
(PlanResultKey planResultKey) Get build resultgetDockerPipelineConfiguration
(String jobKey) long
getPlanLabels
(@NotNull PlanKey planKey) getPlanRepositories
(@NotNull PlanKey planKey) getPlanRootArtifactDirectory
(PlanKey planKey) Get the plan directory information for the plan@NotNull List<RestVariableDefinition>
getPlanVariables
(@NotNull PlanKey planKey) getRequirementsForJob
(@NotNull PlanKey jobKey) getTriggerNames
(@NotNull PlanKey planKey) @NotNull List<RestTrigger>
getTriggers
(@NotNull PlanKey planKey) boolean
isPlanEnabled
(@NotNull PlanKey planKey) void
rerun
(@NotNull PlanResultKey planResultKey) Rebuild completed build.void
rerunFailedJobs
(@NotNull PlanResultKey planResultKey) void
setPlanLabels
(@NotNull PlanKey planKey, @NotNull List<String> labels) void
tearDown()
Cleanup resourcesvoid
Trigger background plan deletion and wait up to 30s for its completion.triggerBuild
(PlanKey planKey) Trigger buildtriggerBuild
(PlanKey planKey, Map<String, String> params) Trigger buildtriggerBuildAndAwaitCompletion
(PlanKey planKey) Trigger build and wait for the completiontriggerBuildAndAwaitCompletion
(PlanKey planKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) Trigger build and wait for the completiontriggerBuildAndAwaitFailure
(PlanKey planKey, int expectStatusCode) triggerBuildAndAwaitSuccess
(@NotNull PlanKey planKey) triggerBuildWithResponse
(PlanKey planKey, Map<String, String> parameters) void
triggerChangeDetection
(@NotNull PlanKey planKey) 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) waitForCompletedBuild
(PlanKey planKey, int buildNumber) Waits for a build that is completed (builds stopped are not included)waitForCompletedBuild
(PlanKey planKey, int buildNumber, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout waitTimeout) Wait for a build to completewaitForCompletedBuild
(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) waitForFailedBuild
(@NotNull PlanKey planKey, int buildNumber) waitForFailedBuild
(@NotNull PlanResultKey planResultKey) waitForFailedBuild
(@NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) waitForFinishedBuild
(PlanKey planKey, int buildNumber) Wait until build is finished (either completed or stopped)@NotNull PlansControl
@NotNull PlansControl
waitForQueuedBuild
(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) @NotNull PlansControl
waitForQueuedOrStartedBuild
(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) waitForStartedBuild
(PlanKey planKey, int buildNumber) @NotNull PlansControl
@NotNull PlansControl
waitForStartedBuild
(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) waitForSuccessfulBuild
(@NotNull PlanKey planKey, int buildNumber) waitForSuccessfulBuild
(@NotNull PlanResultKey planResultKey) waitForSuccessfulBuild
(@NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) waitUntilBranchIsCreated
(PlanKey key, String branchName) Wait unit plan branch with given name is created for chainwaitUntilBranchIsCreatedAndEnabled
(PlanKey key, String branchName) Wait unit plan branch with given name is created and enabled for chainwaitUntilPlanIsAffectedInFailedSpecsRun
(PlanKey planKey, int buildNumber) void
waitUntilPlanIsAffectedInSuccessfulSpecsRun
(PlanKey planKey, int buildNumber) void
waitUntilPlanIsUpdated
(PlanKey planKey, int buildNumber) Methods inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
anonymousResourceRoot, client, createResource, createResourceForPath, createResourceForPath, get, getEnvironmentData, getRestModulePath, getRootPath, percentEncode, ping, post, resourceRoot
-
Field Details
-
DEFAULT_BUILD_WAIT_TIMEOUT
public static final com.atlassian.pageobjects.elements.query.Poller.WaitTimeout DEFAULT_BUILD_WAIT_TIMEOUT
-
-
Constructor Details
-
PlansControl
-
-
Method Details
-
doesPlanExistAsRecord
-
isPlanEnabled
-
addCreatedPlan
Register plan created outside backdoor, so it would be removed on cleanup -
deletePlan
Delete plan- Parameters:
planKey
- key of a Plan
-
deletePlanQuietly
Delete plan quietly- Parameters:
planKey
- key of a Plan
-
enablePlan
Enable plan- Parameters:
planKey
- key of a Plan
-
disablePlan
Disable plan- Parameters:
planKey
- key of a Plan
-
deleteAllPlans
Marks all top level plans as deleted. To await the actual data deletion, usetriggerBackgroundDeletionAndWait()
afterwards. -
deleteAllPlansInProject
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
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
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
Get all branches for chain- Throws:
Exception
-
createBranch
-
clonePlan
Clone plan- Throws:
Exception
-
triggerBuild
-
triggerBuild
Trigger build- Parameters:
planKey
- which will be triggered
-
triggerBuildAndAwaitFailure
-
triggerBuild
Trigger build- Parameters:
planKey
- which will be triggeredparams
- additional params to be passed to the build
-
rerun
Rebuild completed build.- Parameters:
planResultKey
- build result to be rerun
-
rerunFailedJobs
-
triggerBuildWithResponse
-
triggerCustomRevisionBuildWithResponse
-
triggerBuildAndAwaitCompletion
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
Get build result -
getBuildResultWithArtifacts
Get build result -
getBuildResult
Get build result- Throws:
Exception
-
triggerBuildAndAwaitSuccess
-
waitForSuccessfulBuild
-
waitForSuccessfulBuild
-
waitForSuccessfulBuild
public PlansControl waitForSuccessfulBuild(@NotNull @NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) -
waitForFailedBuild
-
waitForFailedBuild
-
waitForFailedBuild
public PlansControl waitForFailedBuild(@NotNull @NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) -
waitForCompletedBuild
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
Waits for a build that is completed (builds stopped are not included) -
waitUntilPlanIsUpdated
-
waitUntilPlanIsAffectedInSuccessfulSpecsRun
-
waitUntilPlanIsAffectedInFailedSpecsRun
-
waitForCompletedBuild
public PlansControl waitForCompletedBuild(PlanKey planKey, int buildNumber, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout waitTimeout) -
waitForStartedBuild
-
waitForStartedBuild
-
waitForStartedBuild
@NotNull public @NotNull PlansControl waitForStartedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) -
waitForQueuedBuild
-
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
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
- Throws:
Exception
-
getJobs
- 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
- Throws:
Exception
-
tearDown
public void tearDown()Description copied from class:BackdoorControl
Cleanup resources- Overrides:
tearDown
in classBackdoorControl<PlansControl>
-
deleteBuildResult
- Throws:
Exception
-
getPlanVariables
@NotNull public @NotNull List<RestVariableDefinition> getPlanVariables(@NotNull @NotNull PlanKey planKey) -
getTriggerNames
-
getTriggers
-
addPlanVariable
-
deletePlanVariable
-
createArtifact
public PlansControl createArtifact(PlanKey producerJobKey, Consumer<TestArtifactDetails.Builder> consumer) -
getPlanRootArtifactDirectory
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
-
getPlanId
-
getDockerPipelineConfiguration
-
getPlanRepositories
-
getPlanLabels
-
setPlanLabels
-
triggerChangeDetection
-