use of com.thoughtworks.go.config.PluggableArtifactConfig in project gocd by gocd.
the class ArtifactConfigsTest method getArtifactConfigs_shouldReturnBuiltinArtifactConfigs.
@Test
public void getArtifactConfigs_shouldReturnBuiltinArtifactConfigs() {
ArtifactConfigs allConfigs = new ArtifactConfigs();
allConfigs.add(new ArtifactConfig("src", "dest"));
allConfigs.add(new ArtifactConfig("java", null));
allConfigs.add(new PluggableArtifactConfig("s3", "cd.go.s3"));
allConfigs.add(new PluggableArtifactConfig("docker", "cd.go.docker"));
final List<ArtifactConfig> artifactConfigs = allConfigs.getArtifactConfigs();
assertThat(artifactConfigs, hasSize(2));
assertThat(artifactConfigs, containsInAnyOrder(new ArtifactConfig("src", "dest"), new ArtifactConfig("java", null)));
}
use of com.thoughtworks.go.config.PluggableArtifactConfig in project gocd by gocd.
the class ArtifactConfigsTest method getPluggableArtifactConfigs_shouldReturnPluggableArtifactConfigs.
@Test
public void getPluggableArtifactConfigs_shouldReturnPluggableArtifactConfigs() {
ArtifactConfigs allConfigs = new ArtifactConfigs();
allConfigs.add(new ArtifactConfig("src", "dest"));
allConfigs.add(new ArtifactConfig("java", null));
allConfigs.add(new PluggableArtifactConfig("s3", "cd.go.s3"));
allConfigs.add(new PluggableArtifactConfig("docker", "cd.go.docker"));
final List<PluggableArtifactConfig> artifactConfigs = allConfigs.getPluggableArtifactConfigs();
assertThat(artifactConfigs, hasSize(2));
assertThat(artifactConfigs, containsInAnyOrder(new PluggableArtifactConfig("s3", "cd.go.s3"), new PluggableArtifactConfig("docker", "cd.go.docker")));
}
use of com.thoughtworks.go.config.PluggableArtifactConfig in project gocd by gocd.
the class ArtifactConfigsTest method findByArtifactId_shouldReturnPluggableArtifactConfigs.
@Test
public void findByArtifactId_shouldReturnPluggableArtifactConfigs() {
ArtifactConfigs allConfigs = new ArtifactConfigs();
allConfigs.add(new PluggableArtifactConfig("s3", "cd.go.s3"));
allConfigs.add(new PluggableArtifactConfig("docker", "cd.go.docker"));
final PluggableArtifactConfig s3 = allConfigs.findByArtifactId("s3");
assertThat(s3, is(new PluggableArtifactConfig("s3", "cd.go.s3")));
}
use of com.thoughtworks.go.config.PluggableArtifactConfig in project gocd by gocd.
the class ArtifactMessageConverterV1Test method publishArtifactMessage_shouldSerializeToJson.
@Test
public void publishArtifactMessage_shouldSerializeToJson() throws JSONException {
final ArtifactMessageConverterV1 converter = new ArtifactMessageConverterV1();
final ArtifactStore artifactStore = new ArtifactStore("s3-store", "pluginId", create("Foo", false, "Bar"));
final ArtifactPlan artifactPlan = new ArtifactPlan(new PluggableArtifactConfig("installers", "s3-store", create("Baz", true, "Car")));
final String publishArtifactMessage = converter.publishArtifactMessage(artifactPlan, artifactStore, "/temp");
final String expectedStr = "{\n" + " \"artifact_plan\": {\n" + " \"configuration\": {\n" + " \"Baz\": \"Car\"\n" + " },\n" + " \"id\": \"installers\",\n" + " \"storeId\": \"s3-store\"\n" + " },\n" + " \"artifact_store\": {\n" + " \"configuration\": {\n" + " \"Foo\": \"Bar\"\n" + " },\n" + " \"id\": \"s3-store\"\n" + " },\n" + " \"agent_working_directory\": \"/temp\"\n" + "}";
JSONAssert.assertEquals(expectedStr, publishArtifactMessage, true);
}
Aggregations