@Test public void preClusterManagerStartRecipesShouldUseReachableNodes() throws CloudbreakException, CloudbreakOrchestratorFailedException, CloudbreakOrchestratorTimeoutException { when(stack.getId()).thenReturn(1L); Cluster cluster = new Cluster(); cluster.setId(2L); when(stack.getCluster()).thenReturn(cluster); when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenReturn(gatewayConfig); Set<Node> nodes = Set.of(node); when(stackUtil.collectReachableNodes(any())).thenReturn(nodes); underTest.preClusterManagerStartRecipes(stack); verify(gatewayConfigService).getPrimaryGatewayConfig(stack); verify(stackUtil).collectReachableNodes(stack); verify(hostOrchestrator).preClusterManagerStartRecipes(eq(gatewayConfig), eq(nodes), any()); }
public void preClusterManagerStartRecipes(Stack stack) throws CloudbreakException { GatewayConfig gatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack); try { hostOrchestrator.preClusterManagerStartRecipes(gatewayConfig, stackUtil.collectReachableNodes(stack), clusterDeletionBasedModel(stack.getId(), stack.getCluster().getId())); } catch (CloudbreakOrchestratorTimeoutException timeoutException) { throw new CloudbreakException("Pre cluster manager start" + getRecipeTimeoutErrorMessage(timeoutException), timeoutException); } catch (CloudbreakOrchestratorFailedException e) { String message = getRecipeExecutionFaiureMessage(stack, e); throw new CloudbreakException(message); } }
OrchestratorRecipeExecutor { public void preClusterManagerStartRecipes(Stack stack) throws CloudbreakException { GatewayConfig gatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack); try { hostOrchestrator.preClusterManagerStartRecipes(gatewayConfig, stackUtil.collectReachableNodes(stack), clusterDeletionBasedModel(stack.getId(), stack.getCluster().getId())); } catch (CloudbreakOrchestratorTimeoutException timeoutException) { throw new CloudbreakException("Pre cluster manager start" + getRecipeTimeoutErrorMessage(timeoutException), timeoutException); } catch (CloudbreakOrchestratorFailedException e) { String message = getRecipeExecutionFaiureMessage(stack, e); throw new CloudbreakException(message); } } }
OrchestratorRecipeExecutor { public void preClusterManagerStartRecipes(Stack stack) throws CloudbreakException { GatewayConfig gatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack); try { hostOrchestrator.preClusterManagerStartRecipes(gatewayConfig, stackUtil.collectReachableNodes(stack), clusterDeletionBasedModel(stack.getId(), stack.getCluster().getId())); } catch (CloudbreakOrchestratorTimeoutException timeoutException) { throw new CloudbreakException("Pre cluster manager start" + getRecipeTimeoutErrorMessage(timeoutException), timeoutException); } catch (CloudbreakOrchestratorFailedException e) { String message = getRecipeExecutionFaiureMessage(stack, e); throw new CloudbreakException(message); } }  }
OrchestratorRecipeExecutor { public void preClusterManagerStartRecipes(Stack stack) throws CloudbreakException { GatewayConfig gatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack); try { hostOrchestrator.preClusterManagerStartRecipes(gatewayConfig, stackUtil.collectReachableNodes(stack), clusterDeletionBasedModel(stack.getId(), stack.getCluster().getId())); } catch (CloudbreakOrchestratorTimeoutException timeoutException) { throw new CloudbreakException("Pre cluster manager start" + getRecipeTimeoutErrorMessage(timeoutException), timeoutException); } catch (CloudbreakOrchestratorFailedException e) { String message = getRecipeExecutionFaiureMessage(stack, e); throw new CloudbreakException(message); } }  void uploadRecipes(Stack stack, Set<HostGroup> hostGroups); void preClusterManagerStartRecipes(Stack stack); void postClusterManagerStartRecipes(Stack stack); void postClusterInstall(Stack stack); void preTerminationRecipes(Stack stack, boolean forced); void preTerminationRecipes(Stack stack, Set<String> hostNames); void preTerminationRecipesOnNodes(Stack stack, Set<Node> nodes, boolean forced); }
OrchestratorRecipeExecutor { public void preClusterManagerStartRecipes(Stack stack) throws CloudbreakException { GatewayConfig gatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack); try { hostOrchestrator.preClusterManagerStartRecipes(gatewayConfig, stackUtil.collectReachableNodes(stack), clusterDeletionBasedModel(stack.getId(), stack.getCluster().getId())); } catch (CloudbreakOrchestratorTimeoutException timeoutException) { throw new CloudbreakException("Pre cluster manager start" + getRecipeTimeoutErrorMessage(timeoutException), timeoutException); } catch (CloudbreakOrchestratorFailedException e) { String message = getRecipeExecutionFaiureMessage(stack, e); throw new CloudbreakException(message); } }  void uploadRecipes(Stack stack, Set<HostGroup> hostGroups); void preClusterManagerStartRecipes(Stack stack); void postClusterManagerStartRecipes(Stack stack); void postClusterInstall(Stack stack); void preTerminationRecipes(Stack stack, boolean forced); void preTerminationRecipes(Stack stack, Set<String> hostNames); void preTerminationRecipesOnNodes(Stack stack, Set<Node> nodes, boolean forced);  }