public class PlansControl extends BackdoorControl<PlansControl>
BackdoorControl.AddXsrfNoCheckTokenFilter, BackdoorControl.JsonMediaTypeFilter
Modifier and Type | Field and Description |
---|---|
static com.atlassian.pageobjects.elements.query.Poller.WaitTimeout |
DEFAULT_BUILD_WAIT_TIMEOUT |
ADMIN_REST_PATH, API_REST_PATH, DEFAULT_REST_PATH, rootPath
Constructor and Description |
---|
PlansControl(@NotNull BambooEnvironmentData environmentData) |
Modifier and Type | Method and Description |
---|---|
PlansControl |
addCreatedPlan(PlanKey planKey)
Register plan created outside backdoor, so it would be removed on cleanup
|
PlansControl |
addCustomRequirement(@NotNull PlanKey jobKey,
@NotNull String requirementKey) |
RestRequirement |
addGetCustomRequirement(@NotNull PlanKey jobKey,
@NotNull String requirementKey) |
PlansControl |
addPlanVariable(PlanKey planKey,
String variableName,
String variableValue) |
RestPlan |
clonePlan(PlanKey planKeyToClone,
PlanKey newPlanKey)
Clone plan
|
PlansControl |
createArtifact(PlanKey producerJobKey,
Consumer<TestArtifactDetails.Builder> consumer) |
RestPlanBranch |
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) |
PlanKey |
createPlan(TestBuildDetails buildDetails) |
PlansControl |
deleteAllPlans()
Marks all top level plans as deleted.
|
PlansControl |
deleteAllPlansInProject(String projectKey)
Marks all top level plans within a project as deleted.
|
void |
deleteBuildResult(@NotNull PlanResultKey planResultKey) |
PlansControl |
deletePlan(@NotNull PlanKey planKey)
Delete plan
|
PlansControl |
deletePlanQuietly(@NotNull PlanKey planKey)
Delete plan quietly
|
PlansControl |
deletePlanVariable(PlanKey planKey,
String variableName) |
PlansControl |
disablePlan(@NotNull PlanKey planKey)
Disable plan
|
boolean |
doesPlanExistAsRecord(@NotNull PlanKey planKey) |
PlansControl |
enablePlan(@NotNull PlanKey planKey)
Enable plan
|
RestBranches |
getAllBranches(PlanKey key)
Get all branches for chain
|
RestPlanBranch |
getBranchByName(PlanKey key,
String branchName)
Get branches with given name for chain
|
com.atlassian.pageobjects.elements.query.TimedQuery<RestPlanBranch> |
getBranchByNameTimed(PlanKey key,
String branchName)
Get branches with given name for chain as a timed query
|
Result |
getBuildResult(PlanKey planKey,
int buildNumber)
Get build result
|
Result |
getBuildResult(PlanResultKey planResultKey)
Get build result
|
Result |
getBuildResultWithArtifacts(PlanResultKey planResultKey)
Get build result
|
RestDockerPipelineConfiguration |
getDockerPipelineConfiguration(String jobKey) |
List<RestJob> |
getJobs(PlanKey planKey) |
long |
getPlanId(PlanKey key) |
List<String> |
getPlanLabels(@NotNull PlanKey planKey) |
List<RestRepository> |
getPlanRepositories(@NotNull PlanKey planKey) |
String |
getPlanRootArtifactDirectory(PlanKey planKey)
Get the plan directory information for the plan
|
@NotNull List<RestVariableDefinition> |
getPlanVariables(@NotNull PlanKey planKey) |
List<RestRequirement> |
getRequirementsForJob(@NotNull PlanKey jobKey) |
RestStageList |
getStages(PlanKey planKey) |
@NotNull List<String> |
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 resources
|
void |
triggerBackgroundDeletionAndWait()
Trigger background plan deletion and wait up to 30s for its completion.
|
TriggerPlanBuilder |
triggerBuild() |
PlansControl |
triggerBuild(PlanKey planKey)
Trigger build
|
PlansControl |
triggerBuild(PlanKey planKey,
Map<String,String> params)
Trigger build
|
PlansControl |
triggerBuildAndAwaitCompletion(PlanKey planKey)
Trigger build and wait for the completion
|
PlansControl |
triggerBuildAndAwaitCompletion(PlanKey planKey,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
Trigger build and wait for the completion
|
PlansControl |
triggerBuildAndAwaitFailure(PlanKey planKey,
int expectStatusCode) |
PlansControl |
triggerBuildAndAwaitSuccess(@NotNull PlanKey planKey) |
RestQueuedBuild |
triggerBuildWithResponse(PlanKey planKey,
Map<String,String> parameters) |
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) |
PlansControl |
waitForCompletedBuild(PlanKey planKey,
int buildNumber)
Waits for a build that is completed (builds stopped are not included)
|
PlansControl |
waitForCompletedBuild(PlanKey planKey,
int buildNumber,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout waitTimeout) |
PlansControl |
waitForCompletedBuild(PlanResultKey key)
Wait for a build to complete
|
PlansControl |
waitForCompletedBuild(PlanResultKey key,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) |
PlansControl |
waitForFailedBuild(@NotNull PlanKey planKey,
int buildNumber) |
PlansControl |
waitForFailedBuild(@NotNull PlanResultKey planResultKey) |
PlansControl |
waitForFailedBuild(@NotNull PlanResultKey planResultKey,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) |
PlansControl |
waitForFinishedBuild(PlanKey planKey,
int buildNumber)
Wait until build is finished (either completed or stopped)
|
@NotNull PlansControl |
waitForQueuedBuild(PlanResultKey key) |
@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) |
PlansControl |
waitForStartedBuild(PlanKey planKey,
int buildNumber) |
@NotNull PlansControl |
waitForStartedBuild(PlanResultKey key) |
@NotNull PlansControl |
waitForStartedBuild(PlanResultKey key,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) |
PlansControl |
waitForSuccessfulBuild(@NotNull PlanKey planKey,
int buildNumber) |
PlansControl |
waitForSuccessfulBuild(@NotNull PlanResultKey planResultKey) |
PlansControl |
waitForSuccessfulBuild(@NotNull PlanResultKey planResultKey,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) |
RestPlanBranch |
waitUntilBranchIsCreated(PlanKey key,
String branchName)
Wait unit plan branch with given name is created for chain
|
RestPlanBranch |
waitUntilBranchIsCreatedAndEnabled(PlanKey key,
String branchName)
Wait unit plan branch with given name is created and enabled for chain
|
String |
waitUntilPlanIsAffectedInFailedSpecsRun(PlanKey planKey,
int buildNumber) |
void |
waitUntilPlanIsAffectedInSuccessfulSpecsRun(PlanKey planKey,
int buildNumber) |
void |
waitUntilPlanIsUpdated(PlanKey planKey,
int buildNumber) |
client, createResource, createResourceForPath, get, getEnvironmentData, getRestModulePath, percentEncode, ping, post, resourceRoot
public static final com.atlassian.pageobjects.elements.query.Poller.WaitTimeout DEFAULT_BUILD_WAIT_TIMEOUT
public PlansControl(@NotNull @NotNull BambooEnvironmentData environmentData)
public boolean doesPlanExistAsRecord(@NotNull @NotNull PlanKey planKey)
public boolean isPlanEnabled(@NotNull @NotNull PlanKey planKey)
public PlansControl addCreatedPlan(PlanKey planKey)
public PlansControl deletePlan(@NotNull @NotNull PlanKey planKey)
planKey
- key of a Planpublic PlansControl deletePlanQuietly(@NotNull @NotNull PlanKey planKey)
planKey
- key of a Planpublic PlansControl enablePlan(@NotNull @NotNull PlanKey planKey)
planKey
- key of a Planpublic PlansControl disablePlan(@NotNull @NotNull PlanKey planKey)
planKey
- key of a Planpublic PlansControl deleteAllPlans()
triggerBackgroundDeletionAndWait()
afterwards.public PlansControl deleteAllPlansInProject(String projectKey)
triggerBackgroundDeletionAndWait()
afterwards.public void triggerBackgroundDeletionAndWait()
public RestPlanBranch getBranchByName(PlanKey key, String branchName) throws Exception
Exception
public com.atlassian.pageobjects.elements.query.TimedQuery<RestPlanBranch> getBranchByNameTimed(PlanKey key, String branchName) throws Exception
Exception
public RestPlanBranch waitUntilBranchIsCreated(PlanKey key, String branchName) throws Exception
Exception
public RestPlanBranch waitUntilBranchIsCreatedAndEnabled(PlanKey key, String branchName) throws Exception
Exception
public RestBranches getAllBranches(PlanKey key) throws Exception
Exception
public RestPlanBranch createBranch(PlanKey planKey, String vcsBranch, String branchName)
public RestPlan clonePlan(PlanKey planKeyToClone, PlanKey newPlanKey) throws Exception
Exception
public TriggerPlanBuilder triggerBuild()
public PlansControl triggerBuild(PlanKey planKey)
planKey
- which will be triggeredpublic PlansControl triggerBuildAndAwaitFailure(PlanKey planKey, int expectStatusCode)
public PlansControl triggerBuild(PlanKey planKey, Map<String,String> params)
planKey
- which will be triggeredparams
- additional params to be passed to the buildpublic void rerun(@NotNull @NotNull PlanResultKey planResultKey)
planResultKey
- build result to be rerunpublic void rerunFailedJobs(@NotNull @NotNull PlanResultKey planResultKey)
public RestQueuedBuild triggerBuildWithResponse(PlanKey planKey, Map<String,String> parameters)
public PlansControl triggerBuildAndAwaitCompletion(PlanKey planKey)
planKey
- key of the plan to triggerpublic PlansControl triggerBuildAndAwaitCompletion(PlanKey planKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
planKey
- key of the plan to triggerpublic Result getBuildResult(PlanResultKey planResultKey)
public Result getBuildResultWithArtifacts(PlanResultKey planResultKey)
public Result getBuildResult(PlanKey planKey, int buildNumber) throws Exception
Exception
public PlansControl triggerBuildAndAwaitSuccess(@NotNull @NotNull PlanKey planKey)
public PlansControl waitForSuccessfulBuild(@NotNull @NotNull PlanResultKey planResultKey)
public PlansControl waitForSuccessfulBuild(@NotNull @NotNull PlanKey planKey, int buildNumber)
public PlansControl waitForSuccessfulBuild(@NotNull @NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
public PlansControl waitForFailedBuild(@NotNull @NotNull PlanResultKey planResultKey)
public PlansControl waitForFailedBuild(@NotNull @NotNull PlanKey planKey, int buildNumber)
public PlansControl waitForFailedBuild(@NotNull @NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
public PlansControl waitForCompletedBuild(PlanResultKey key)
key
- plan result keypublic PlansControl waitForCompletedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
AssertionError
- if build is not completedpublic PlansControl waitForCompletedBuild(PlanKey planKey, int buildNumber)
public void waitUntilPlanIsUpdated(PlanKey planKey, int buildNumber)
public void waitUntilPlanIsAffectedInSuccessfulSpecsRun(PlanKey planKey, int buildNumber)
public String waitUntilPlanIsAffectedInFailedSpecsRun(PlanKey planKey, int buildNumber)
public PlansControl waitForCompletedBuild(PlanKey planKey, int buildNumber, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout waitTimeout)
public PlansControl waitForStartedBuild(PlanKey planKey, int buildNumber)
@NotNull public @NotNull PlansControl waitForStartedBuild(PlanResultKey key)
@NotNull public @NotNull PlansControl waitForStartedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
@NotNull public @NotNull PlansControl waitForQueuedBuild(PlanResultKey key)
@NotNull public @NotNull PlansControl waitForQueuedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
@NotNull public @NotNull PlansControl waitForQueuedOrStartedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
public PlansControl waitForFinishedBuild(PlanKey planKey, int buildNumber)
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)
public RestStageList getStages(PlanKey planKey) throws Exception
Exception
public com.atlassian.bamboo.specs.api.model.plan.PlanProperties createPlan(com.atlassian.bamboo.specs.api.builders.plan.Plan plan) throws Exception
Exception
public com.atlassian.bamboo.specs.api.model.plan.PlanProperties createOrUpdatePlan(TestUser user, com.atlassian.bamboo.specs.api.builders.plan.Plan plan) throws Exception
Exception
public PlanKey createPlan(TestBuildDetails buildDetails) throws Exception
Exception
public void tearDown()
BackdoorControl
tearDown
in class BackdoorControl<PlansControl>
public void deleteBuildResult(@NotNull @NotNull PlanResultKey planResultKey) throws Exception
Exception
@NotNull public @NotNull List<RestVariableDefinition> getPlanVariables(@NotNull @NotNull PlanKey planKey)
@NotNull public @NotNull List<String> getTriggerNames(@NotNull @NotNull PlanKey planKey)
@NotNull public @NotNull List<RestTrigger> getTriggers(@NotNull @NotNull PlanKey planKey)
public PlansControl addPlanVariable(PlanKey planKey, String variableName, String variableValue)
public PlansControl deletePlanVariable(PlanKey planKey, String variableName)
public PlansControl createArtifact(PlanKey producerJobKey, Consumer<TestArtifactDetails.Builder> consumer)
public String getPlanRootArtifactDirectory(PlanKey planKey)
planKey
- public PlansControl addCustomRequirement(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull String requirementKey)
public RestRequirement addGetCustomRequirement(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull String requirementKey)
public List<RestRequirement> getRequirementsForJob(@NotNull @NotNull PlanKey jobKey)
public long getPlanId(PlanKey key)
public RestDockerPipelineConfiguration getDockerPipelineConfiguration(String jobKey)
public List<RestRepository> getPlanRepositories(@NotNull @NotNull PlanKey planKey)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.