use of com.sequenceiq.freeipa.api.v1.freeipa.stack.FreeIpaV1Endpoint in project cloudbreak by hortonworks.
the class StartBindUserCreationServiceTest method verifyAll.
@AfterEach
public void verifyAll() {
ArgumentCaptor<BindUserCreateRequest> argumentCaptor = ArgumentCaptor.forClass(BindUserCreateRequest.class);
verify(freeIpaV1Endpoint).createBindUser(argumentCaptor.capture(), eq(USER_CRN));
BindUserCreateRequest request = argumentCaptor.getValue();
assertEquals(ENV_CRN, request.getEnvironmentCrn());
assertEquals(STACK_NAME, request.getBindUserNameSuffix());
}
use of com.sequenceiq.freeipa.api.v1.freeipa.stack.FreeIpaV1Endpoint in project cloudbreak by hortonworks.
the class FreeIpaCleanupServiceTest method shouldSendCleanupRequestInCaseOfKeytabNeedsToBeUpdated.
@Test
public void shouldSendCleanupRequestInCaseOfKeytabNeedsToBeUpdated() {
Stack stack = aStack();
Optional<KerberosConfig> kerberosConfig = Optional.of(mock(KerberosConfig.class));
OperationStatus operationStatus = new OperationStatus(null, OperationType.CLEANUP, null, null, null, null, 0L, null);
when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
when(kerberosConfigService.get(ENVIRONMENT_CRN, STACK_NAME)).thenReturn(kerberosConfig);
when(environmentConfigProvider.isChildEnvironment(ENVIRONMENT_CRN)).thenReturn(true);
when(kerberosDetailService.keytabsShouldBeUpdated(CLOUD_PLATFORM, true, kerberosConfig)).thenReturn(true);
when(freeIpaV1Endpoint.internalCleanup(any(CleanupRequest.class), anyString())).thenReturn(operationStatus);
when(freeIpaOperationChecker.pollWithAbsoluteTimeout(any(), any(), anyLong(), anyLong(), anyInt())).thenReturn(pollingResult);
victim.cleanupButIp(stack);
verify(freeIpaV1Endpoint).internalCleanup(any(), anyString());
}
Aggregations