Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void validate(GtfsFeedInfo entity, NoticeContainer noticeContainer) {
currentDatePlusSevenDays));
return;
}
if (entity.feedEndDate().compareTo(currentDatePlusThirtyDays) <= 0) {
if (entity.feedEndDate().compareTo(currentDatePlusThirtyDays) < 0) {
noticeContainer.addValidationNotice(
new FeedExpirationDate30DaysNotice(
entity.csvRowNumber(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,28 @@ public void feedExpiring7to30DaysFromNowShouldGenerateNotice() {
}

@Test
public void feedExpiring30DaysFromNowShouldGenerateNotice() {
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(30)))))
public void feedExpiring29DaysFromNowShouldGenerateNotice() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to modify to feedExpiringAfter30DaysFromNowShouldGenerateNotice instead to conform to the actual guidance from the spec: "If possible, the GTFS dataset should cover at least the next 30 days of service." https://gtfs.org/documentation/schedule/reference/#dataset-publishing-general-practices

assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(29)))))
.containsExactly(
new FeedExpirationDate30DaysNotice(
1,
GtfsDate.fromLocalDate(TEST_NOW),
GtfsDate.fromLocalDate(TEST_NOW.plusDays(30)),
GtfsDate.fromLocalDate(TEST_NOW.plusDays(29)),
GtfsDate.fromLocalDate(TEST_NOW.plusDays(30))));
}

@Test
public void feedExpiring30DaysFromNowShouldGenerateNotice() {
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(30)))))
.isEmpty();
}

@Test
public void feedExpiring31DaysFromNowShouldGenerateNotice() {
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(31)))))
.isEmpty();
}

@Test
public void feedExpiringInMoreThan30DaysFromNowShouldNotGenerateNotice() {
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(45)))))
Expand Down
Loading