use of com.sequenceiq.sdx.api.model.SdxRecoveryResponse in project cloudbreak by hortonworks.
the class SdxRecoverySelectorServiceTest method testRecoveryServiceCanSwitchToResizeRecovery.
@Test
public void testRecoveryServiceCanSwitchToResizeRecovery() {
setResizeTest();
SdxRecoveryResponse response = new SdxRecoveryResponse();
when(mockResizeRecoveryService.triggerRecovery(cluster, request)).thenReturn(response);
SdxRecoveryResponse result = sdxRecoverySelectorService.triggerRecovery(cluster, request);
// Basically, just check that we pass through to the Resize Recovery Service
Mockito.verifyNoInteractions(mockSdxUpgradeRecoveryService);
Mockito.verify(mockResizeRecoveryService).triggerRecovery(cluster, request);
Mockito.verify(mockSdxUpgradeRecoveryService, never()).triggerRecovery(cluster, request);
assertNotNull(result);
assertEquals(response, result);
}
use of com.sequenceiq.sdx.api.model.SdxRecoveryResponse in project cloudbreak by hortonworks.
the class ResizeRecoveryServiceTest method testTriggerRecoveryShouldStartFlow.
@Test
public void testTriggerRecoveryShouldStartFlow() {
sdxStatusEntity.setStatus(STOP_FAILED);
SdxRecoveryResponse sdxRecoveryResponse = ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.triggerRecovery(cluster, request));
verify(sdxReactorFlowManager).triggerSdxStartFlow(cluster);
assertEquals(flowId, sdxRecoveryResponse.getFlowIdentifier());
}
use of com.sequenceiq.sdx.api.model.SdxRecoveryResponse in project cloudbreak by hortonworks.
the class SdxUpgradeRecoveryService method triggerRecovery.
@Override
public SdxRecoveryResponse triggerRecovery(SdxCluster sdxCluster, SdxRecoveryRequest recoverRequest) {
MDCBuilder.buildMdcContext(sdxCluster);
FlowIdentifier flowIdentifier = sdxReactorFlowManager.triggerDatalakeRuntimeRecoveryFlow(sdxCluster, recoverRequest.getType());
return new SdxRecoveryResponse(flowIdentifier);
}
use of com.sequenceiq.sdx.api.model.SdxRecoveryResponse in project cloudbreak by hortonworks.
the class ResizeRecoveryServiceTest method testTriggerRecovertShouldStartFlow.
@Test
public void testTriggerRecovertShouldStartFlow() {
sdxStatusEntity.setStatus(DatalakeStatusEnum.STOP_FAILED);
SdxRecoveryResponse sdxRecoveryResponse = ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.triggerRecovery(cluster, request));
verify(sdxReactorFlowManager).triggerSdxStartFlow(cluster);
assertEquals(flowId, sdxRecoveryResponse.getFlowIdentifier());
}
Aggregations