Search in sources :

Example 1 with YAMLParameterFileParser

use of de.taimos.pipeline.aws.cloudformation.parser.YAMLParameterFileParser in project pipeline-aws-plugin by jenkinsci.

the class ParameterParserTest method shouldParseYAML.

@Test
public void shouldParseYAML() throws Exception {
    YAMLParameterFileParser parser = new YAMLParameterFileParser();
    Collection<Parameter> parameters = parser.parseParams(this.getClass().getResourceAsStream("/params.yaml"));
    Parameter[] array = parameters.toArray(new Parameter[0]);
    Assert.assertEquals(2, array.length);
    Parameter param1 = array[0];
    Assert.assertEquals("Param1", param1.getParameterKey());
    Assert.assertEquals("Value1", param1.getParameterValue());
    Parameter param2 = array[1];
    Assert.assertEquals("Param2", param2.getParameterKey());
    Assert.assertEquals("Val2a,Val2b", param2.getParameterValue());
}
Also used : Parameter(com.amazonaws.services.cloudformation.model.Parameter) YAMLParameterFileParser(de.taimos.pipeline.aws.cloudformation.parser.YAMLParameterFileParser) Test(org.junit.Test)

Aggregations

Parameter (com.amazonaws.services.cloudformation.model.Parameter)1 YAMLParameterFileParser (de.taimos.pipeline.aws.cloudformation.parser.YAMLParameterFileParser)1 Test (org.junit.Test)1