diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/base/restrictions/CertificateIsSufficient.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/base/restrictions/CertificateIsSufficient.java index 05593202c..953097944 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/base/restrictions/CertificateIsSufficient.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/base/restrictions/CertificateIsSufficient.java @@ -60,7 +60,7 @@ private boolean anyAgreementForFeatureIsNotAccepted(ExaminationCertificate certi } private boolean notBearable(Restriction restriction) { - return new RequirementDemandsExecutionStop().test(restriction.unsatisfiedRequirement()); + return new RestrictionMustPauseExecution().test(restriction); } private boolean relatesToFeature(Restriction restriction) { diff --git a/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/restrictions/CertificateIsSufficientTest.java b/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/restrictions/CertificateIsSufficientTest.java index 9f6446917..bf1ad505d 100644 --- a/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/restrictions/CertificateIsSufficientTest.java +++ b/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/restrictions/CertificateIsSufficientTest.java @@ -34,6 +34,12 @@ public void assessedFeatureIsRestricted() { assertFalse(new CertificateIsSufficient(feature).test(Optional.of(severe(feature)))); } + @Test + public void assessedFeatureIsSoftlyRestricted() { + String feature = feature(); + assertFalse(new CertificateIsSufficient(feature).test(Optional.of(warn(feature)))); + } + @Test public void notAssessedFeatureIsRestricted() { String feature = feature(); @@ -61,6 +67,10 @@ private ExaminationCertificate severe(String feature) { return new TestCertificates().withSevereRestrictions(feature); } + private ExaminationCertificate warn(String feature) { + return new TestCertificates().withWarningRestrictions(feature); + } + private ExaminationCertificate severe() { return new TestCertificates().withSevereRestrictions(); } diff --git a/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/restrictions/TestCertificates.java b/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/restrictions/TestCertificates.java index f72af9194..17db7f37c 100644 --- a/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/restrictions/TestCertificates.java +++ b/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/restrictions/TestCertificates.java @@ -113,6 +113,17 @@ ExaminationCertificate withSevereRestrictions(String feature) { )); } + ExaminationCertificate withWarningRestrictions(String feature) { + return new BaseExaminationCertificate(// + Collections.emptyMap(), // no permissions + Collections.singleton(// + new BaseRestriction(// + product(), // + warningProtectedFeature(feature), // + new LicenseDoesNotMatch())// + )); + } + ExaminationCertificate withAgreementRestrictions() { return withAgreementRestrictions("not-very-much-protected-feature"); //$NON-NLS-1$ } @@ -165,8 +176,8 @@ private BaseRequirement errorProtectedFeature(String feature) { new BaseFeature(// feature, // "12.1.0", //$NON-NLS-1$ - "Mature an precious feature", //$NON-NLS-1$ - "Does need to ve error-level protected"), //$NON-NLS-1$ + "Mature and precious feature", //$NON-NLS-1$ + "Needs to be error-level protected"), //$NON-NLS-1$ new RestrictionLevel.Error(), // "Requirement is mandatory to satisfy"); //$NON-NLS-1$ }