use of com.thoughtworks.go.config.ArtifactTypeConfigs in project gocd by gocd.
the class JobRepresenter method setArtifacts.
private static void setArtifacts(JobConfig jobConfig) {
ArtifactTypeConfigs artifactTypeConfigs = new ArtifactTypeConfigs();
jsonReader.readArrayIfPresent("artifacts", artifacts -> {
artifacts.forEach(artifact -> {
artifactTypeConfigs.add(ArtifactRepresenter.fromJSON(new JsonReader(artifact.getAsJsonObject())));
});
});
jobConfig.setArtifactTypeConfigs(artifactTypeConfigs);
}
use of com.thoughtworks.go.config.ArtifactTypeConfigs in project gocd by gocd.
the class ArtifactPlanTest method toArtifactPlans_shouldConvertArtifactConfigsToArtifactPlanList.
@Test
public void toArtifactPlans_shouldConvertArtifactConfigsToArtifactPlanList() {
final PluggableArtifactConfig artifactConfig = new PluggableArtifactConfig("id", "storeId", create("Foo", true, "Bar"));
final ArtifactTypeConfigs artifactTypeConfigs = new ArtifactTypeConfigs(Arrays.asList(new BuildArtifactConfig("source", "destination"), new TestArtifactConfig("test-source", "test-destination"), artifactConfig));
final List<ArtifactPlan> artifactPlans = ArtifactPlan.toArtifactPlans(artifactTypeConfigs);
assertThat(artifactPlans, containsInAnyOrder(new ArtifactPlan(ArtifactPlanType.file, "source", "destination"), new ArtifactPlan(ArtifactPlanType.unit, "test-source", "test-destination"), new ArtifactPlan(artifactConfig.toJSON())));
}
use of com.thoughtworks.go.config.ArtifactTypeConfigs in project gocd by gocd.
the class JobRepresenter method setArtifacts.
private static void setArtifacts(JobConfig jobConfig) {
ArtifactTypeConfigs artifactTypeConfigs = new ArtifactTypeConfigs();
jsonReader.readArrayIfPresent("artifacts", artifacts -> {
artifacts.forEach(artifact -> {
artifactTypeConfigs.add(ArtifactRepresenter.fromJSON(new JsonReader(artifact.getAsJsonObject())));
});
});
jobConfig.setArtifactTypeConfigs(artifactTypeConfigs);
}
use of com.thoughtworks.go.config.ArtifactTypeConfigs in project gocd by gocd.
the class JobRepresenter method setArtifacts.
private static void setArtifacts(JobConfig jobConfig) {
ArtifactTypeConfigs artifactTypeConfigs = new ArtifactTypeConfigs();
jsonReader.readArrayIfPresent("artifacts", artifacts -> {
artifacts.forEach(artifact -> {
artifactTypeConfigs.add(ArtifactRepresenter.fromJSON(new JsonReader(artifact.getAsJsonObject())));
});
});
jobConfig.setArtifactTypeConfigs(artifactTypeConfigs);
}
Aggregations