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(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(PlanKey jobKey,
String requirementKey) |
RestRequirement |
addGetCustomRequirement(PlanKey jobKey,
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(PlanResultKey planResultKey) |
PlansControl |
deletePlan(PlanKey planKey)
Delete plan
|
PlansControl |
deletePlanQuietly(PlanKey planKey)
Delete plan quietly
|
PlansControl |
deletePlanVariable(PlanKey planKey,
String variableName) |
PlansControl |
disablePlan(PlanKey planKey)
Disable plan
|
boolean |
doesPlanExistAsRecord(PlanKey planKey) |
PlansControl |
enablePlan(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(PlanKey planKey) |
List<RestRepository> |
getPlanRepositories(PlanKey planKey) |
String |
getPlanRootArtifactDirectory(PlanKey planKey)
Get the plan directory information for the plan
|
List<RestVariableDefinition> |
getPlanVariables(PlanKey planKey) |
List<RestRequirement> |
getRequirementsForJob(PlanKey jobKey) |
RestStageList |
getStages(PlanKey planKey) |
List<String> |
getTriggerNames(PlanKey planKey) |
boolean |
isPlanEnabled(PlanKey planKey) |
void |
rerun(PlanResultKey planResultKey)
Rebuild completed build.
|
void |
setPlanLabels(PlanKey planKey,
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(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(PlanKey planKey,
int buildNumber) |
PlansControl |
waitForFailedBuild(PlanResultKey planResultKey) |
PlansControl |
waitForFailedBuild(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)
|
PlansControl |
waitForQueuedBuild(PlanResultKey key) |
PlansControl |
waitForQueuedBuild(PlanResultKey key,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) |
PlansControl |
waitForQueuedOrStartedBuild(PlanResultKey key,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) |
PlansControl |
waitForStartedBuild(PlanKey planKey,
int buildNumber) |
PlansControl |
waitForStartedBuild(PlanResultKey key) |
PlansControl |
waitForStartedBuild(PlanResultKey key,
com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout) |
PlansControl |
waitForSuccessfulBuild(PlanKey planKey,
int buildNumber) |
PlansControl |
waitForSuccessfulBuild(PlanResultKey planResultKey) |
PlansControl |
waitForSuccessfulBuild(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 BambooEnvironmentData environmentData)
public boolean doesPlanExistAsRecord(@NotNull PlanKey planKey)
public boolean isPlanEnabled(@NotNull PlanKey planKey)
public PlansControl addCreatedPlan(PlanKey planKey)
public PlansControl deletePlan(@NotNull PlanKey planKey)
planKey
- key of a Planpublic PlansControl deletePlanQuietly(@NotNull PlanKey planKey)
planKey
- key of a Planpublic PlansControl enablePlan(@NotNull PlanKey planKey)
planKey
- key of a Planpublic PlansControl disablePlan(@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 PlanResultKey planResultKey)
planResultKey
- build result to be rerunpublic 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 PlanKey planKey)
public PlansControl waitForSuccessfulBuild(@NotNull PlanResultKey planResultKey)
public PlansControl waitForSuccessfulBuild(@NotNull PlanKey planKey, int buildNumber)
public PlansControl waitForSuccessfulBuild(@NotNull PlanResultKey planResultKey, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
public PlansControl waitForFailedBuild(@NotNull PlanResultKey planResultKey)
public PlansControl waitForFailedBuild(@NotNull PlanKey planKey, int buildNumber)
public PlansControl waitForFailedBuild(@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 PlansControl waitForStartedBuild(PlanResultKey key)
@NotNull public PlansControl waitForStartedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
@NotNull public PlansControl waitForQueuedBuild(PlanResultKey key)
@NotNull public PlansControl waitForQueuedBuild(PlanResultKey key, com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
@NotNull public 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 PlanResultKey planResultKey) throws Exception
Exception
@NotNull public List<RestVariableDefinition> getPlanVariables(@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 PlanKey jobKey, @NotNull String requirementKey)
public RestRequirement addGetCustomRequirement(@NotNull PlanKey jobKey, @NotNull String requirementKey)
public List<RestRequirement> getRequirementsForJob(@NotNull PlanKey jobKey)
public long getPlanId(PlanKey key)
public RestDockerPipelineConfiguration getDockerPipelineConfiguration(String jobKey)
public List<RestRepository> getPlanRepositories(@NotNull PlanKey planKey)
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.