use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class MingleConfigServiceIntegrationTest method shouldFetchMingleConfigForAGivenPipeline.
@Test
public void shouldFetchMingleConfigForAGivenPipeline() {
HttpLocalizedOperationResult result = new HttpLocalizedOperationResult();
MingleConfig mingleConfig = mingleConfigService.mingleConfigForPipelineNamed("foo", new Username(new CaseInsensitiveString("authorized_user")), result);
assertThat(mingleConfig, is(new MingleConfig("https://some-tracking-tool:8443", "project-super-secret", "hello=world")));
assertThat(result.isSuccessful(), is(true));
result = new HttpLocalizedOperationResult();
mingleConfig = mingleConfigService.mingleConfigForPipelineNamed("foo", new Username(new CaseInsensitiveString("admin")), result);
assertThat(mingleConfig, is(new MingleConfig("https://some-tracking-tool:8443", "project-super-secret", "hello=world")));
assertThat(result.isSuccessful(), is(true));
}
use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class MingleCardTest method shouldBeEqualToAnotherMingleCardWithSameConfigAndCardNumber.
@Test
public void shouldBeEqualToAnotherMingleCardWithSameConfigAndCardNumber() {
MingleCard card1 = new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234");
MingleCard card2 = new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234");
assertThat(card1.equals(card2), is(true));
}
use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class ViewCacheKey method forPipelineModelBuildCauses.
public String forPipelineModelBuildCauses(PipelineModel model) {
StringBuilder s = new StringBuilder();
s.append("view_buildCausesForPipelineModel_");
s.append(model.getName());
for (PipelineInstanceModel pim : model.getActivePipelineInstances()) {
TrackingTool trackingTool = pim.getTrackingTool();
MingleConfig mingleConfig = pim.getMingleConfig();
int trackingToolHash = trackingTool == null ? -1 : trackingTool.hashCode();
int mingleToolHash = mingleConfig == null ? -1 : mingleConfig.hashCode();
s.append("[").append(pim.getId()).append("|").append(trackingToolHash).append("|").append(mingleToolHash).append("]");
}
return s.toString();
}
use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class MingleConfigServiceIntegrationTest method shouldNotConsiderNoMingleConfigAnError.
@Test
public void shouldNotConsiderNoMingleConfigAnError() {
HttpLocalizedOperationResult result = new HttpLocalizedOperationResult();
MingleConfig mingleConfig = mingleConfigService.mingleConfigForPipelineNamed("bar", new Username(new CaseInsensitiveString("admin")), result);
assertThat(mingleConfig, is(nullValue()));
assertThat(result.isSuccessful(), is(true));
}
use of com.thoughtworks.go.config.MingleConfig in project gocd by gocd.
the class MingleConfigTest method shouldBuildUrlGivenPath.
@Test
public void shouldBuildUrlGivenPath() throws Exception {
MingleConfig mingleConfig = new MingleConfig("http://foo.bar:7019/baz", "go-project");
assertThat(mingleConfig.urlFor("/cards/123"), is("http://foo.bar:7019/baz/cards/123"));
assertThat(mingleConfig.urlFor("cards/123"), is("http://foo.bar:7019/bazcards/123"));
mingleConfig = new MingleConfig("http://foo.bar:7019/baz/", "go-project");
assertThat(mingleConfig.urlFor("/cards/123"), is("http://foo.bar:7019/baz/cards/123"));
assertThat(mingleConfig.urlFor("cards/123"), is("http://foo.bar:7019/baz/cards/123"));
mingleConfig = new MingleConfig("http://foo.bar:7019", "go-project");
assertThat(mingleConfig.urlFor("/cards/123"), is("http://foo.bar:7019/cards/123"));
mingleConfig = new MingleConfig("http://foo.bar:7019/quux?hi=there", "go-project");
assertThat(mingleConfig.urlFor("/cards/123"), is("http://foo.bar:7019/quux/cards/123?hi=there"));
}
Aggregations