Search in sources :

Example 16 with PipelineConfigs

use of com.thoughtworks.go.config.PipelineConfigs in project gocd by gocd.

the class MaterialConfigServiceTest method setup.

@Before
public void setup() throws Exception {
    initMocks(this);
    user = "looser";
    when(securityService.hasViewPermissionForGroup(user, "group1")).thenReturn(true);
    when(securityService.hasViewPermissionForGroup(user, "group2")).thenReturn(false);
    when(securityService.hasViewPermissionForGroup(user, "group3")).thenReturn(true);
    PipelineConfigs pipelineGroup1 = new BasicPipelineConfigs();
    pipelineGroup1.setGroup("group1");
    PipelineConfig pipelineConfig1 = new PipelineConfig();
    GitMaterialConfig gitMaterialConfig1 = new GitMaterialConfig("http://test.com");
    pipelineConfig1.addMaterialConfig(gitMaterialConfig1);
    GitMaterialConfig getMaterialConfig2 = new GitMaterialConfig("http://crap.com");
    pipelineConfig1.addMaterialConfig(getMaterialConfig2);
    pipelineGroup1.add(pipelineConfig1);
    PipelineConfigs pipelineGroup2 = new BasicPipelineConfigs();
    pipelineGroup2.setGroup("group2");
    PipelineConfig pipelineConfig2 = new PipelineConfig();
    GitMaterialConfig gitMaterialConfig3 = new GitMaterialConfig("http://another.com");
    pipelineConfig2.addMaterialConfig(gitMaterialConfig3);
    pipelineGroup2.add(pipelineConfig2);
    PipelineConfigs pipelineGroup3 = new BasicPipelineConfigs();
    pipelineGroup3.setGroup("group3");
    PipelineConfig pipelineConfig3 = new PipelineConfig();
    GitMaterialConfig gitMaterialConfig4 = new GitMaterialConfig("http://test.com");
    pipelineConfig1.addMaterialConfig(gitMaterialConfig4);
    pipelineGroup3.add(pipelineConfig3);
    PipelineGroups pipelineGroups = new PipelineGroups(pipelineGroup1, pipelineGroup2, pipelineGroup3);
    when(goConfigService.groups()).thenReturn(pipelineGroups);
    materialConfigService = new MaterialConfigService(goConfigService, securityService);
}
Also used : PipelineGroups(com.thoughtworks.go.domain.PipelineGroups) PipelineConfig(com.thoughtworks.go.config.PipelineConfig) GitMaterialConfig(com.thoughtworks.go.config.materials.git.GitMaterialConfig) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) BasicPipelineConfigs(com.thoughtworks.go.config.BasicPipelineConfigs) Before(org.junit.Before)

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