use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeRestoreStatusResponse in project cloudbreak by hortonworks.
the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testFailedHbaseRestoreDifferentFailureReasons.
@Test
public void testFailedHbaseRestoreDifferentFailureReasons() {
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.RestoreDatalakeStatusResponse.Builder builder = datalakeDRProto.RestoreDatalakeStatusResponse.newBuilder().setOverallState(FAILED_STATE).setOperationStates(stateBuilder);
String expectedFailure = getFailureString(OperationEnum.HBASE_ATLAS_JANUS.description(), FAILURE_REASON) + ", " + getFailureString(OperationEnum.HBASE_ATLAS_AUDIT.description(), FAILURE_REASON2);
DatalakeRestoreStatusResponse response = underTest.convert(builder.build());
assertEquals(DatalakeRestoreStatusResponse.State.FAILED, response.getState());
assertEquals(expectedFailure, response.getFailureReason());
assert response.isComplete();
}
use of com.sequenceiq.cloudbreak.datalakedr.model.DatalakeRestoreStatusResponse in project cloudbreak by hortonworks.
the class GrpcStatusResponseToDatalakeBackupStatusResponseConverterTest method testFailedSolrRestoreDifferentFailureReasons.
@Test
public void testFailedSolrRestoreDifferentFailureReasons() {
datalakeDRProto.SolrBackupRestoreState.Builder solrBuilder = datalakeDRProto.SolrBackupRestoreState.newBuilder().setEdgeIndexCollection(createStatus(FAILED_STATE, FAILURE_REASON)).setFulltextIndexCollection(createStatus(FAILED_STATE, FAILURE_REASON2)).setRangerAuditsCollection(createStatus(FAILED_STATE, FAILURE_REASON)).setVertexIndexCollection(createStatus(FAILED_STATE, FAILURE_REASON2));
datalakeDRProto.InternalBackupRestoreState.Builder stateBuilder = datalakeDRProto.InternalBackupRestoreState.newBuilder().setSolr(solrBuilder);
datalakeDRProto.RestoreDatalakeStatusResponse.Builder builder = datalakeDRProto.RestoreDatalakeStatusResponse.newBuilder().setOverallState(FAILED_STATE).setOperationStates(stateBuilder);
String expectedFailure = getFailureString(OperationEnum.SOLR_EDGE_INDEX.description(), FAILURE_REASON) + ", " + getFailureString(OperationEnum.SOLR_FULLTEXT_INDEX.description(), FAILURE_REASON2) + ", " + getFailureString(OperationEnum.SOLR_RANGER_AUDITS.description(), FAILURE_REASON) + ", " + getFailureString(OperationEnum.SOLR_VERTEX_INDEX.description(), FAILURE_REASON2);
DatalakeRestoreStatusResponse response = underTest.convert(builder.build());
assertEquals(DatalakeRestoreStatusResponse.State.FAILED, response.getState());
assertEquals(expectedFailure, response.getFailureReason());
assert response.isComplete();
}
Aggregations