use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldPassCheckingWhenUserHasPermissionForManualTrigger.
@Test
public void shouldPassCheckingWhenUserHasPermissionForManualTrigger() throws Exception {
Pipeline pipeline = pipelineFixture.createdPipelineWithAllStagesPassed();
configFileHelper.addAuthorizedUserForStage(pipeline.getName(), pipelineFixture.devStage, APPROVED_USER);
assertTrue(schedulingChecker.canManuallyTrigger(pipelineFixture.pipelineConfig(), APPROVED_USER, new ServerHealthStateOperationResult()));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldNotPassCheckingWhenAnyStageIsActiveInPipelineForManualTrigger.
@Test
public void shouldNotPassCheckingWhenAnyStageIsActiveInPipelineForManualTrigger() throws Exception {
Pipeline pipeline = pipelineFixture.createPipelineWithFirstStageScheduled();
String username = APPROVED_USER;
PipelineConfig pipelineConfig = pipelineFixture.pipelineConfig();
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
assertThat(schedulingChecker.canManuallyTrigger(pipelineConfig, username, result), is(false));
assertThat(result.getServerHealthState().getDescription(), containsString("still in progress"));
assertThat(result.getServerHealthState().getDescription(), containsString(pipeline.getName()));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldNotPassCheckingWhenUserHasNoPermissionForManualTrigger.
@Test
public void shouldNotPassCheckingWhenUserHasNoPermissionForManualTrigger() throws Exception {
pipelineFixture.createdPipelineWithAllStagesPassed();
pipelineFixture.configStageAsManualApprovalWithApprovedUsers(pipelineFixture.devStage, APPROVED_USER);
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
assertThat(schedulingChecker.canManuallyTrigger(pipelineFixture.pipelineConfig(), "gli", result), is(false));
assertThat(result.getServerHealthState().getDescription(), containsString("does not have permission"));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldNotPassCheckingWhenTargetStageIsActiveInAnyPipelineForRerun.
@Test
public void shouldNotPassCheckingWhenTargetStageIsActiveInAnyPipelineForRerun() throws Exception {
Pipeline pipeline = pipelineFixture.createdPipelineWithAllStagesPassed();
pipelineFixture.createPipelineWithFirstStageScheduled();
configFileHelper.addAuthorizedUserForStage(pipeline.getName(), pipelineFixture.devStage, APPROVED_USER);
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
assertThat(schedulingChecker.canScheduleStage(pipeline.getIdentifier(), pipelineFixture.devStage, APPROVED_USER, result), is(false));
assertThat(result.getServerHealthState().getDescription(), containsString("still in progress"));
assertThat(result.getServerHealthState().getDescription(), containsString(pipeline.getName()));
assertThat(result.getServerHealthState().getDescription(), containsString(pipelineFixture.devStage));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldNotPassCheckingWhenTargetStageIsActiveInAnyPipelineForManualTrigger.
@Test
public void shouldNotPassCheckingWhenTargetStageIsActiveInAnyPipelineForManualTrigger() throws Exception {
Pipeline pipeline = pipelineFixture.createdPipelineWithAllStagesPassed();
pipelineFixture.createPipelineWithFirstStageScheduled();
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
assertThat(schedulingChecker.canManuallyTrigger(pipelineFixture.pipelineConfig(), APPROVED_USER, result), is(false));
assertThat(result.getServerHealthState().getDescription(), containsString("still in progress"));
assertThat(result.getServerHealthState().getDescription(), containsString(pipeline.getName()));
assertThat(result.getServerHealthState().getDescription(), containsString(pipelineFixture.devStage));
}
Aggregations