use of com.thoughtworks.go.config.PipelineConfigs in project gocd by gocd.
the class BasicPipelineConfigsTest method shouldReturnSelfForGetLocalPartsWhenOriginIsFile.
@Test
public void shouldReturnSelfForGetLocalPartsWhenOriginIsFile() {
PipelineConfigs pipelineConfigs = createEmpty();
pipelineConfigs.setOrigins(new FileConfigOrigin());
assertThat(pipelineConfigs.getLocal().size(), is(0));
assertSame(pipelineConfigs, pipelineConfigs.getLocal());
}
use of com.thoughtworks.go.config.PipelineConfigs in project gocd by gocd.
the class BasicPipelineConfigsTest method shouldReturnSelfForGetLocalWhenOriginIsNull.
@Test
public void shouldReturnSelfForGetLocalWhenOriginIsNull() {
PipelineConfigs pipelineConfigs = createEmpty();
assertThat(pipelineConfigs.getLocal().size(), is(0));
assertSame(pipelineConfigs, pipelineConfigs.getLocal());
}
use of com.thoughtworks.go.config.PipelineConfigs in project gocd by gocd.
the class BasicPipelineConfigsTest method shouldReturnNullGetLocalPartsWhenOriginIsRepo.
@Test
public void shouldReturnNullGetLocalPartsWhenOriginIsRepo() {
PipelineConfigs pipelineConfigs = createEmpty();
pipelineConfigs.setOrigins(new RepoConfigOrigin());
assertNull(pipelineConfigs.getLocal());
}
use of com.thoughtworks.go.config.PipelineConfigs in project gocd by gocd.
the class CcTrayViewAuthorityTest method shouldNotConsiderAllUsersAsViewersOfAGroup_WhenExplicitGroupAdminIsSetup.
@Test
public void shouldNotConsiderAllUsersAsViewersOfAGroup_WhenExplicitGroupAdminIsSetup() throws Exception {
configMother.addPipelineWithGroup(config, "group1", "pipeline1", "stage1A", "job1A1", "job1A2");
configMother.addAdminUserForPipelineGroup(config, "groupadmin1", "group1");
PipelineConfigs group = config.findGroup("group1");
assertThat(group.getAuthorization(), is(not(new Authorization())));
Viewers viewersOfGroup1 = getGroupsAndTheirViewers().get("group1");
assertThat(viewersOfGroup1.contains("groupadmin1"), is(true));
assertThat(viewersOfGroup1.contains("some-user"), is(false));
assertThat(viewersOfGroup1.contains("some-other-user"), is(false));
}
use of com.thoughtworks.go.config.PipelineConfigs in project gocd by gocd.
the class CcTrayViewAuthorityTest method shouldConsiderAllUsersAsViewersOfAGroupWithNoAuthorizationConfigurationSetup.
@Test
public void shouldConsiderAllUsersAsViewersOfAGroupWithNoAuthorizationConfigurationSetup() throws Exception {
configMother.addPipelineWithGroup(config, "group1", "pipeline1", "stage1A", "job1A1", "job1A2");
PipelineConfigs group = config.findGroup("group1");
assertThat(group.getAuthorization(), is(new Authorization()));
Viewers viewersOfGroup1 = getGroupsAndTheirViewers().get("group1");
assertThat(viewersOfGroup1.contains("some-user"), is(true));
assertThat(viewersOfGroup1.contains("some-other-user"), is(true));
assertThat(viewersOfGroup1.contains("any-random-user"), is(true));
}
Aggregations