Search in sources :

Example 1 with JSONParameterFileParser

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

the class ParameterParserTest method shouldParseJSON.

@Test
public void shouldParseJSON() throws Exception {
    JSONParameterFileParser parser = new JSONParameterFileParser();
    Collection<Parameter> parameters = parser.parseParams(this.getClass().getResourceAsStream("/params.json"));
    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("Value2", param2.getParameterValue());
}
Also used : JSONParameterFileParser(de.taimos.pipeline.aws.cloudformation.parser.JSONParameterFileParser) Parameter(com.amazonaws.services.cloudformation.model.Parameter) Test(org.junit.Test)

Aggregations

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