use of com.thoughtworks.go.plugin.access.configrepo.ErrorCollection in project gocd by gocd.
the class CRApprovalTest method shouldAppendPrettyLocationInErrors.
@Test
public void shouldAppendPrettyLocationInErrors() {
CRApproval a = new CRApproval();
ErrorCollection errors = new ErrorCollection();
a.getErrors(errors, "Pipeline abc");
String fullError = errors.getErrorsAsText();
assertThat(fullError, contains("Pipeline abc; Approval"));
assertThat(fullError, contains("Missing field 'type'"));
}
use of com.thoughtworks.go.plugin.access.configrepo.ErrorCollection in project gocd by gocd.
the class CRStageTest method shouldCheckErrorsInJobs.
@Test
public void shouldCheckErrorsInJobs() {
CRStage withNamelessJob = new CRStage("build", new CRJob());
ErrorCollection errors = new ErrorCollection();
withNamelessJob.getErrors(errors, "TEST");
String fullError = errors.getErrorsAsText();
assertThat(fullError, contains("TEST; Stage (build)"));
assertThat(fullError, contains("Missing field 'name'"));
}
use of com.thoughtworks.go.plugin.access.configrepo.ErrorCollection in project gocd by gocd.
the class CRTabTest method shouldDeserializeFromAPILikeObject.
@Test
public void shouldDeserializeFromAPILikeObject() {
String json = "{\n" + " \"name\": \"cobertura\",\n" + " \"path\": \"target/site/cobertura/index.html\"\n" + " }";
CRTab deserializedValue = gson.fromJson(json, CRTab.class);
assertThat(deserializedValue.getName(), is("cobertura"));
assertThat(deserializedValue.getPath(), is("target/site/cobertura/index.html"));
ErrorCollection errors = deserializedValue.getErrors();
assertTrue(errors.isEmpty());
}
use of com.thoughtworks.go.plugin.access.configrepo.ErrorCollection in project gocd by gocd.
the class CRTimerTest method shouldDeserializeFromAPILikeObject.
@Test
public void shouldDeserializeFromAPILikeObject() {
String json = "{\n" + " \"spec\": \"0 0 22 ? * MON-FRI\",\n" + " \"only_on_changes\": true\n" + " }";
CRTimer deserializedValue = gson.fromJson(json, CRTimer.class);
assertThat(deserializedValue.getTimerSpec(), is("0 0 22 ? * MON-FRI"));
assertThat(deserializedValue.isOnlyOnChanges(), is(true));
ErrorCollection errors = deserializedValue.getErrors();
assertTrue(errors.isEmpty());
}
use of com.thoughtworks.go.plugin.access.configrepo.ErrorCollection in project gocd by gocd.
the class CRTrackingToolTest method shouldDeserializeFromAPILikeObject.
@Test
public void shouldDeserializeFromAPILikeObject() {
String json = "{\n" + " \"link\": \"https://github.com/gocd/api.go.cd/issues/${ID}\",\n" + " \"regex\": \"##(d+)\"\n" + " }";
CRTrackingTool deserializedValue = gson.fromJson(json, CRTrackingTool.class);
assertThat(deserializedValue.getLink(), is("https://github.com/gocd/api.go.cd/issues/${ID}"));
assertThat(deserializedValue.getRegex(), is("##(d+)"));
ErrorCollection errors = deserializedValue.getErrors();
assertTrue(errors.isEmpty());
}
Aggregations