use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageComponentVersions in project cloudbreak by hortonworks.
the class SdxRuntimeUpgradeServiceTest method testShowAvailableImagesShouldReturnAllUpgradeCandidates.
@Test
public void testShowAvailableImagesShouldReturnAllUpgradeCandidates() {
ImageComponentVersions imageComponentVersionsFor702 = new ImageComponentVersions();
imageComponentVersionsFor702.setCm(V_7_0_2);
imageComponentVersionsFor702.setCdp(V_7_0_2);
ImageComponentVersions imageComponentVersionsFor703 = new ImageComponentVersions();
imageComponentVersionsFor703.setCm(V_7_0_3);
imageComponentVersionsFor703.setCdp(V_7_0_3);
ImageInfoV4Response imageInfo1 = new ImageInfoV4Response();
imageInfo1.setImageId(IMAGE_ID + 1);
imageInfo1.setCreated(1);
imageInfo1.setComponentVersions(imageComponentVersionsFor702);
ImageInfoV4Response imageInfo2 = new ImageInfoV4Response();
imageInfo2.setImageId(IMAGE_ID + 2);
imageInfo2.setCreated(2);
imageInfo2.setComponentVersions(imageComponentVersionsFor702);
ImageInfoV4Response imageInfo3 = new ImageInfoV4Response();
imageInfo3.setImageId(IMAGE_ID + 3);
imageInfo3.setCreated(3);
imageInfo3.setComponentVersions(imageComponentVersionsFor703);
UpgradeV4Response upgradeV4Response = new UpgradeV4Response();
upgradeV4Response.setUpgradeCandidates(List.of(imageInfo1, imageInfo2, imageInfo3));
sdxUpgradeRequest.setShowAvailableImages(SdxUpgradeShowAvailableImages.SHOW);
underTest.filterSdxUpgradeResponse(ACCOUNT_ID, sdxCluster.getClusterName(), sdxUpgradeRequest, upgradeV4Response);
assertEquals(3, upgradeV4Response.getUpgradeCandidates().size());
assertTrue(upgradeV4Response.getUpgradeCandidates().stream().anyMatch(imageInfoV4Response -> imageInfoV4Response.getImageId().equals(IMAGE_ID + 1)));
assertTrue(upgradeV4Response.getUpgradeCandidates().stream().anyMatch(imageInfoV4Response -> imageInfoV4Response.getImageId().equals(IMAGE_ID + 2)));
assertTrue(upgradeV4Response.getUpgradeCandidates().stream().anyMatch(imageInfoV4Response -> imageInfoV4Response.getImageId().equals(IMAGE_ID + 3)));
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageComponentVersions in project cloudbreak by hortonworks.
the class SdxRuntimeUpgradeServiceTest method creatImageComponentVersions.
private ImageComponentVersions creatImageComponentVersions(String cmVersion, String cdpVersion) {
ImageComponentVersions imageComponentVersions = new ImageComponentVersions();
imageComponentVersions.setCm(cmVersion);
imageComponentVersions.setCdp(cdpVersion);
return imageComponentVersions;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageComponentVersions in project cloudbreak by hortonworks.
the class UpgradeOptionsResponseFactoryTest method creatExpectedPackageVersions.
private ImageComponentVersions creatExpectedPackageVersions() {
ImageComponentVersions imageComponentVersions = new ImageComponentVersions();
imageComponentVersions.setCm(V_7_0_3);
imageComponentVersions.setCdp(V_7_0_2);
return imageComponentVersions;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageComponentVersions in project cloudbreak by hortonworks.
the class ClusterUpgradeAvailabilityServiceTest method createExpectedPackageVersions.
private ImageComponentVersions createExpectedPackageVersions() {
ImageComponentVersions imageComponentVersions = new ImageComponentVersions();
imageComponentVersions.setCm(V_7_0_3);
imageComponentVersions.setCdp(V_7_0_2);
return imageComponentVersions;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageComponentVersions in project cloudbreak by hortonworks.
the class SdxRuntimeUpgradeServiceTest method creatExpectedPackageVersions.
private ImageComponentVersions creatExpectedPackageVersions() {
ImageComponentVersions imageComponentVersions = new ImageComponentVersions();
imageComponentVersions.setCm(V_7_0_3);
imageComponentVersions.setCdp(V_7_0_2);
return imageComponentVersions;
}
Aggregations