use of com.thoughtworks.go.config.ArtifactConfigs 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.ArtifactConfigs in project gocd by gocd.
the class ArtifactConfigsTest method shouldAddDuplicatedArtifactSoThatValidationKicksIn.
@Test
public void shouldAddDuplicatedArtifactSoThatValidationKicksIn() throws Exception {
final ArtifactConfigs artifactConfigs = new ArtifactConfigs();
assertThat(artifactConfigs.size(), is(0));
artifactConfigs.add(new ArtifactConfig("src", "dest"));
artifactConfigs.add(new ArtifactConfig("src", "dest"));
assertThat(artifactConfigs.size(), is(2));
}
use of com.thoughtworks.go.config.ArtifactConfigs 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.ArtifactConfigs in project gocd by gocd.
the class ArtifactConfigsTest method shouldClearAllArtifactsWhenTheMapIsNull.
@Test
public void shouldClearAllArtifactsWhenTheMapIsNull() {
ArtifactConfigs artifactConfigs = new ArtifactConfigs();
artifactConfigs.add(new ArtifactConfig("src", "dest"));
artifactConfigs.setConfigAttributes(null);
assertThat(artifactConfigs.size(), is(0));
}
use of com.thoughtworks.go.config.ArtifactConfigs in project gocd by gocd.
the class ArtifactConfigsTest method shouldLoadArtifactPlans.
@Test
public void shouldLoadArtifactPlans() {
HashMap<String, String> artifactPlan1 = new HashMap<>();
artifactPlan1.put(SRC, "blah");
artifactPlan1.put(DEST, "something");
artifactPlan1.put("artifactTypeValue", TestArtifactConfig.TEST_PLAN_DISPLAY_NAME);
HashMap<String, String> artifactPlan2 = new HashMap<>();
artifactPlan2.put(SRC, "blah2");
artifactPlan2.put(DEST, "something2");
artifactPlan2.put("artifactTypeValue", ArtifactConfig.ARTIFACT_PLAN_DISPLAY_NAME);
List<HashMap> artifactPlansList = new ArrayList<>();
artifactPlansList.add(artifactPlan1);
artifactPlansList.add(artifactPlan2);
ArtifactConfigs artifactConfigs = new ArtifactConfigs();
artifactConfigs.setConfigAttributes(artifactPlansList);
assertThat(artifactConfigs.size(), is(2));
TestArtifactConfig plan = new TestArtifactConfig();
plan.setSource("blah");
plan.setDestination("something");
assertThat(artifactConfigs.get(0), is(plan));
assertThat(artifactConfigs.get(1), is(new ArtifactConfig("blah2", "something2")));
}
Aggregations