use of com.sequenceiq.datalake.flow.upgrade.ccm.event.UpgradeCcmStackEvent in project cloudbreak by hortonworks.
the class UpgradeCcmActionsTest method stackUpgradeHappyPath.
@Test
void stackUpgradeHappyPath() {
actionPayload = new UpgradeCcmStackEvent(ACTION_PAYLOAD_SELECTOR, SDX_ID, USER_ID);
setupContextWithPayload();
testUpgradeActionHappyPath(underTest::upgradeCcmStack);
UpgradeCcmStackRequest payload = (UpgradeCcmStackRequest) payloadArgumentCaptor.getValue();
assertThat(selectorArgumentCaptor.getValue()).isEqualTo(UpgradeCcmStackRequest.class.getSimpleName());
assertThat(payload.getResourceId()).isEqualTo(SDX_ID);
assertThat(payload.getUserId()).isEqualTo(USER_ID);
}
use of com.sequenceiq.datalake.flow.upgrade.ccm.event.UpgradeCcmStackEvent in project cloudbreak by hortonworks.
the class SdxReactorFlowManager method triggerCcmUpgradeFlow.
public FlowIdentifier triggerCcmUpgradeFlow(SdxCluster cluster) {
LOGGER.info("Trigger CCM Upgrade on Datalake for: {}", cluster);
String initiatorUserCrn = ThreadBasedUserCrnProvider.getUserCrn();
UpgradeCcmStackEvent event = new UpgradeCcmStackEvent(UPGRADE_CCM_UPGRADE_STACK_EVENT.event(), cluster.getId(), initiatorUserCrn);
return notify(event.selector(), event, cluster.getClusterName());
}
use of com.sequenceiq.datalake.flow.upgrade.ccm.event.UpgradeCcmStackEvent in project cloudbreak by hortonworks.
the class UpgradeCcmActions method upgradeCcmStack.
@Bean(name = "UPGRADE_CCM_UPGRADE_STACK_STATE")
public Action<?, ?> upgradeCcmStack() {
return new AbstractUpgradeCcmSdxAction<>(UpgradeCcmStackEvent.class) {
@Override
protected void doExecute(SdxContext context, UpgradeCcmStackEvent payload, Map<Object, Object> variables) {
LOGGER.info("Execute CCM upgrade stack flow for SDX: {}", payload.getResourceId());
UpgradeCcmStackRequest request = UpgradeCcmStackRequest.from(context);
sendEvent(context, request);
}
@Override
protected Object getFailurePayload(UpgradeCcmStackEvent payload, Optional<SdxContext> flowContext, Exception ex) {
return UpgradeCcmFailedEvent.from(payload, ex);
}
};
}
Aggregations