use of com.amazonaws.services.cloudformation.AmazonCloudFormation in project pipeline-aws-plugin by jenkinsci.
the class CloudformationStackTests method createStackWithTemplateUrl.
@Test
public void createStackWithTemplateUrl() throws ExecutionException {
TaskListener taskListener = Mockito.mock(TaskListener.class);
Mockito.when(taskListener.getLogger()).thenReturn(System.out);
AmazonCloudFormation client = Mockito.mock(AmazonCloudFormation.class);
Mockito.when(client.waiters()).thenReturn(new AmazonCloudFormationWaiters(client));
CloudFormationStack stack = new CloudFormationStack(client, "foo", taskListener);
stack.create(null, "bar", Collections.<Parameter>emptyList(), Collections.<Tag>emptyList(), 3, 21, "myarn", OnFailure.DO_NOTHING.toString());
ArgumentCaptor<CreateStackRequest> captor = ArgumentCaptor.forClass(CreateStackRequest.class);
Mockito.verify(client).createStack(captor.capture());
Assertions.assertThat(captor.getValue()).isEqualTo(new CreateStackRequest().withStackName("foo").withTemplateURL("bar").withCapabilities(Capability.values()).withParameters(Collections.<Parameter>emptyList()).withTimeoutInMinutes(3).withOnFailure(OnFailure.DO_NOTHING).withRoleARN("myarn"));
Mockito.verify(this.eventPrinter).waitAndPrintStackEvents(Mockito.eq("foo"), Mockito.any(Waiter.class), Mockito.eq(21L));
}
Aggregations