Search in sources :

Example 1 with ParameterProvider

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"));
}
Also used : FilePath(hudson.FilePath) ParameterProvider(de.taimos.pipeline.aws.cloudformation.ParameterProvider) Parameter(com.amazonaws.services.cloudformation.model.Parameter) Test(org.junit.Test)

Example 2 with ParameterProvider

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"));
}
Also used : FilePath(hudson.FilePath) ParameterProvider(de.taimos.pipeline.aws.cloudformation.ParameterProvider) Parameter(com.amazonaws.services.cloudformation.model.Parameter) Test(org.junit.Test)

Example 3 with ParameterProvider

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"));
}
Also used : FilePath(hudson.FilePath) ParameterProvider(de.taimos.pipeline.aws.cloudformation.ParameterProvider) Parameter(com.amazonaws.services.cloudformation.model.Parameter) Test(org.junit.Test)

Aggregations

Parameter (com.amazonaws.services.cloudformation.model.Parameter)3 ParameterProvider (de.taimos.pipeline.aws.cloudformation.ParameterProvider)3 FilePath (hudson.FilePath)3 Test (org.junit.Test)3