Search in sources :

Example 51 with FileConfigOrigin

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

the class GoDashboardPipelineTest method shouldKnowWhetherAUserIsPipelineLevelOperator.

@Test
public void shouldKnowWhetherAUserIsPipelineLevelOperator() throws Exception {
    Permissions permissions = new Permissions(NoOne.INSTANCE, NoOne.INSTANCE, NoOne.INSTANCE, new AllowedUsers(s("pipeline_operator"), Collections.emptySet()));
    GoDashboardPipeline pipeline = new GoDashboardPipeline(new PipelineModel("pipeline1", false, false, notPaused()), permissions, "group1", mock(TimeStampBasedCounter.class), new FileConfigOrigin());
    assertTrue(pipeline.isPipelineOperator("pipeline_operator"));
    assertFalse(pipeline.canBeAdministeredBy("viewer1"));
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) AllowedUsers(com.thoughtworks.go.config.security.users.AllowedUsers) Permissions(com.thoughtworks.go.config.security.Permissions) PipelineModel(com.thoughtworks.go.presentation.pipelinehistory.PipelineModel) Test(org.junit.Test)

Example 52 with FileConfigOrigin

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

the class GoDashboardPipelineTest method shouldSetTheLastUpdateTime.

@Test
public void shouldSetTheLastUpdateTime() throws Exception {
    TimeStampBasedCounter provider = mock(TimeStampBasedCounter.class);
    when(provider.getNext()).thenReturn(1000L);
    GoDashboardPipeline pipeline = new GoDashboardPipeline(new PipelineModel("pipeline1", false, false, notPaused()), null, "group1", provider, new FileConfigOrigin());
    assertThat(pipeline.getLastUpdatedTimeStamp(), is(1000L));
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) PipelineModel(com.thoughtworks.go.presentation.pipelinehistory.PipelineModel) Test(org.junit.Test)

Example 53 with FileConfigOrigin

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

the class PipelineConfigTest method shouldReturnConfigRepoOriginDisplayNameWhenOriginIsFile.

@Test
public void shouldReturnConfigRepoOriginDisplayNameWhenOriginIsFile() {
    PipelineConfig pipelineConfig = new PipelineConfig();
    pipelineConfig.setOrigin(new FileConfigOrigin());
    assertThat(pipelineConfig.getOriginDisplayName(), is("cruise-config.xml"));
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) Test(org.junit.Test)

Example 54 with FileConfigOrigin

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

the class BasicPipelineConfigsTest method shouldSetOriginInAuthorization.

@Test
public void shouldSetOriginInAuthorization() {
    PipelineConfig pipe = PipelineConfigMother.pipelineConfig("pipeline1");
    PipelineConfigs group = new BasicPipelineConfigs(pipe);
    group.setOrigins(new FileConfigOrigin());
    assertThat(group.getAuthorization().getOrigin(), Is.<ConfigOrigin>is(new FileConfigOrigin()));
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) Test(org.junit.Test)

Example 55 with FileConfigOrigin

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

the class BasicPipelineConfigsTest method shouldSetOriginInPipelines.

@Test
public void shouldSetOriginInPipelines() {
    PipelineConfig pipe = PipelineConfigMother.pipelineConfig("pipeline1");
    PipelineConfigs group = new BasicPipelineConfigs(pipe);
    group.setOrigins(new FileConfigOrigin());
    assertThat(pipe.getOrigin(), Is.<ConfigOrigin>is(new FileConfigOrigin()));
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) Test(org.junit.Test)

Aggregations

FileConfigOrigin (com.thoughtworks.go.config.remote.FileConfigOrigin)59 Test (org.junit.Test)51 RepoConfigOrigin (com.thoughtworks.go.config.remote.RepoConfigOrigin)23 PipelineModel (com.thoughtworks.go.presentation.pipelinehistory.PipelineModel)5 MergeEnvironmentConfig (com.thoughtworks.go.config.merge.MergeEnvironmentConfig)4 ConfigRepoConfig (com.thoughtworks.go.config.remote.ConfigRepoConfig)4 Permissions (com.thoughtworks.go.config.security.Permissions)4 AllowedUsers (com.thoughtworks.go.config.security.users.AllowedUsers)4 BasicPipelineConfigs (com.thoughtworks.go.config.BasicPipelineConfigs)3 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)3 PipelineConfigs (com.thoughtworks.go.config.PipelineConfigs)3 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)3 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)3 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)3 MergePipelineConfigs (com.thoughtworks.go.config.merge.MergePipelineConfigs)2 BasicEnvironmentConfig (com.thoughtworks.go.config.BasicEnvironmentConfig)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)1 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)1 MergeConfigOrigin (com.thoughtworks.go.config.merge.MergeConfigOrigin)1