Search in sources :

Example 26 with ImageFilterParams

use of com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterParams in project cloudbreak by hortonworks.

the class UpgradePermissionProviderTest method testPermitStackUpgradeShouldReturnfalseWhenTheCandidateCdhVersionIsNotSupported.

@Test
public void testPermitStackUpgradeShouldReturnfalseWhenTheCandidateCdhVersionIsNotSupported() {
    String currentVersion = "7.2.1";
    String targetVersion = "7.2.10";
    Image currentImage = createImage(currentVersion, "2002");
    Image candidateImage = createImage(targetVersion, "2010");
    ImageFilterParams imageFilterParams = new ImageFilterParams(currentImage, true, Map.of(), DATALAKE_STACK_TYPE, null, STACK_ID, new InternalUpgradeSettings(false, true, true), imageCatalogPlatform(CLOUD_PLATFORM));
    when(supportedRuntimes.isSupported("7.2.10")).thenReturn(false);
    boolean actual = underTest.permitStackUpgrade(imageFilterParams, candidateImage);
    assertFalse(actual);
    verify(supportedRuntimes).isSupported("7.2.10");
    verifyNoInteractions(componentBuildNumberComparator, componentVersionComparator, upgradeMatrixService);
}
Also used : ImageFilterParams(com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterParams) InternalUpgradeSettings(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.InternalUpgradeSettings) Image(com.sequenceiq.cloudbreak.cloud.model.catalog.Image) Test(org.junit.Test)

Aggregations

ImageFilterParams (com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterParams)26 Image (com.sequenceiq.cloudbreak.cloud.model.catalog.Image)20 Test (org.junit.Test)18 ImageFilterResult (com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterResult)15 InternalUpgradeSettings (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.InternalUpgradeSettings)11 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)9 UpgradeV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeV4Response)8 CloudbreakImageCatalogV3 (com.sequenceiq.cloudbreak.cloud.model.catalog.CloudbreakImageCatalogV3)8 Test (org.junit.jupiter.api.Test)7 ImageCatalog (com.sequenceiq.cloudbreak.domain.ImageCatalog)6 ImageInfoV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageInfoV4Response)2 NotFoundException (com.sequenceiq.cloudbreak.common.exception.NotFoundException)2 CloudbreakImageNotFoundException (com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException)2 ClusterComponent (com.sequenceiq.cloudbreak.domain.stack.cluster.ClusterComponent)2 Result (com.sequenceiq.cloudbreak.service.cluster.model.Result)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)1 CloudbreakImageCatalogException (com.sequenceiq.cloudbreak.core.CloudbreakImageCatalogException)1 InstanceMetaData (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData)1 RepairValidation (com.sequenceiq.cloudbreak.service.cluster.model.RepairValidation)1