@Test void testStartAttachedFreeipaInstancesWhenFreeipaStopped() { DescribeFreeIpaResponse freeipaResponse = new DescribeFreeIpaResponse(); 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); }
public void startAttachedFreeipaInstances(Long envId, String envCrn) { executeFreeIpaOperationAndStartPolling(envCrn, freeIpaService::startFreeIpa, freeipaPollerProvider.startPoller(envId, envCrn), Status::isStartable); }
FreeIpaPollerService { public void startAttachedFreeipaInstances(Long envId, String envCrn) { executeFreeIpaOperationAndStartPolling(envCrn, freeIpaService::startFreeIpa, freeipaPollerProvider.startPoller(envId, envCrn), Status::isStartable); } }
FreeIpaPollerService { public void startAttachedFreeipaInstances(Long envId, String envCrn) { executeFreeIpaOperationAndStartPolling(envCrn, freeIpaService::startFreeIpa, freeipaPollerProvider.startPoller(envId, envCrn), Status::isStartable); } FreeIpaPollerService(FreeIpaService freeIpaService, FreeIpaPollerProvider freeipaPollerProvider); }
FreeIpaPollerService { public void startAttachedFreeipaInstances(Long envId, String envCrn) { executeFreeIpaOperationAndStartPolling(envCrn, freeIpaService::startFreeIpa, freeipaPollerProvider.startPoller(envId, envCrn), Status::isStartable); } FreeIpaPollerService(FreeIpaService freeIpaService, FreeIpaPollerProvider freeipaPollerProvider); void startAttachedFreeipaInstances(Long envId, String envCrn); void stopAttachedFreeipaInstances(Long envId, String envCrn); void waitForSynchronizeUsers(Long envId, String envCrn); }
FreeIpaPollerService { public void startAttachedFreeipaInstances(Long envId, String envCrn) { executeFreeIpaOperationAndStartPolling(envCrn, freeIpaService::startFreeIpa, freeipaPollerProvider.startPoller(envId, envCrn), Status::isStartable); } FreeIpaPollerService(FreeIpaService freeIpaService, FreeIpaPollerProvider freeipaPollerProvider); void startAttachedFreeipaInstances(Long envId, String envCrn); void stopAttachedFreeipaInstances(Long envId, String envCrn); void waitForSynchronizeUsers(Long envId, String envCrn);  }