use of com.thoughtworks.go.config.ArtifactConfigs in project gocd by gocd.
the class ArtifactConfigsTest method shouldValidateTree.
@Test
public void shouldValidateTree() {
ArtifactConfigs artifactConfigs = new ArtifactConfigs();
artifactConfigs.add(new ArtifactConfig("src", "dest"));
artifactConfigs.add(new ArtifactConfig("src", "dest"));
artifactConfigs.add(new ArtifactConfig("src", "../a"));
artifactConfigs.validateTree(null);
assertThat(artifactConfigs.get(0).errors().on(ArtifactConfig.DEST), is("Duplicate artifacts defined."));
assertThat(artifactConfigs.get(0).errors().on(ArtifactConfig.SRC), is("Duplicate artifacts defined."));
assertThat(artifactConfigs.get(1).errors().on(ArtifactConfig.DEST), is("Duplicate artifacts defined."));
assertThat(artifactConfigs.get(1).errors().on(ArtifactConfig.SRC), is("Duplicate artifacts defined."));
assertThat(artifactConfigs.get(2).errors().on(ArtifactConfig.DEST), is("Invalid destination path. Destination path should match the pattern " + FilePathTypeValidator.PATH_PATTERN));
}
Aggregations