use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class MingleConfigTest method shouldRenderStringWithSpecifiedRegexAndLink.
@Test
public void shouldRenderStringWithSpecifiedRegexAndLink() throws Exception {
MingleConfig config = new MingleConfig("http://mingle05", "cce");
String result = config.render("#111: checkin message");
assertThat(result, is("<a href=\"" + "http://mingle05/projects/cce/cards/111\" target=\"story_tracker\">#111</a>: checkin message"));
}
use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class MingleConfigTest method shouldValidateEmptyConfig.
@Test
public void shouldValidateEmptyConfig() {
MingleConfig config = new MingleConfig();
config.validate(null);
assertThat(config.errors().isEmpty(), is(true));
}
use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class MingleConfigTest method shouldSetMingleConfigFromConfigAttributes.
@Test
public void shouldSetMingleConfigFromConfigAttributes() {
MingleConfig mingleConfig = new MingleConfig();
Map configMap = new HashMap();
configMap.put(MingleConfig.BASE_URL, "http://mingle01.tw.com/mingle");
configMap.put(MingleConfig.PROJECT_IDENTIFIER, "go");
configMap.put(MingleConfig.MQL_GROUPING_CONDITIONS, new SingletonMap(MqlCriteria.MQL, "Some MQL"));
mingleConfig.setConfigAttributes(configMap);
assertThat(mingleConfig.getBaseUrl(), is("http://mingle01.tw.com/mingle"));
assertThat(mingleConfig.getProjectIdentifier(), is("go"));
assertThat(mingleConfig.getMqlCriteria().getMql(), is("Some MQL"));
}
use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class MingleConfigTest method shouldReturnInvalidIfTheURLIsNotAHTTPSURL.
@Test
public void shouldReturnInvalidIfTheURLIsNotAHTTPSURL() {
MingleConfig mingleConfig = new MingleConfig("http://some-mingle-instance", "go");
mingleConfig.validate(new ConfigSaveValidationContext(null));
assertThat(mingleConfig.errors().isEmpty(), is(false));
assertThat(mingleConfig.errors().on(MingleConfig.PROJECT_IDENTIFIER), is(nullValue()));
assertThat(mingleConfig.errors().on(MingleConfig.BASE_URL), is("Should be a URL starting with https://"));
}
use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class ViewCacheKeyTest method shouldGenerateKeyForBuildCause.
@Test
public void shouldGenerateKeyForBuildCause() {
PipelineModel model = new PipelineModel("pipelineName", true, true, PipelinePauseInfo.notPaused());
PipelineInstanceModel pipelineInstance = PipelineInstanceModel.createPipeline("pipelineName", 10, "label-10", BuildCause.createExternal(), new StageInstanceModels());
pipelineInstance.setId(12);
TrackingTool trackingTool = new TrackingTool("link", "regex");
pipelineInstance.setTrackingTool(trackingTool);
model.addPipelineInstance(pipelineInstance);
PipelineInstanceModel pipelineInstance2 = PipelineInstanceModel.createPipeline("pipelineName", 7, "label-7", BuildCause.createExternal(), new StageInstanceModels());
pipelineInstance2.setId(14);
MingleConfig mingleConfig = new MingleConfig("mingle", "project", "mql");
pipelineInstance2.setMingleConfig(mingleConfig);
model.addPipelineInstance(pipelineInstance2);
assertThat(viewCacheKey.forPipelineModelBuildCauses(model), is(String.format("view_buildCausesForPipelineModel_pipelineName[12|%s|%s][14|%s|%s]", trackingTool.hashCode(), -1, -1, mingleConfig.hashCode())));
}
Aggregations