use of com.sequenceiq.cloudbreak.cloud.event.CloudPlatformResult in project cloudbreak by hortonworks.
the class StackImageUpdateActions method finishAction.
@Bean(name = "STACK_IMAGE_UPDATE_FINISHED")
public AbstractStackImageUpdateAction<?> finishAction() {
return new AbstractStackImageUpdateAction<>(CloudPlatformResult.class) {
@Override
protected void doExecute(StackContext context, CloudPlatformResult payload, Map<Object, Object> variables) {
getFlowMessageService().fireEventAndLog(context.getStack().getId(), Status.AVAILABLE.name(), STACK_IMAGE_UPDATE_FINISHED);
getStackUpdater().updateStackStatus(context.getStack().getId(), DetailedStackStatus.AVAILABLE);
sendEvent(context, new StackEvent(STACK_IMAGE_UPDATE_FINISHED_EVENT.event(), context.getStack().getId()));
}
};
}
use of com.sequenceiq.cloudbreak.cloud.event.CloudPlatformResult in project cloudbreak by hortonworks.
the class StackImageUpdateActionsTest method finishAction.
@Test
public void finishAction() {
FlowEvent flowEvent = Mockito.mock(FlowEvent.class);
when(stateContext.getEvent()).thenReturn(flowEvent);
when(flowEvent.name()).thenReturn(EVENT_NAME);
CloudPlatformResult payload = new CloudPlatformResult(1L);
when(stateContext.getMessageHeader(HEADERS.DATA.name())).thenReturn(payload);
when(state.getId()).thenReturn(StackImageUpdateState.STACK_IMAGE_UPDATE_FINISHED);
finishAction.execute(stateContext);
verify(flowMessageService, times(1)).fireEventAndLog(anyLong(), eq(Status.AVAILABLE.name()), eq(ResourceEvent.STACK_IMAGE_UPDATE_FINISHED));
}
Aggregations