@Test public void testCannotRepairGatewayWithoutExternalDatabase() throws CloudbreakImageNotFoundException, CloudbreakImageCatalogException { HostGroup hostGroup1 = new HostGroup(); hostGroup1.setName("hostGroup1"); hostGroup1.setRecoveryMode(RecoveryMode.MANUAL); InstanceMetaData host1 = getHost("host1", hostGroup1.getName(), InstanceStatus.SERVICES_HEALTHY, InstanceGroupType.GATEWAY); hostGroup1.setInstanceGroup(host1.getInstanceGroup()); when(hostGroupService.getByCluster(eq(1L))).thenReturn(Set.of(hostGroup1)); when(stackService.getByIdWithListsInTransaction(1L)).thenReturn(stack); when(componentConfigProviderService.getImage(stack.getId())).thenReturn(mock(Image.class)); com.sequenceiq.cloudbreak.cloud.model.catalog.Image image = mock(com.sequenceiq.cloudbreak.cloud.model.catalog.Image.class); when(image.isPrewarmed()).thenReturn(true); when(imageCatalogService.getImage(any(), any(), any())).thenReturn(StatedImage.statedImage(image, "catalogUrl", "catalogName")); Result result = underTest.repairWithDryRun(stack.getId()); assertFalse(result.isSuccess()); verifyNoInteractions(stackUpdater, flowManager, resourceService); }
public Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairWithDryRun(Long stackId) { Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairStart = validateRepair(ManualClusterRepairMode.DRY_RUN, stackId, Set.of(), false); if (!repairStart.isSuccess()) { LOGGER.info("Stack {} is not repairable. {}", stackId, repairStart.getError().getValidationErrors()); } return repairStart; }
ClusterRepairService { public Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairWithDryRun(Long stackId) { Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairStart = validateRepair(ManualClusterRepairMode.DRY_RUN, stackId, Set.of(), false); if (!repairStart.isSuccess()) { LOGGER.info("Stack {} is not repairable. {}", stackId, repairStart.getError().getValidationErrors()); } return repairStart; } }
ClusterRepairService { public Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairWithDryRun(Long stackId) { Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairStart = validateRepair(ManualClusterRepairMode.DRY_RUN, stackId, Set.of(), false); if (!repairStart.isSuccess()) { LOGGER.info("Stack {} is not repairable. {}", stackId, repairStart.getError().getValidationErrors()); } return repairStart; }  }
ClusterRepairService { public Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairWithDryRun(Long stackId) { Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairStart = validateRepair(ManualClusterRepairMode.DRY_RUN, stackId, Set.of(), false); if (!repairStart.isSuccess()) { LOGGER.info("Stack {} is not repairable. {}", stackId, repairStart.getError().getValidationErrors()); } return repairStart; }  FlowIdentifier repairAll(Long stackId); FlowIdentifier repairHostGroups(Long stackId, Set<String> hostGroups, boolean removeOnly, boolean restartServices); FlowIdentifier repairNodes(Long stackId, Set<String> nodeIds, boolean deleteVolumes, boolean removeOnly, boolean restartServices); Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairWithDryRun(Long stackId); }
ClusterRepairService { public Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairWithDryRun(Long stackId) { Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairStart = validateRepair(ManualClusterRepairMode.DRY_RUN, stackId, Set.of(), false); if (!repairStart.isSuccess()) { LOGGER.info("Stack {} is not repairable. {}", stackId, repairStart.getError().getValidationErrors()); } return repairStart; }  FlowIdentifier repairAll(Long stackId); FlowIdentifier repairHostGroups(Long stackId, Set<String> hostGroups, boolean removeOnly, boolean restartServices); FlowIdentifier repairNodes(Long stackId, Set<String> nodeIds, boolean deleteVolumes, boolean removeOnly, boolean restartServices); Result<Map<HostGroupName, Set<InstanceMetaData>>, RepairValidation> repairWithDryRun(Long stackId);  }