Skip to content

Commit

Permalink
[#1330]
Browse files Browse the repository at this point in the history
Misprints in licensing requirement level should be treated as fatal

warning-restrictions also treated as signs of insufficient coverage
  • Loading branch information
eparovyshnaya committed Mar 26, 2024
1 parent ccf22ef commit 6e529c4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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$
}
Expand Down Expand Up @@ -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$
}
Expand Down

0 comments on commit 6e529c4

Please sign in to comment.