Search in sources :

Example 61 with FileConfigOrigin

use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.

the class MergePipelineConfigsTest method createEmpty.

@Override
protected PipelineConfigs createEmpty() {
    BasicPipelineConfigs pipelineConfigs = new BasicPipelineConfigs();
    pipelineConfigs.setOrigin(new FileConfigOrigin());
    return new MergePipelineConfigs(pipelineConfigs);
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin)

Example 62 with FileConfigOrigin

use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.

the class MergePipelineConfigsTest method createWithPipeline.

@Override
protected PipelineConfigs createWithPipeline(PipelineConfig pipelineConfig) {
    BasicPipelineConfigs pipelineConfigsLocal = new BasicPipelineConfigs(pipelineConfig);
    pipelineConfigsLocal.setOrigin(new FileConfigOrigin());
    BasicPipelineConfigs pipelineConfigsRemote = new BasicPipelineConfigs();
    pipelineConfigsRemote.setOrigin(new RepoConfigOrigin());
    return new MergePipelineConfigs(pipelineConfigsRemote, pipelineConfigsLocal);
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) RepoConfigOrigin(com.thoughtworks.go.config.remote.RepoConfigOrigin)

Example 63 with FileConfigOrigin

use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.

the class MergePipelineConfigsTest method shouldReturnFilePartForGetLocalWhenHasRemoteAndFilePart.

@Test
public void shouldReturnFilePartForGetLocalWhenHasRemoteAndFilePart() {
    BasicPipelineConfigs filePart = new BasicPipelineConfigs();
    filePart.setOrigin(new FileConfigOrigin());
    BasicPipelineConfigs secondPart = new BasicPipelineConfigs();
    secondPart.setOrigin(new RepoConfigOrigin());
    MergePipelineConfigs merge = new MergePipelineConfigs(filePart, secondPart);
    assertThat(merge.getLocal(), Matchers.<PipelineConfigs>is(filePart));
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) RepoConfigOrigin(com.thoughtworks.go.config.remote.RepoConfigOrigin) Test(org.junit.jupiter.api.Test)

Example 64 with FileConfigOrigin

use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.

the class MergePipelineConfigsTest method shouldReturnFirstEditablePartWhenExists.

@Test
public void shouldReturnFirstEditablePartWhenExists() {
    PipelineConfig pipe1 = PipelineConfigMother.pipelineConfig("pipeline1");
    BasicPipelineConfigs part1 = new BasicPipelineConfigs(pipe1);
    part1.setOrigin(new FileConfigOrigin());
    MergePipelineConfigs group = new MergePipelineConfigs(part1, new BasicPipelineConfigs());
    assertThat(group.getFirstEditablePartOrNull(), Matchers.<PipelineConfigs>is(part1));
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) Test(org.junit.jupiter.api.Test)

Example 65 with FileConfigOrigin

use of com.thoughtworks.go.config.remote.FileConfigOrigin in project gocd by gocd.

the class MergePipelineConfigsTest method createWithPipelines.

@Override
protected PipelineConfigs createWithPipelines(PipelineConfig first, PipelineConfig second) {
    BasicPipelineConfigs pipelineConfigsLocal = new BasicPipelineConfigs(first, second);
    pipelineConfigsLocal.setOrigin(new FileConfigOrigin());
    BasicPipelineConfigs pipelineConfigsRemote = new BasicPipelineConfigs();
    pipelineConfigsRemote.setOrigin(new RepoConfigOrigin());
    return new MergePipelineConfigs(pipelineConfigsLocal, pipelineConfigsRemote);
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) RepoConfigOrigin(com.thoughtworks.go.config.remote.RepoConfigOrigin)

Aggregations

FileConfigOrigin (com.thoughtworks.go.config.remote.FileConfigOrigin)72 Test (org.junit.jupiter.api.Test)48 RepoConfigOrigin (com.thoughtworks.go.config.remote.RepoConfigOrigin)25 Test (org.junit.Test)10 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)6 MergeEnvironmentConfig (com.thoughtworks.go.config.merge.MergeEnvironmentConfig)4 BasicPipelineConfigs (com.thoughtworks.go.config.BasicPipelineConfigs)3 PipelineConfigs (com.thoughtworks.go.config.PipelineConfigs)3 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)3 ConfigOrigin (com.thoughtworks.go.config.remote.ConfigOrigin)3 ConfigRepoConfig (com.thoughtworks.go.config.remote.ConfigRepoConfig)3 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)3 MergePipelineConfigs (com.thoughtworks.go.config.merge.MergePipelineConfigs)2 UIConfigOrigin (com.thoughtworks.go.config.remote.UIConfigOrigin)2 GoCipher (com.thoughtworks.go.security.GoCipher)2 BasicEnvironmentConfig (com.thoughtworks.go.config.BasicEnvironmentConfig)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 RecordNotFoundException (com.thoughtworks.go.config.exceptions.RecordNotFoundException)1 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)1 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)1