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"));
}
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));
}
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"));
}
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()));
}
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()));
}
Aggregations