From 343789bd3b52dcaf903bf003c0e928983a7384db Mon Sep 17 00:00:00 2001 From: David Szabo Date: Thu, 6 Jul 2023 15:30:11 +0200 Subject: [PATCH] CB-22402 Marketplace image id was fetched from the wrong image catalog --- .../distrox/DistroXMarketplaceImageTests.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/integration-test/src/main/java/com/sequenceiq/it/cloudbreak/testcase/e2e/distrox/DistroXMarketplaceImageTests.java b/integration-test/src/main/java/com/sequenceiq/it/cloudbreak/testcase/e2e/distrox/DistroXMarketplaceImageTests.java index 3287ea9cf6b..e380a586571 100644 --- a/integration-test/src/main/java/com/sequenceiq/it/cloudbreak/testcase/e2e/distrox/DistroXMarketplaceImageTests.java +++ b/integration-test/src/main/java/com/sequenceiq/it/cloudbreak/testcase/e2e/distrox/DistroXMarketplaceImageTests.java @@ -88,17 +88,15 @@ public void testSDXAndDistroXWithMarketplaceImageCanBeCreatedSuccessfully(TestCo String distrox = resourcePropertyProvider().getName(); - String selectedImageID = getLatestPrewarmedImageId(testContext); - testContext .given(imgCatalogKey, ImageCatalogTestDto.class) - .withName(imgCatalogKey) - .withUrl(commonClusterManagerProperties.getUpgrade() - .getImageCatalogUrl3rdParty()) + .withName(imgCatalogKey) + .withUrl(commonClusterManagerProperties.getUpgrade() + .getImageCatalogUrl3rdParty()) .when(imageCatalogTestClient.createIfNotExistV4()) .given(imageSettings, ImageSettingsTestDto.class) .withImageCatalog(imgCatalogKey) - .withImageId(selectedImageID) + .withImageId(getLatestMarketplacePrewarmedImageId(imgCatalogKey, testContext)) .given(clouderaManager, ClouderaManagerTestDto.class) .given(cluster, ClusterTestDto.class) .withBlueprintName(getDefaultSDXBlueprintName()) @@ -138,7 +136,7 @@ public void testSDXAndDistroXWithMarketplaceImageCanBeCreatedSuccessfully(TestCo }) .given(dhImageSettings, DistroXImageTestDto.class) .withImageCatalog(imgCatalogKey) - .withImageId(selectedImageID) + .withImageId(getLatestMarketplacePrewarmedImageId(imgCatalogKey, testContext)) .given(distrox, DistroXTestDto.class) .withImageSettings(dhImageSettings) .when(distroXTestClient.create(), key(distrox)) @@ -168,10 +166,10 @@ public boolean hasMarketplaceFormat(String imageName) { } } - protected String getLatestPrewarmedImageId(TestContext testContext) { + protected String getLatestMarketplacePrewarmedImageId(String imgCatalogKey, TestContext testContext) { AtomicReference selectedImageID = new AtomicReference<>(); testContext - .given(ImageCatalogTestDto.class) + .given(imgCatalogKey, ImageCatalogTestDto.class) .when((tc, dto, client) -> { selectedImageID.set(tc.getCloudProvider().getLatestMarketplacePreWarmedImageID(tc, dto, client)); return dto;