@Test @DisplayName("Test if the runtime is properly updated") public void testUpdateRuntimeVersionFromCloudbreak() { when(sdxService.getById(1L)).thenReturn(sdxCluster); StackV4Response stackV4Response = getStackV4Response(); when(stackV4Endpoint.get(eq(0L), eq("test-sdx-cluster"), eq(Set.of()), anyString())) .thenReturn(stackV4Response); underTest.updateRuntimeVersionFromCloudbreak(1L); verify(sdxService, times(1)).updateRuntimeVersionFromStackResponse(eq(sdxCluster), eq(stackV4Response)); }
public void updateRuntimeVersionFromCloudbreak(Long sdxId) { SdxCluster sdxCluster = sdxService.getById(sdxId); String clusterName = sdxCluster.getClusterName(); LOGGER.info("Trying to update the runtime version from Cloudbreak for cluster: {}", clusterName); StackV4Response stack = ThreadBasedUserCrnProvider.doAsInternalActor(() -> stackV4Endpoint.get(0L, clusterName, Set.of(), sdxCluster.getAccountId())); sdxService.updateRuntimeVersionFromStackResponse(sdxCluster, stack); }
SdxUpgradeService { public void updateRuntimeVersionFromCloudbreak(Long sdxId) { SdxCluster sdxCluster = sdxService.getById(sdxId); String clusterName = sdxCluster.getClusterName(); LOGGER.info("Trying to update the runtime version from Cloudbreak for cluster: {}", clusterName); StackV4Response stack = ThreadBasedUserCrnProvider.doAsInternalActor(() -> stackV4Endpoint.get(0L, clusterName, Set.of(), sdxCluster.getAccountId())); sdxService.updateRuntimeVersionFromStackResponse(sdxCluster, stack); } }
SdxUpgradeService { public void updateRuntimeVersionFromCloudbreak(Long sdxId) { SdxCluster sdxCluster = sdxService.getById(sdxId); String clusterName = sdxCluster.getClusterName(); LOGGER.info("Trying to update the runtime version from Cloudbreak for cluster: {}", clusterName); StackV4Response stack = ThreadBasedUserCrnProvider.doAsInternalActor(() -> stackV4Endpoint.get(0L, clusterName, Set.of(), sdxCluster.getAccountId())); sdxService.updateRuntimeVersionFromStackResponse(sdxCluster, stack); }  }
SdxUpgradeService { public void updateRuntimeVersionFromCloudbreak(Long sdxId) { SdxCluster sdxCluster = sdxService.getById(sdxId); String clusterName = sdxCluster.getClusterName(); LOGGER.info("Trying to update the runtime version from Cloudbreak for cluster: {}", clusterName); StackV4Response stack = ThreadBasedUserCrnProvider.doAsInternalActor(() -> stackV4Endpoint.get(0L, clusterName, Set.of(), sdxCluster.getAccountId())); sdxService.updateRuntimeVersionFromStackResponse(sdxCluster, stack); }  void changeImage(Long id, UpgradeOptionV4Response upgradeOption); void upgradeRuntime(Long id, String imageId); String getImageId(Long id); void updateRuntimeVersionFromCloudbreak(Long sdxId); String getCurrentImageCatalogName(Long id); void upgradeOs(Long id); void waitCloudbreakFlow(Long id, PollingConfig pollingConfig, String pollingMessage); }
SdxUpgradeService { public void updateRuntimeVersionFromCloudbreak(Long sdxId) { SdxCluster sdxCluster = sdxService.getById(sdxId); String clusterName = sdxCluster.getClusterName(); LOGGER.info("Trying to update the runtime version from Cloudbreak for cluster: {}", clusterName); StackV4Response stack = ThreadBasedUserCrnProvider.doAsInternalActor(() -> stackV4Endpoint.get(0L, clusterName, Set.of(), sdxCluster.getAccountId())); sdxService.updateRuntimeVersionFromStackResponse(sdxCluster, stack); }  void changeImage(Long id, UpgradeOptionV4Response upgradeOption); void upgradeRuntime(Long id, String imageId); String getImageId(Long id); void updateRuntimeVersionFromCloudbreak(Long sdxId); String getCurrentImageCatalogName(Long id); void upgradeOs(Long id); void waitCloudbreakFlow(Long id, PollingConfig pollingConfig, String pollingMessage);  }