@Test void getFreeIpaClientForStackShouldThrowExceptionWhenStackStatusIsUnreachable() { Stack stack = createStack(); when(stackService.getByIdWithListsInTransaction(stack.getId())).thenReturn(stack); Status unreachableState = Status.FREEIPA_UNREACHABLE_STATUSES.stream().findAny().get(); StackStatus stackStatus = new StackStatus(stack, unreachableState, "The FreeIPA instance is unreachable.", DetailedStackStatus.UNREACHABLE); stack.setStackStatus(stackStatus); Assertions.assertThrows(FreeIpaClientException.class, () -> underTest.getFreeIpaClientForStack(stack)); }
public FreeIpaClient getFreeIpaClientForStack(Stack stack) throws FreeIpaClientException { LOGGER.debug("Creating FreeIpaClient for stack {}", stack.getResourceCrn()); return getFreeIpaClient(stack, false, false, Optional.empty()); }
FreeIpaClientFactory { public FreeIpaClient getFreeIpaClientForStack(Stack stack) throws FreeIpaClientException { LOGGER.debug("Creating FreeIpaClient for stack {}", stack.getResourceCrn()); return getFreeIpaClient(stack, false, false, Optional.empty()); } }
FreeIpaClientFactory { public FreeIpaClient getFreeIpaClientForStack(Stack stack) throws FreeIpaClientException { LOGGER.debug("Creating FreeIpaClient for stack {}", stack.getResourceCrn()); return getFreeIpaClient(stack, false, false, Optional.empty()); }  }
FreeIpaClientFactory { public FreeIpaClient getFreeIpaClientForStack(Stack stack) throws FreeIpaClientException { LOGGER.debug("Creating FreeIpaClient for stack {}", stack.getResourceCrn()); return getFreeIpaClient(stack, false, false, Optional.empty()); }  FreeIpaClient getFreeIpaClientForStackId(Long stackId); FreeIpaClient getFreeIpaClientByAccountAndEnvironment(String environmentCrn, String accountId); FreeIpaClient getFreeIpaClientForStack(Stack stack); FreeIpaClient getFreeIpaClientForStack(Stack stack, String freeIpaFqdn); FreeIpaClient getFreeIpaClientForStackWithPing(Stack stack, String freeIpaFqdn); String getAdminUser(); }
FreeIpaClientFactory { public FreeIpaClient getFreeIpaClientForStack(Stack stack) throws FreeIpaClientException { LOGGER.debug("Creating FreeIpaClient for stack {}", stack.getResourceCrn()); return getFreeIpaClient(stack, false, false, Optional.empty()); }  FreeIpaClient getFreeIpaClientForStackId(Long stackId); FreeIpaClient getFreeIpaClientByAccountAndEnvironment(String environmentCrn, String accountId); FreeIpaClient getFreeIpaClientForStack(Stack stack); FreeIpaClient getFreeIpaClientForStack(Stack stack, String freeIpaFqdn); FreeIpaClient getFreeIpaClientForStackWithPing(Stack stack, String freeIpaFqdn); String getAdminUser();  }