use of com.thoughtworks.go.domain.materials.git.GitTestRepo in project gocd by gocd.
the class ScheduledPipelineLoaderIntegrationTest method shouldLoadShallowCloneFlagForGitMaterialsBaseOnTheirOwnPipelineConfig.
@Test
public void shouldLoadShallowCloneFlagForGitMaterialsBaseOnTheirOwnPipelineConfig(@TempDir Path tempDir) throws IOException {
GitTestRepo testRepo = new GitTestRepo(tempDir);
JobConfig jobConfig = new JobConfig("job-one");
jobConfig.addTask(new AntTask());
PipelineConfig shallowPipeline = PipelineConfigMother.pipelineConfig("shallowPipeline", new StageConfig(new CaseInsensitiveString("stage"), new JobConfigs(jobConfig)));
shallowPipeline.materialConfigs().clear();
shallowPipeline.addMaterialConfig(git(testRepo.projectRepositoryUrl(), true));
configHelper.addPipeline(shallowPipeline);
PipelineConfig fullPipeline = PipelineConfigMother.pipelineConfig("fullPipeline", new StageConfig(new CaseInsensitiveString("stage"), new JobConfigs(jobConfig)));
fullPipeline.materialConfigs().clear();
fullPipeline.addMaterialConfig(git(testRepo.projectRepositoryUrl(), false));
configHelper.addPipeline(fullPipeline);
Pipeline shallowPipelineInstance = createAndLoadModifyOneFilePipeline(shallowPipeline);
MaterialRevisions shallowRevisions = shallowPipelineInstance.getBuildCause().getMaterialRevisions();
assertThat(((GitMaterial) shallowRevisions.getRevisions().get(0).getMaterial()).isShallowClone(), is(true));
Pipeline fullPipelineInstance = createAndLoadModifyOneFilePipeline(fullPipeline);
MaterialRevisions fullRevisions = fullPipelineInstance.getBuildCause().getMaterialRevisions();
assertThat(((GitMaterial) fullRevisions.getRevisions().get(0).getMaterial()).isShallowClone(), is(false));
}
Aggregations