use of com.thoughtworks.go.server.presentation.models.PipelineHistoryGroups in project gocd by gocd.
the class PipelineHistoryGroupingUtilTest method shouldCreateTwoGroupsWithMultiplePipelineHistoryItems.
@Test
public void shouldCreateTwoGroupsWithMultiplePipelineHistoryItems() throws Exception {
PipelineInstanceModel pipelineHistoryItem1 = PipelineHistoryItemMother.custom("stage1", "stage2");
PipelineInstanceModel pipelineHistoryItem2 = PipelineHistoryItemMother.custom("stage1", "stage3");
PipelineInstanceModels history = PipelineInstanceModels.createPipelineInstanceModels(pipelineHistoryItem1, pipelineHistoryItem2);
PipelineHistoryGroups historyGroups = groupingUtil.createGroups(history);
assertThat(historyGroups.size(), is(2));
assertThat(historyGroups.first().hasSameStagesAs(pipelineHistoryItem1), is(true));
assertThat(historyGroups.get(1).hasSameStagesAs(pipelineHistoryItem2), is(true));
}
use of com.thoughtworks.go.server.presentation.models.PipelineHistoryGroups in project gocd by gocd.
the class PipelineHistoryGroupingUtilTest method shouldNotCreateGroupForEmptyHistory.
@Test
public void shouldNotCreateGroupForEmptyHistory() throws Exception {
PipelineInstanceModels history = PipelineInstanceModels.createPipelineInstanceModels();
PipelineHistoryGroups historyGroups = groupingUtil.createGroups(history);
assertThat(historyGroups.size(), is(0));
}
use of com.thoughtworks.go.server.presentation.models.PipelineHistoryGroups in project gocd by gocd.
the class PipelineHistoryGroupingUtilTest method shouldCreateOneGroupForOnePipelineHistoryItem.
@Test
public void shouldCreateOneGroupForOnePipelineHistoryItem() throws Exception {
PipelineInstanceModel pipelineInstanceModel = PipelineHistoryItemMother.custom("stage1", "stage2");
PipelineHistoryGroups historyGroups = groupingUtil.createGroups(PipelineInstanceModels.createPipelineInstanceModels(pipelineInstanceModel));
assertThat(historyGroups.size(), is(1));
assertThat(historyGroups.first().hasSameStagesAs(pipelineInstanceModel), is(true));
}
use of com.thoughtworks.go.server.presentation.models.PipelineHistoryGroups in project gocd by gocd.
the class PipelineHistoryGroupingUtilTest method shouldCreateOneGroupWithMultiplePipelineHistoryItems.
@Test
public void shouldCreateOneGroupWithMultiplePipelineHistoryItems() throws Exception {
PipelineInstanceModel pipelineHistoryItem1 = PipelineHistoryItemMother.custom("stage1", "stage2");
PipelineInstanceModel pipelineHistoryItem2 = PipelineHistoryItemMother.custom("stage1", "stage2");
PipelineInstanceModels history = PipelineInstanceModels.createPipelineInstanceModels(pipelineHistoryItem1, pipelineHistoryItem2);
PipelineHistoryGroups historyGroups = groupingUtil.createGroups(history);
assertThat(historyGroups.size(), is(1));
assertThat(historyGroups.first().hasSameStagesAs(pipelineHistoryItem1), is(true));
assertThat(historyGroups.first().hasSameStagesAs(pipelineHistoryItem2), is(true));
}
use of com.thoughtworks.go.server.presentation.models.PipelineHistoryGroups in project gocd by gocd.
the class PipelineHistoryGroupingUtilTest method shouldCreateTwoGroupsWithOneGroupHasMultiplePipelineHistoryItems.
@Test
public void shouldCreateTwoGroupsWithOneGroupHasMultiplePipelineHistoryItems() throws Exception {
PipelineInstanceModel pipelineHistoryItem1 = PipelineHistoryItemMother.custom("stage1", "stage2");
PipelineInstanceModel pipelineHistoryItem2 = PipelineHistoryItemMother.custom("stage1", "stage2");
PipelineInstanceModel pipelineHistoryItem3 = PipelineHistoryItemMother.custom("stage2", "stage1");
PipelineInstanceModel pipelineHistoryItem4 = PipelineHistoryItemMother.custom("stage1", "stage3");
PipelineInstanceModels history = PipelineInstanceModels.createPipelineInstanceModels(pipelineHistoryItem1, pipelineHistoryItem2, pipelineHistoryItem3, pipelineHistoryItem4);
PipelineHistoryGroups historyGroups = groupingUtil.createGroups(history);
assertThat(historyGroups.size(), is(3));
assertThat(historyGroups.first().hasSameStagesAs(pipelineHistoryItem1), is(true));
assertThat(historyGroups.get(1).hasSameStagesAs(pipelineHistoryItem3), is(true));
assertThat(historyGroups.get(2).hasSameStagesAs(pipelineHistoryItem4), is(true));
}
Aggregations