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());
}
Aggregations