Search in sources :

Example 6 with PackageLocationFilter

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

the class EntitlementDrivenPackageLocationFilterTest method testRejectedImageMultipleFilters.

@Test
public void testRejectedImageMultipleFilters() {
    Set<PackageLocationFilter> filters = Set.of(createAcceptingFilter(), createAcceptingFilter(), createRejectingFilter(), createAcceptingFilter());
    EntitlementDrivenPackageLocationFilter underTest = new EntitlementDrivenPackageLocationFilter(entitlementService, filters);
    List<Image> images = List.of(this.image1, image2);
    ImageFilterResult imageFilterResult = new ImageFilterResult(images);
    ImageFilterResult actual = ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.filter(imageFilterResult, imageFilterParams));
    assertTrue(actual.getImages().isEmpty());
    assertEquals("There are no eligible images to upgrade because the location of the packages is not appropriate.", actual.getReason());
}
Also used : PackageLocationFilter(com.sequenceiq.cloudbreak.service.upgrade.image.PackageLocationFilter) ImageFilterResult(com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterResult) Image(com.sequenceiq.cloudbreak.cloud.model.catalog.Image) Test(org.junit.jupiter.api.Test)

Aggregations

Image (com.sequenceiq.cloudbreak.cloud.model.catalog.Image)6 PackageLocationFilter (com.sequenceiq.cloudbreak.service.upgrade.image.PackageLocationFilter)6 ImageFilterResult (com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterResult)4 Test (org.junit.jupiter.api.Test)4 ImageFilterParams (com.sequenceiq.cloudbreak.service.upgrade.image.ImageFilterParams)3