use of com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.UsedImageStacksV4Response in project cloudbreak by hortonworks.
the class UsedImagesTest method verifyImagesAreUsed.
private <T extends CloudbreakTestDto> T verifyImagesAreUsed(TestContext testContext, T testDto) {
testContext.given(UsedImagesTestDto.class).when(utilTestClient.usedImages()).then((tc, usedImagesTestDto, client) -> {
List<UsedImageStacksV4Response> usedImages = usedImagesTestDto.getResponse().getUsedImages();
UsedImageStacksV4Response usedImageStacksV4Response = usedImages.stream().filter(usedImage -> usedImage.getImage().getImageId().contains(sdxImageUuid)).findFirst().orElseThrow(() -> new TestFailException(String.format("SDX image is NOT in use with ID:: %s", sdxImageUuid)));
LOGGER.info("Used SDX image ID:: {}", usedImageStacksV4Response.getImage().getImageId());
return usedImagesTestDto;
}).given(FreeipaUsedImagesTestDto.class).when(freeIpaTestClient.usedImages()).then((tc, usedImagesTestDto, client) -> {
List<UsedImageStacksV1Response> usedImages = usedImagesTestDto.getResponse().getUsedImages();
UsedImageStacksV1Response usedImageStacksV1Response = usedImages.stream().filter(usedImage -> usedImage.getImage().getImageId().contains(freeipaImageUuid)).findFirst().orElseThrow(() -> new TestFailException(String.format("FreeIpa image is NOT in use with ID:: %s", freeipaImageUuid)));
LOGGER.info("Used FreeIpa image ID:: {}", usedImageStacksV1Response.getImage().getImageId());
return usedImagesTestDto;
}).validate();
return testDto;
}
Aggregations