Search in sources :

Example 16 with DatalakeBackupStatusResponse

use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse in project cloudbreak by hortonworks.

the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testSuccessfulBackup.

@Test
public void testSuccessfulBackup() {
    datalakeDRProto.BackupDatalakeStatusResponse.Builder builder = datalakeDRProto.BackupDatalakeStatusResponse.newBuilder().setOverallState("SUCCESSFUL");
    DatalakeBackupStatusResponse response = underTest.convert(builder.build());
    assertEquals(DatalakeBackupStatusResponse.State.SUCCESSFUL, response.getState());
    assertEquals(DatalakeBackupStatusResponse.NO_FAILURES, response.getFailureReason());
    assert response.isComplete();
}
Also used : DatalakeBackupStatusResponse(com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse) Test(org.junit.Test)

Example 17 with DatalakeBackupStatusResponse

use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse in project cloudbreak by hortonworks.

the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testFailedBackup.

@Test
public void testFailedBackup() {
    datalakeDRProto.BackupDatalakeStatusResponse.Builder builder = datalakeDRProto.BackupDatalakeStatusResponse.newBuilder().setOverallState("FAILED").setFailureReason(FAILURE_REASON);
    DatalakeBackupStatusResponse response = underTest.convert(builder.build());
    assertEquals(DatalakeBackupStatusResponse.State.FAILED, response.getState());
    assertEquals(FAILURE_REASON, response.getFailureReason());
    assert response.isComplete();
}
Also used : DatalakeBackupStatusResponse(com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse) Test(org.junit.Test)

Aggregations

DatalakeBackupStatusResponse (com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse)17 Test (org.junit.Test)13 PollerStoppedException (com.dyngr.exception.PollerStoppedException)1 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)1 SdxContext (com.sequenceiq.datalake.flow.SdxContext)1 DatalakeTriggerBackupEvent (com.sequenceiq.datalake.flow.dr.backup.event.DatalakeTriggerBackupEvent)1 AbstractSdxAction (com.sequenceiq.datalake.service.AbstractSdxAction)1 FlowParameters (com.sequenceiq.flow.core.FlowParameters)1 SdxBackupStatusResponse (com.sequenceiq.sdx.api.model.SdxBackupStatusResponse)1 SdxRestoreStatusResponse (com.sequenceiq.sdx.api.model.SdxRestoreStatusResponse)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Test (org.junit.jupiter.api.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1 Bean (org.springframework.context.annotation.Bean)1 StateContext (org.springframework.statemachine.StateContext)1