use of com.thoughtworks.go.presentation.pipelinehistory.JobHistory in project gocd by gocd.
the class StageMother method toStageInstanceModel.
public static StageInstanceModel toStageInstanceModel(Stage stage) {
StageInstanceModel stageInstanceModel = new StageInstanceModel(stage.getName(), String.valueOf(stage.getCounter()), stage.getResult(), stage.getIdentifier());
stageInstanceModel.setApprovalType(stage.getApprovalType());
stageInstanceModel.setApprovedBy(stage.getApprovedBy());
stageInstanceModel.setRerunOfCounter(stage.getRerunOfCounter());
JobHistory jobHistory = new JobHistory();
for (JobInstance jobInstance : stage.getJobInstances()) {
jobHistory.addJob(jobInstance.getName(), jobInstance.getState(), jobInstance.getResult(), jobInstance.getScheduledDate());
}
stageInstanceModel.setBuildHistory(jobHistory);
return stageInstanceModel;
}
use of com.thoughtworks.go.presentation.pipelinehistory.JobHistory in project gocd by gocd.
the class ViewCacheKeyTest method stageInstance.
private StageInstanceModel stageInstance(String name, int id, JobState state, JobResult jobResult) {
JobHistory jobs = new JobHistory();
jobs.addJob("dev", state, jobResult, new Date());
StageInstanceModel stageInstance = new StageInstanceModel(name, "2", jobs);
stageInstance.setId(id);
return stageInstance;
}
Aggregations