diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/FeedExpirationDateValidator.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/FeedExpirationDateValidator.java index 05c853d6fb..cdb1020ee6 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/FeedExpirationDateValidator.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/FeedExpirationDateValidator.java @@ -57,6 +57,7 @@ public void validate(GtfsFeedInfo entity, NoticeContainer noticeContainer) { noticeContainer.addValidationNotice( new FeedExpirationDateNotice( entity.csvRowNumber(), + SeverityLevel.WARNING, currentDate, entity.feedEndDate(), currentDatePlusSevenDays)); @@ -66,6 +67,7 @@ public void validate(GtfsFeedInfo entity, NoticeContainer noticeContainer) { noticeContainer.addValidationNotice( new FeedExpirationDateNotice( entity.csvRowNumber(), + SeverityLevel.INFO, currentDate, entity.feedEndDate(), currentDatePlusThirtyDays)); @@ -81,10 +83,11 @@ static class FeedExpirationDateNotice extends ValidationNotice { FeedExpirationDateNotice( long csvRowNumber, + SeverityLevel severity, GtfsDate currentDate, GtfsDate feedEndDate, GtfsDate suggestedExpirationDate) { - super(SeverityLevel.WARNING); + super(severity); this.csvRowNumber = csvRowNumber; this.currentDate = currentDate; this.feedEndDate = feedEndDate; diff --git a/main/src/test/java/org/mobilitydata/gtfsvalidator/validator/FeedExpirationDateValidatorTest.java b/main/src/test/java/org/mobilitydata/gtfsvalidator/validator/FeedExpirationDateValidatorTest.java index d54e26c412..4dd30fe2c8 100644 --- a/main/src/test/java/org/mobilitydata/gtfsvalidator/validator/FeedExpirationDateValidatorTest.java +++ b/main/src/test/java/org/mobilitydata/gtfsvalidator/validator/FeedExpirationDateValidatorTest.java @@ -25,6 +25,7 @@ import org.junit.Test; import org.mobilitydata.gtfsvalidator.input.CurrentDateTime; import org.mobilitydata.gtfsvalidator.notice.NoticeContainer; +import org.mobilitydata.gtfsvalidator.notice.SeverityLevel; import org.mobilitydata.gtfsvalidator.notice.ValidationNotice; import org.mobilitydata.gtfsvalidator.table.GtfsFeedInfo; import org.mobilitydata.gtfsvalidator.type.GtfsDate; @@ -58,6 +59,7 @@ public void feedExpiringInFiveDaysFromNowShouldGenerateNotice() { .containsExactly( new FeedExpirationDateNotice( 1, + SeverityLevel.WARNING, GtfsDate.fromLocalDate(TEST_NOW.toLocalDate()), GtfsDate.fromLocalDate(TEST_NOW.toLocalDate().plusDays(3)), GtfsDate.fromLocalDate(TEST_NOW.toLocalDate().plusDays(7)))); @@ -71,6 +73,7 @@ public void feedExpiringInSevenDaysFromNowShouldGenerateNotice() { .containsExactly( new FeedExpirationDateNotice( 1, + SeverityLevel.INFO, GtfsDate.fromLocalDate(TEST_NOW.toLocalDate()), GtfsDate.fromLocalDate(TEST_NOW.toLocalDate().plusDays(7)), GtfsDate.fromLocalDate(TEST_NOW.toLocalDate().plusDays(30)))); @@ -84,6 +87,7 @@ public void feedExpiring7to30DaysFromNowShouldGenerateNotice() { .containsExactly( new FeedExpirationDateNotice( 1, + SeverityLevel.INFO, GtfsDate.fromLocalDate(TEST_NOW.toLocalDate()), GtfsDate.fromLocalDate(TEST_NOW.toLocalDate().plusDays(23)), GtfsDate.fromLocalDate(TEST_NOW.toLocalDate().plusDays(30)))); @@ -97,6 +101,7 @@ public void feedExpiring30DaysFromNowShouldGenerateNotice() { .containsExactly( new FeedExpirationDateNotice( 1, + SeverityLevel.INFO, GtfsDate.fromLocalDate(TEST_NOW.toLocalDate()), GtfsDate.fromLocalDate(TEST_NOW.toLocalDate().plusDays(30)), GtfsDate.fromLocalDate(TEST_NOW.toLocalDate().plusDays(30))));