@Test public void testFilterShouldReturnFalseWhenNotLockedAndCMPermitcheckIsFalse() { lenient().when(upgradePermissionProvider.permitCmAndStackUpgrade(currentImage, candidateImage, STACK_PACKAGE_KEY, CDH_BUILD_NUMBER_KEY)) .thenReturn(Boolean.TRUE); when(upgradePermissionProvider.permitCmAndStackUpgrade(currentImage, candidateImage, CM_PACKAGE_KEY, CM_BUILD_NUMBER_KEY)).thenReturn(Boolean.FALSE); Predicate<Image> predicate = underTest.filterCmAndStackVersion(currentImage, false, activatedParcels, reason); boolean result = predicate.test(candidateImage); assertFalse(result); assertNotLockedCommon(); }
public Predicate<Image> filterCmAndStackVersion(Image currentImage, boolean lockComponents, Map<String, String> activatedParcels, Mutable<String> reason) { return candidateImage -> { updateReason(lockComponents, activatedParcels, reason); return isUpgradePermitted(currentImage, lockComponents, activatedParcels, candidateImage); }; }
CmAndStackVersionFilter { public Predicate<Image> filterCmAndStackVersion(Image currentImage, boolean lockComponents, Map<String, String> activatedParcels, Mutable<String> reason) { return candidateImage -> { updateReason(lockComponents, activatedParcels, reason); return isUpgradePermitted(currentImage, lockComponents, activatedParcels, candidateImage); }; } }
CmAndStackVersionFilter { public Predicate<Image> filterCmAndStackVersion(Image currentImage, boolean lockComponents, Map<String, String> activatedParcels, Mutable<String> reason) { return candidateImage -> { updateReason(lockComponents, activatedParcels, reason); return isUpgradePermitted(currentImage, lockComponents, activatedParcels, candidateImage); }; }  }
CmAndStackVersionFilter { public Predicate<Image> filterCmAndStackVersion(Image currentImage, boolean lockComponents, Map<String, String> activatedParcels, Mutable<String> reason) { return candidateImage -> { updateReason(lockComponents, activatedParcels, reason); return isUpgradePermitted(currentImage, lockComponents, activatedParcels, candidateImage); }; }  Predicate<Image> filterCmAndStackVersion(Image currentImage, boolean lockComponents, Map<String, String> activatedParcels,
            Mutable<String> reason); }
CmAndStackVersionFilter { public Predicate<Image> filterCmAndStackVersion(Image currentImage, boolean lockComponents, Map<String, String> activatedParcels, Mutable<String> reason) { return candidateImage -> { updateReason(lockComponents, activatedParcels, reason); return isUpgradePermitted(currentImage, lockComponents, activatedParcels, candidateImage); }; }  Predicate<Image> filterCmAndStackVersion(Image currentImage, boolean lockComponents, Map<String, String> activatedParcels,
            Mutable<String> reason);  }