use of com.sequenceiq.freeipa.api.v1.freeipa.user.model.SynchronizationStatus in project cloudbreak by hortonworks.
the class SyncOperationToOperationStatusConverterTest method convertFailed.
@Test
void convertFailed() {
OperationState operationState = OperationState.FAILED;
SynchronizationStatus synchronizationStatus = SynchronizationStatus.fromOperationState(operationState);
Operation operation = createSyncOperation(operationState);
String errorMessage = "error message";
operation.setError(errorMessage);
SyncOperationStatus actual = underTest.convert(operation);
assertEqualsDefaults(actual);
assertEquals(synchronizationStatus, actual.getStatus());
assertEquals(List.of(), actual.getSuccess());
assertEquals(List.of(), actual.getFailure());
assertEquals(errorMessage, actual.getError());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.user.model.SynchronizationStatus in project cloudbreak by hortonworks.
the class SyncOperationToOperationStatusConverterTest method convertCompleted.
@Test
void convertCompleted() {
OperationState operationState = OperationState.COMPLETED;
SynchronizationStatus synchronizationStatus = SynchronizationStatus.fromOperationState(operationState);
List<SuccessDetails> successDetails = List.of(new SuccessDetails("environment1"), new SuccessDetails("environment2"));
List<FailureDetails> failureDetails = List.of(new FailureDetails("environment3", "failure message1"), new FailureDetails("environment4", "failure message2"));
Operation operation = createSyncOperation(operationState);
operation.setSuccessList(successDetails);
operation.setFailureList(failureDetails);
SyncOperationStatus actual = underTest.convert(operation);
assertEqualsDefaults(actual);
assertEquals(synchronizationStatus, actual.getStatus());
assertEquals(successDetails, actual.getSuccess());
assertEquals(failureDetails, actual.getFailure());
assertNull(actual.getError());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.user.model.SynchronizationStatus in project cloudbreak by hortonworks.
the class SyncOperationToOperationStatusConverterTest method convertRunning.
@Test
void convertRunning() {
OperationState operationState = OperationState.RUNNING;
SynchronizationStatus synchronizationStatus = SynchronizationStatus.fromOperationState(operationState);
Operation operation = createSyncOperation(operationState);
SyncOperationStatus actual = underTest.convert(operation);
assertEqualsDefaults(actual);
assertEquals(synchronizationStatus, actual.getStatus());
assertEquals(List.of(), actual.getSuccess());
assertEquals(List.of(), actual.getFailure());
assertNull(actual.getError());
}
Aggregations