Skip to content

Commit

Permalink
CB-22402 Marketplace image id was fetched from the wrong image catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
daszabo authored and lacikaaa committed Jul 6, 2023
1 parent ca89276 commit 343789b
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -168,10 +166,10 @@ public boolean hasMarketplaceFormat(String imageName) {
}
}

protected String getLatestPrewarmedImageId(TestContext testContext) {
protected String getLatestMarketplacePrewarmedImageId(String imgCatalogKey, TestContext testContext) {
AtomicReference<String> 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;
Expand Down

0 comments on commit 343789b

Please sign in to comment.