@Test public void shouldReturnTrueForPipelineThatInFirstGroup_WhenFirstGroupIsLocal() { PipelineConfigs group1 = createGroup("group1", createPipelineConfig("pipeline1", "stage1")); CruiseConfig config = new BasicCruiseConfig(new BasicCruiseConfig(group1), new PartialConfig()); assertThat( "shouldReturnTrueForPipelineThatInFirstGroup", config.isInFirstGroup(new CaseInsensitiveString("pipeline1")), is(true)); }
@Test public void shouldReturnTrueForPipelineThatInFirstGroup_WhenFirstGroupIsRemote() { CruiseConfig config = new BasicCruiseConfig( new BasicCruiseConfig(), PartialConfigMother.withPipelineInGroup("remote-pipe-1", "remote_group")); assertThat( "shouldReturnTrueForPipelineThatInFirstGroup", config.isInFirstGroup(new CaseInsensitiveString("remote-pipe-1")), is(true)); }
@Test public void shouldReturnFalseForPipelineThatNotInFirstGroup_WhenSecondGroupIsRemote() { PipelineConfigs group1 = createGroup("group1", createPipelineConfig("pipeline1", "stage1")); CruiseConfig config = new BasicCruiseConfig( new BasicCruiseConfig(group1), PartialConfigMother.withPipelineInGroup("remote-pipe-1", "remote_group")); assertThat( "shouldReturnFalseForPipelineThatNotInFirstGroup", config.isInFirstGroup(new CaseInsensitiveString("pipeline2")), is(false)); }