Search in sources :

Example 1 with PipelineConfigs

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());
}
Also used : FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) Test(org.junit.Test)

Example 2 with PipelineConfigs

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());
}
Also used : PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) Test(org.junit.Test)

Example 3 with PipelineConfigs

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());
}
Also used : RepoConfigOrigin(com.thoughtworks.go.config.remote.RepoConfigOrigin) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) Test(org.junit.Test)

Example 4 with PipelineConfigs

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));
}
Also used : Authorization(com.thoughtworks.go.config.Authorization) AllowedViewers(com.thoughtworks.go.domain.cctray.viewers.AllowedViewers) Viewers(com.thoughtworks.go.domain.cctray.viewers.Viewers) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) Test(org.junit.Test)

Example 5 with PipelineConfigs

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));
}
Also used : Authorization(com.thoughtworks.go.config.Authorization) AllowedViewers(com.thoughtworks.go.domain.cctray.viewers.AllowedViewers) Viewers(com.thoughtworks.go.domain.cctray.viewers.Viewers) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) Test(org.junit.Test)

Aggregations

PipelineConfigs (com.thoughtworks.go.config.PipelineConfigs)16 Test (org.junit.Test)10 BasicPipelineConfigs (com.thoughtworks.go.config.BasicPipelineConfigs)7 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)6 Authorization (com.thoughtworks.go.config.Authorization)4 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)3 FileConfigOrigin (com.thoughtworks.go.config.remote.FileConfigOrigin)3 AllowedViewers (com.thoughtworks.go.domain.cctray.viewers.AllowedViewers)3 Viewers (com.thoughtworks.go.domain.cctray.viewers.Viewers)3 User (com.thoughtworks.go.domain.User)2 MaterialConfig (com.thoughtworks.go.domain.materials.MaterialConfig)2 Before (org.junit.Before)2 ModelAndView (org.springframework.web.servlet.ModelAndView)2 GsonBuilder (com.google.gson.GsonBuilder)1 AdminUser (com.thoughtworks.go.config.AdminUser)1 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)1 LdapConfig (com.thoughtworks.go.config.LdapConfig)1 MingleConfig (com.thoughtworks.go.config.MingleConfig)1 PasswordFileConfig (com.thoughtworks.go.config.PasswordFileConfig)1 SecurityConfig (com.thoughtworks.go.config.SecurityConfig)1