use of com.dyngr.core.AttemptResults in project cloudbreak by hortonworks.
the class FreeIpaPollerServiceTest method testStartAttachedFreeipaInstancesWhenFreeipaStopped.
@Test
void testStartAttachedFreeipaInstancesWhenFreeipaStopped() {
DescribeFreeIpaResponse freeipaResponse = new DescribeFreeIpaResponse();
freeipaResponse.setAvailabilityStatus(AvailabilityStatus.UNAVAILABLE);
freeipaResponse.setStatus(Status.STOPPED);
when(freeIpaService.describe(ENV_CRN)).thenReturn(Optional.of(freeipaResponse));
when(freeipaPollerProvider.startPoller(ENV_ID, ENV_CRN)).thenReturn(AttemptResults::justFinish);
underTest.startAttachedFreeipaInstances(ENV_ID, ENV_CRN);
verify(freeIpaService, times(1)).startFreeIpa(ENV_CRN);
}
use of com.dyngr.core.AttemptResults in project cloudbreak by hortonworks.
the class FreeIpaPollerServiceTest method testSyncUsersWhenFreeIpaAvailable.
@Test
void testSyncUsersWhenFreeIpaAvailable() {
DescribeFreeIpaResponse freeipaResponse = new DescribeFreeIpaResponse();
freeipaResponse.setAvailabilityStatus(AvailabilityStatus.AVAILABLE);
freeipaResponse.setStatus(Status.AVAILABLE);
when(freeIpaService.describe(ENV_CRN)).thenReturn(Optional.of(freeipaResponse));
when(freeIpaService.synchronizeAllUsersInEnvironment(ENV_CRN)).thenReturn(createStatus(SynchronizationStatus.REQUESTED, ""));
when(freeipaPollerProvider.syncUsersPoller(ENV_ID, ENV_CRN, OPERATION)).thenReturn(AttemptResults::justFinish);
underTest.waitForSynchronizeUsers(ENV_ID, ENV_CRN);
verify(freeIpaService, times(1)).synchronizeAllUsersInEnvironment(ENV_CRN);
}
use of com.dyngr.core.AttemptResults in project cloudbreak by hortonworks.
the class FreeIpaPollerServiceTest method testStopAttachedFreeipaInstancesWhenFreeipaStopped.
@Test
void testStopAttachedFreeipaInstancesWhenFreeipaStopped() {
DescribeFreeIpaResponse freeipaResponse = new DescribeFreeIpaResponse();
freeipaResponse.setAvailabilityStatus(AvailabilityStatus.UNAVAILABLE);
freeipaResponse.setStatus(Status.STOPPED);
when(freeIpaService.describe(ENV_CRN)).thenReturn(Optional.of(freeipaResponse));
when(freeipaPollerProvider.stopPoller(ENV_ID, ENV_CRN)).thenReturn(AttemptResults::justFinish);
underTest.stopAttachedFreeipaInstances(ENV_ID, ENV_CRN);
verify(freeIpaService, times(0)).stopFreeIpa(ENV_CRN);
}
use of com.dyngr.core.AttemptResults in project cloudbreak by hortonworks.
the class FreeIpaPollerServiceTest method testStartAttachedFreeipaInstancesWhenFreeipaAvailable.
@Test
void testStartAttachedFreeipaInstancesWhenFreeipaAvailable() {
DescribeFreeIpaResponse freeipaResponse = new DescribeFreeIpaResponse();
freeipaResponse.setAvailabilityStatus(AvailabilityStatus.AVAILABLE);
freeipaResponse.setStatus(Status.AVAILABLE);
when(freeIpaService.describe(ENV_CRN)).thenReturn(Optional.of(freeipaResponse));
when(freeipaPollerProvider.startPoller(ENV_ID, ENV_CRN)).thenReturn(AttemptResults::justFinish);
underTest.startAttachedFreeipaInstances(ENV_ID, ENV_CRN);
verify(freeIpaService, times(0)).startFreeIpa(ENV_CRN);
}
use of com.dyngr.core.AttemptResults in project cloudbreak by hortonworks.
the class FreeIpaPollerServiceTest method testStopAttachedFreeipaInstancesWhenFreeipaAvailable.
@Test
void testStopAttachedFreeipaInstancesWhenFreeipaAvailable() {
DescribeFreeIpaResponse freeipaResponse = new DescribeFreeIpaResponse();
freeipaResponse.setAvailabilityStatus(AvailabilityStatus.AVAILABLE);
freeipaResponse.setStatus(Status.AVAILABLE);
when(freeIpaService.describe(ENV_CRN)).thenReturn(Optional.of(freeipaResponse));
when(freeipaPollerProvider.stopPoller(ENV_ID, ENV_CRN)).thenReturn(AttemptResults::justFinish);
underTest.stopAttachedFreeipaInstances(ENV_ID, ENV_CRN);
verify(freeIpaService, times(1)).stopFreeIpa(ENV_CRN);
}
Aggregations