@Test public void shouldSetToDefaultGroupWithGroupNameIsEmptyString() { PipelineConfigs pipelineConfigs = createEmpty(); pipelineConfigs.setGroup(""); assertThat(pipelineConfigs.getGroup(), is(BasicPipelineConfigs.DEFAULT_GROUP)); }
@Test public void shouldReturnIndexOfPipeline() { PipelineConfigs group = createWithPipeline(PipelineConfigMother.pipelineConfig("pipeline1")); PipelineConfig pipelineConfig = (PipelineConfig) group.get(0).clone(); pipelineConfig.setLabelTemplate("blah"); group.update(group.getGroup(), pipelineConfig, "pipeline1"); assertThat(group.get(0).getLabelTemplate(), is("blah")); }
public List<PipelineConfigs> viewableGroupsFor(Username username) { ArrayList<PipelineConfigs> list = new ArrayList<PipelineConfigs>(); for (PipelineConfigs pipelineConfigs : goConfigService.getCurrentConfig().getGroups()) { if (hasViewPermissionForGroup( CaseInsensitiveString.str(username.getUsername()), pipelineConfigs.getGroup())) { list.add(pipelineConfigs); } } return list; }