Search in sources :

Example 11 with PluggableArtifactConfig

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)));
}
Also used : PluggableArtifactConfig(com.thoughtworks.go.config.PluggableArtifactConfig) PluggableArtifactConfig(com.thoughtworks.go.config.PluggableArtifactConfig) TestArtifactConfig(com.thoughtworks.go.config.TestArtifactConfig) ArtifactConfig(com.thoughtworks.go.config.ArtifactConfig) ArtifactConfigs(com.thoughtworks.go.config.ArtifactConfigs) Test(org.junit.Test)

Example 12 with PluggableArtifactConfig

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")));
}
Also used : PluggableArtifactConfig(com.thoughtworks.go.config.PluggableArtifactConfig) PluggableArtifactConfig(com.thoughtworks.go.config.PluggableArtifactConfig) TestArtifactConfig(com.thoughtworks.go.config.TestArtifactConfig) ArtifactConfig(com.thoughtworks.go.config.ArtifactConfig) ArtifactConfigs(com.thoughtworks.go.config.ArtifactConfigs) Test(org.junit.Test)

Example 13 with PluggableArtifactConfig

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")));
}
Also used : PluggableArtifactConfig(com.thoughtworks.go.config.PluggableArtifactConfig) ArtifactConfigs(com.thoughtworks.go.config.ArtifactConfigs) Test(org.junit.Test)

Example 14 with PluggableArtifactConfig

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);
}
Also used : PluggableArtifactConfig(com.thoughtworks.go.config.PluggableArtifactConfig) ArtifactPlan(com.thoughtworks.go.domain.ArtifactPlan) ArtifactStore(com.thoughtworks.go.config.ArtifactStore) Test(org.junit.Test)

Aggregations

PluggableArtifactConfig (com.thoughtworks.go.config.PluggableArtifactConfig)14 Test (org.junit.Test)14 ArtifactStore (com.thoughtworks.go.config.ArtifactStore)8 ArtifactStores (com.thoughtworks.go.config.ArtifactStores)7 PublishArtifactResponse (com.thoughtworks.go.plugin.access.artifact.model.PublishArtifactResponse)6 ArtifactConfigs (com.thoughtworks.go.config.ArtifactConfigs)5 ArtifactConfig (com.thoughtworks.go.config.ArtifactConfig)3 TestArtifactConfig (com.thoughtworks.go.config.TestArtifactConfig)3 GoPublisher (com.thoughtworks.go.work.GoPublisher)2 IOException (java.io.IOException)2 ExpectedException (org.junit.rules.ExpectedException)2 InOrder (org.mockito.InOrder)2 ArtifactPlan (com.thoughtworks.go.domain.ArtifactPlan)1 Map (java.util.Map)1