use of com.sequenceiq.cloudbreak.api.model.imagecatalog.ImagesResponse in project cloudbreak by hortonworks.
the class ImageSelectionTest method testImageSelection.
@Test
public void testImageSelection() throws Exception {
// GIVEN
IntegrationTestContext itContext = getItContext();
// WHEN
ImagesResponse imagesResponse = getCloudbreakClient().imageCatalogEndpoint().getImagesByProvider(itContext.getContextParam(CloudbreakITContextConstants.CLOUDPROVIDER));
// THEN
Assert.assertFalse(imagesResponse.getBaseImages().isEmpty());
itContext.putContextParam(CloudbreakV2Constants.IMAGEID, imagesResponse.getBaseImages().get(0).getUuid());
}
use of com.sequenceiq.cloudbreak.api.model.imagecatalog.ImagesResponse in project cloudbreak by hortonworks.
the class ImagesToImagesResponseJsonConverter method convert.
@Override
public ImagesResponse convert(Images source) {
ImagesResponse res = new ImagesResponse();
List<BaseImageResponse> baseImages = getBaseImageResponses(source);
res.setBaseImages(baseImages);
List<ImageResponse> hdpImages = new ArrayList<>();
for (Image hdpImg : source.getHdpImages()) {
ImageResponse hdpImgJson = new ImageResponse();
copyImageFieldsToJson(hdpImg, hdpImgJson);
hdpImgJson.setStackDetails(convertStackDetailsToJson(hdpImg.getStackDetails()));
hdpImages.add(hdpImgJson);
}
res.setHdpImages(hdpImages);
List<ImageResponse> hdfImages = new ArrayList<>();
for (Image hdfImg : source.getHdfImages()) {
ImageResponse hdfImgJson = new ImageResponse();
copyImageFieldsToJson(hdfImg, hdfImgJson);
hdfImgJson.setStackDetails(convertStackDetailsToJson(hdfImg.getStackDetails()));
hdfImages.add(hdfImgJson);
}
res.setHdfImages(hdfImages);
return res;
}
Aggregations