コード例 #1
0
 @Test
 public void shouldValidateGroupNameUniqueness() {
   Map<String, PipelineConfigs> nameToConfig = new HashMap<String, PipelineConfigs>();
   PipelineConfigs group1 = createEmpty();
   group1.setGroup("joe");
   PipelineConfigs group2 = createEmpty();
   group2.setGroup("joe");
   group1.validateNameUniqueness(nameToConfig);
   group2.validateNameUniqueness(nameToConfig);
   assertThat(
       group1.errors().on(PipelineConfigs.GROUP), is("Group with name 'joe' already exists"));
 }
コード例 #2
0
  @Test
  public void shouldSetToDefaultGroupWithGroupNameIsEmptyString() {
    PipelineConfigs pipelineConfigs = createEmpty();
    pipelineConfigs.setGroup("");

    assertThat(pipelineConfigs.getGroup(), is(BasicPipelineConfigs.DEFAULT_GROUP));
  }