use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModels in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method shouldLoadACertainNumberOfPipelines.
@Test
public void shouldLoadACertainNumberOfPipelines() throws Exception {
Pipeline pipeline = pipelineOne.createdPipelineWithAllStagesPassed();
configHelper.setViewPermissionForGroup("group1", "anyone");
PipelineInstanceModels history = pipelineHistoryService.findPipelineInstances(pipelineOne.pipelineName, "latest", 3, "anyone");
assertThat(history.get(0).getName(), is(pipeline.getName()));
assertThat(history.get(0).getLabel(), is(pipeline.getLabel()));
}
use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModels in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method shouldNotLoadPipelinesThatTheUserDoesNotHavePermissionToSee.
@Test
public void shouldNotLoadPipelinesThatTheUserDoesNotHavePermissionToSee() throws Exception {
configHelper.addSecurityWithAdminConfig();
configHelper.setViewPermissionForGroup("group1", "foo");
PipelineInstanceModels history = pipelineHistoryService.loadWithEmptyAsDefault(pipelineOne.pipelineName, Pagination.pageStartingAt(0, 1, 1), "non-admin-user");
assertThat(history.size(), is(0));
}
use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModels in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method shouldUnderstandIfEmptyPipelineHasNoNewModifications.
@Test
public void shouldUnderstandIfEmptyPipelineHasNoNewModifications() throws Exception {
configHelper.setViewPermissionForGroup("group1", "anyone");
PipelineInstanceModels models = pipelineHistoryService.findPipelineInstances(pipelineOne.pipelineName, "latest", 3, "anyone");
PipelineInstanceModel emptyModel = models.get(0);
assertThat(emptyModel.hasNewRevisions(), is(false));
}
use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModels in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method shouldMakePipelineInstanceCanRunFalseWhenFirstStageIsRunning.
@Test
public void shouldMakePipelineInstanceCanRunFalseWhenFirstStageIsRunning() throws Exception {
pipelineOne.createPipelineWithFirstStageScheduled();
configHelper.setViewPermissionForGroup("group1", "anyone");
PipelineInstanceModels pipelineInstanceModels = pipelineHistoryService.findPipelineInstances(pipelineOne.pipelineName, "latest", 1, "anyone");
assertThat(pipelineInstanceModels.get(0).getCanRun(), is(false));
}
use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModels in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method shouldLoadPipelineHistory.
@Test
public void shouldLoadPipelineHistory() throws Exception {
pipelineOne.createdPipelineWithAllStagesPassed();
PipelineInstanceModels history = pipelineHistoryService.load(pipelineOne.pipelineName, Pagination.pageStartingAt(0, 1, 10), "jez", true);
assertThat(history.size(), is(1));
StageInstanceModels stageHistory = history.first().getStageHistory();
assertThat(stageHistory.size(), is(3));
for (StageInstanceModel stageHistoryItem : stageHistory) {
assertThat(stageHistoryItem.isScheduled(), is(true));
assertThat(stageHistoryItem.getCanRun(), is(true));
}
}
Aggregations