Search in sources :

Example 11 with AcceptResult

use of com.sequenceiq.freeipa.service.freeipa.user.AcceptResult in project cloudbreak by hortonworks.

the class BindUserCreateOperationAcceptorTest method testDifferentEnvSameSuffixIsAccepted.

@Test
public void testDifferentEnvSameSuffixIsAccepted() {
    Operation runningOperation = createCurrentOperation();
    runningOperation.setId(0L);
    runningOperation.setOperationId("other");
    runningOperation.setEnvironmentList(List.of("otherEnv"));
    Operation currentOperation = createCurrentOperation();
    when(repository.findRunningByAccountIdAndType(ACCOUNT, underTest.selector())).thenReturn(List.of(runningOperation, currentOperation));
    AcceptResult result = underTest.accept(currentOperation);
    assertTrue(result.isAccepted());
    assertTrue(result.getRejectionMessage().isEmpty());
}
Also used : Operation(com.sequenceiq.freeipa.entity.Operation) AcceptResult(com.sequenceiq.freeipa.service.freeipa.user.AcceptResult) Test(org.junit.jupiter.api.Test)

Aggregations

Operation (com.sequenceiq.freeipa.entity.Operation)11 AcceptResult (com.sequenceiq.freeipa.service.freeipa.user.AcceptResult)11 Test (org.junit.jupiter.api.Test)8 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 MethodSource (org.junit.jupiter.params.provider.MethodSource)2