use of com.sequenceiq.cloudbreak.core.flow2.stack.provision.service.StackCreationService in project cloudbreak by hortonworks.
the class StackImageUpdateActionsTest method prepareImageAction.
@Test
public void prepareImageAction() {
FlowEvent flowEvent = Mockito.mock(FlowEvent.class);
when(stateContext.getEvent()).thenReturn(flowEvent);
when(flowEvent.name()).thenReturn(EVENT_NAME);
StackEvent payload = new StackEvent(StackImageUpdateEvent.UPDATE_IMAGE_FINESHED_EVENT.event(), 1L);
when(stateContext.getMessageHeader(HEADERS.DATA.name())).thenReturn(payload);
when(state.getId()).thenReturn(StackImageUpdateState.IMAGE_PREPARE_STATE);
prepareImageAction.execute(stateContext);
verify(stackCreationService, times(1)).prepareImage(any(Stack.class), eq(variables));
verify(eventBus, times(1)).notify(eq(CloudPlatformRequest.selector(PrepareImageRequest.class)), any(Event.class));
}
Aggregations