use of de.taimos.pipeline.aws.cloudformation.ParameterProvider in project pipeline-aws-plugin by jenkinsci.
the class ParameterParseTests method parseMap.
@Test
public void parseMap() throws IOException {
ParameterProvider parameterProvider = Mockito.mock(ParameterProvider.class);
Mockito.when(parameterProvider.getParams()).thenReturn(new HashMap<String, Object>() {
{
put("foo", "true");
put("baz", false);
put("bar", 25);
}
});
Collection<Parameter> parameters = ParameterParser.parse(new FilePath(temporaryFolder.newFolder()), parameterProvider);
Assertions.assertThat(parameters).containsExactlyInAnyOrder(new Parameter().withParameterKey("foo").withParameterValue("true"), new Parameter().withParameterKey("baz").withParameterValue("false"), new Parameter().withParameterKey("bar").withParameterValue("25"));
}
use of de.taimos.pipeline.aws.cloudformation.ParameterProvider in project pipeline-aws-plugin by jenkinsci.
the class ParameterParseTests method parseStringArray.
@Test
public void parseStringArray() throws IOException {
ParameterProvider parameterProvider = Mockito.mock(ParameterProvider.class);
Mockito.when(parameterProvider.getParams()).thenReturn(new String[] { "foo=bar", "baz=true" });
Collection<Parameter> parameters = ParameterParser.parse(new FilePath(temporaryFolder.newFolder()), parameterProvider);
Assertions.assertThat(parameters).containsExactlyInAnyOrder(new Parameter().withParameterKey("foo").withParameterValue("bar"), new Parameter().withParameterKey("baz").withParameterValue("true"));
}
use of de.taimos.pipeline.aws.cloudformation.ParameterProvider in project pipeline-aws-plugin by jenkinsci.
the class ParameterParseTests method parseStringList.
@Test
public void parseStringList() throws IOException {
ParameterProvider parameterProvider = Mockito.mock(ParameterProvider.class);
Mockito.when(parameterProvider.getParams()).thenReturn(Arrays.asList("foo=bar", "baz=true"));
Collection<Parameter> parameters = ParameterParser.parse(new FilePath(temporaryFolder.newFolder()), parameterProvider);
Assertions.assertThat(parameters).containsExactlyInAnyOrder(new Parameter().withParameterKey("foo").withParameterValue("bar"), new Parameter().withParameterKey("baz").withParameterValue("true"));
}
Aggregations