use of com.sequenceiq.freeipa.service.freeipa.user.AcceptResult in project cloudbreak by hortonworks.
the class BindUserCreateOperationAcceptorTest method testMissingEnv.
@Test
public void testMissingEnv() {
Operation currentOperation = createCurrentOperation();
currentOperation.setEnvironmentList(null);
when(repository.findRunningByAccountIdAndType(ACCOUNT, underTest.selector())).thenReturn(List.of(currentOperation));
AcceptResult result = underTest.accept(currentOperation);
assertFalse(result.isAccepted());
assertEquals("Bind user create must run only for one environment!", result.getRejectionMessage().get());
}
use of com.sequenceiq.freeipa.service.freeipa.user.AcceptResult in project cloudbreak by hortonworks.
the class BindUserCreateOperationAcceptorTest method testMultipleSuffix.
@Test
public void testMultipleSuffix() {
Operation currentOperation = createCurrentOperation();
currentOperation.setUserList(List.of(SUFFIX, "cluster2"));
when(repository.findRunningByAccountIdAndType(ACCOUNT, underTest.selector())).thenReturn(List.of(currentOperation));
AcceptResult result = underTest.accept(currentOperation);
assertFalse(result.isAccepted());
assertEquals("Bind user create must run only for one suffix!", result.getRejectionMessage().get());
}
use of com.sequenceiq.freeipa.service.freeipa.user.AcceptResult in project cloudbreak by hortonworks.
the class BindUserCreateOperationAcceptorTest method testSameEnvDifferentSuffixIsAccepted.
@Test
public void testSameEnvDifferentSuffixIsAccepted() {
Operation runningOperation = createCurrentOperation();
runningOperation.setId(0L);
runningOperation.setOperationId("other");
runningOperation.setUserList(List.of("cluster2"));
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());
}
use of com.sequenceiq.freeipa.service.freeipa.user.AcceptResult in project cloudbreak by hortonworks.
the class BindUserCreateOperationAcceptorTest method testMissingSuffix.
@Test
public void testMissingSuffix() {
Operation currentOperation = createCurrentOperation();
currentOperation.setUserList(null);
when(repository.findRunningByAccountIdAndType(ACCOUNT, underTest.selector())).thenReturn(List.of(currentOperation));
AcceptResult result = underTest.accept(currentOperation);
assertFalse(result.isAccepted());
assertEquals("Bind user create must run only for one suffix!", result.getRejectionMessage().get());
}
use of com.sequenceiq.freeipa.service.freeipa.user.AcceptResult in project cloudbreak by hortonworks.
the class BindUserCreateOperationAcceptorTest method testRejectedAlreadyRunning.
@Test
public void testRejectedAlreadyRunning() {
Operation runningOperation = createCurrentOperation();
runningOperation.setId(0L);
runningOperation.setOperationId("other");
Operation currentOperation = createCurrentOperation();
when(repository.findRunningByAccountIdAndType(ACCOUNT, underTest.selector())).thenReturn(List.of(runningOperation, currentOperation));
AcceptResult result = underTest.accept(currentOperation);
assertFalse(result.isAccepted());
assertEquals("There is already a running bind user creation for cluster", result.getRejectionMessage().get());
}
Aggregations