use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class UpgradeDistroxFlowEventChainFactoryTest method testChainQueueForReplaceVms.
@Test
public void testChainQueueForReplaceVms() {
ReflectionTestUtils.setField(underTest, "upgradeValidationEnabled", true);
Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairStartResult = Result.success(new HashMap<>());
when(clusterRepairService.validateRepair(any(), any(), any(), eq(false))).thenReturn(repairStartResult);
DistroXUpgradeTriggerEvent event = new DistroXUpgradeTriggerEvent(FlowChainTriggers.DISTROX_CLUSTER_UPGRADE_CHAIN_TRIGGER_EVENT, STACK_ID, imageChangeDto, true, true, "variant");
FlowTriggerEventQueue flowChainQueue = underTest.createFlowTriggerEventQueue(event);
assertEquals(5, flowChainQueue.getQueue().size());
assertUpdateValidationEvent(flowChainQueue);
assertSaltUpdateEvent(flowChainQueue);
assertUpgradeEvent(flowChainQueue);
assertImageUpdateEvent(flowChainQueue);
assertRepairEvent(flowChainQueue);
}
use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class DatalakeResizeFlowEventChainTest method chainCreationTest.
@Test
public void chainCreationTest() {
DatalakeResizeFlowChainStartEvent event = new DatalakeResizeFlowChainStartEvent(sdxCluster.getId(), sdxCluster, USER_CRN, BACKUP_LOCATION, true, true);
FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
assertEquals(7, flowTriggerEventQueue.getQueue().size());
assertTriggerBackupEvent(flowTriggerEventQueue);
}
use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class DatalakeResizeFlowEventChainTest method chainCreationWithRazTest.
@Test
public void chainCreationWithRazTest() {
SdxCluster clusterWithRaz = getValidSdxClusterwithRaz();
DatalakeResizeFlowChainStartEvent event = new DatalakeResizeFlowChainStartEvent(clusterWithRaz.getId(), clusterWithRaz, USER_CRN, BACKUP_LOCATION, true, true);
FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
assertEquals(7, flowTriggerEventQueue.getQueue().size());
assertTriggerBackupEvent(flowTriggerEventQueue);
}
use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class DatalakeResizeRecoveryFlowEventChainTest method chainCreationTestNewDLNull.
@Test
public void chainCreationTestNewDLNull() {
SdxCluster oldCluster = new SdxCluster();
oldCluster.setId(OLD_CLUSTER_SDX_ID);
oldCluster.setDetached(true);
DatalakeResizeRecoveryFlowChainStartEvent event = new DatalakeResizeRecoveryFlowChainStartEvent(oldCluster, null, USER_CRN);
FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
assertEquals(2, flowTriggerEventQueue.getQueue().size());
Queue<Selectable> flowQueue = flowTriggerEventQueue.getQueue();
checkEventIsDetachRecovery(flowQueue.remove());
checkEventIsStart(flowQueue.remove());
}
use of com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue in project cloudbreak by hortonworks.
the class DatalakeResizeRecoveryFlowEventChainTest method chainCreationTestNewDLAlreadyDeletedAndOldDLNotDetached.
@Test
public void chainCreationTestNewDLAlreadyDeletedAndOldDLNotDetached() {
SdxCluster oldCluster = new SdxCluster();
oldCluster.setId(OLD_CLUSTER_SDX_ID);
oldCluster.setDetached(false);
SdxCluster newCluster = new SdxCluster();
newCluster.setDeleted(1L);
DatalakeResizeRecoveryFlowChainStartEvent event = new DatalakeResizeRecoveryFlowChainStartEvent(oldCluster, newCluster, USER_CRN);
FlowTriggerEventQueue flowTriggerEventQueue = factory.createFlowTriggerEventQueue(event);
assertEquals(1, flowTriggerEventQueue.getQueue().size());
Queue<Selectable> flowQueue = flowTriggerEventQueue.getQueue();
checkEventIsStart(flowQueue.remove());
}
Aggregations