use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse in project cloudbreak by hortonworks.
the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testSuccessfulRestore.
@Test
public void testSuccessfulRestore() {
datalakeDRProto.RestoreDatalakeStatusResponse.Builder builder = datalakeDRProto.RestoreDatalakeStatusResponse.newBuilder().setOverallState("SUCCESSFUL");
DatalakeBackupStatusResponse response = underTest.convert(builder.build());
assertEquals(DatalakeBackupStatusResponse.State.SUCCESSFUL, response.getState());
assertEquals(DatalakeBackupStatusResponse.NO_FAILURES, response.getFailureReason());
assert response.isComplete();
}
use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse in project cloudbreak by hortonworks.
the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testFailedHbaseBackupSameFailureReason.
@Test
public void testFailedHbaseBackupSameFailureReason() {
datalakeDRProto.HbaseBackupRestoreState.Builder hbaseBuilder = datalakeDRProto.HbaseBackupRestoreState.newBuilder().setAtlasJanusTable(createStatus(FAILED_STATE, FAILURE_REASON)).setAtlasEntityAuditEventTable(createStatus(FAILED_STATE, FAILURE_REASON));
datalakeDRProto.InternalBackupRestoreState.Builder stateBuilder = datalakeDRProto.InternalBackupRestoreState.newBuilder().setHbase(hbaseBuilder);
datalakeDRProto.BackupDatalakeStatusResponse.Builder builder = datalakeDRProto.BackupDatalakeStatusResponse.newBuilder().setOverallState(FAILED_STATE).setOperationStates(stateBuilder);
String expectedFailure = getFailureString(OperationEnum.HBASE.description(), FAILURE_REASON);
DatalakeBackupStatusResponse response = underTest.convert(builder.build());
assertEquals(DatalakeBackupStatusResponse.State.FAILED, response.getState());
assertEquals(expectedFailure, response.getFailureReason());
assert response.isComplete();
}
use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse in project cloudbreak by hortonworks.
the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testInProgressRestore.
@Test
public void testInProgressRestore() {
datalakeDRProto.RestoreDatalakeStatusResponse.Builder builder = datalakeDRProto.RestoreDatalakeStatusResponse.newBuilder().setOverallState("IN_PROGRESS");
DatalakeBackupStatusResponse response = underTest.convert(builder.build());
assertEquals(DatalakeBackupStatusResponse.State.IN_PROGRESS, response.getState());
assert !response.isComplete();
}
use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse in project cloudbreak by hortonworks.
the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testFailedBackupAdminOperations.
@Test
public void testFailedBackupAdminOperations() {
datalakeDRProto.AdminOperationsBackupRestoreState.Builder adminBuilder = datalakeDRProto.AdminOperationsBackupRestoreState.newBuilder().setStopServices(createStatus(FAILED_STATE, FAILURE_REASON)).setStartServices(createStatus(FAILED_STATE, FAILURE_REASON2));
datalakeDRProto.InternalBackupRestoreState.Builder stateBuilder = datalakeDRProto.InternalBackupRestoreState.newBuilder().setAdminOperations(adminBuilder);
datalakeDRProto.BackupDatalakeStatusResponse.Builder builder = datalakeDRProto.BackupDatalakeStatusResponse.newBuilder().setOverallState(FAILED_STATE).setOperationStates(stateBuilder);
String expectedFailure = getFailureString(OperationEnum.STOP_SERVICES.description(), FAILURE_REASON) + ", " + getFailureString(OperationEnum.START_SERVICES.description(), FAILURE_REASON2);
DatalakeBackupStatusResponse response = underTest.convert(builder.build());
assertEquals(DatalakeBackupStatusResponse.State.FAILED, response.getState());
assertEquals(expectedFailure, response.getFailureReason());
assert response.isComplete();
}
use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeBackupStatusResponse in project cloudbreak by hortonworks.
the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testFailedHbaseBackupDifferentFailureReasons.
@Test
public void testFailedHbaseBackupDifferentFailureReasons() {
datalakeDRProto.HbaseBackupRestoreState.Builder hbaseBuilder = datalakeDRProto.HbaseBackupRestoreState.newBuilder().setAtlasJanusTable(createStatus(FAILED_STATE, FAILURE_REASON)).setAtlasEntityAuditEventTable(createStatus(FAILED_STATE, FAILURE_REASON2));
datalakeDRProto.InternalBackupRestoreState.Builder stateBuilder = datalakeDRProto.InternalBackupRestoreState.newBuilder().setHbase(hbaseBuilder);
datalakeDRProto.BackupDatalakeStatusResponse.Builder builder = datalakeDRProto.BackupDatalakeStatusResponse.newBuilder().setOverallState(FAILED_STATE).setOperationStates(stateBuilder);
String expectedFailure = getFailureString(OperationEnum.HBASE_ATLAS_JANUS.description(), FAILURE_REASON) + ", " + getFailureString(OperationEnum.HBASE_ATLAS_AUDIT.description(), FAILURE_REASON2);
DatalakeBackupStatusResponse response = underTest.convert(builder.build());
assertEquals(DatalakeBackupStatusResponse.State.FAILED, response.getState());
assertEquals(expectedFailure, response.getFailureReason());
assert response.isComplete();
}
Aggregations