Skip to content

Commit ffff0ec

Browse files
authored
fix: rename service_window_extends_past_feed_period to service_window_outside_feed_period (#2146)
1 parent 01d9a09 commit ffff0ec

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

main/src/main/java/org/mobilitydata/gtfsvalidator/validator/FeedServiceWindowValidator.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
* from trips.txt:
4141
*
4242
* <ol>
43-
* <li>Service window extends past feed period: the feed validity period should cover every
44-
* service window. A {@link ServiceWindowExtendsPastFeedPeriodNotice} is emitted once per
45-
* service whose active date range extends outside the feed validity period, summarizing how
46-
* many days fall before feed_start_date or after feed_end_date.
43+
* <li>Service window outside feed period: the feed validity period should cover every service
44+
* window. A {@link ServiceWindowOutsideFeedPeriodNotice} is emitted once per service whose
45+
* active date range extends outside the feed validity period, summarizing how many days fall
46+
* before feed_start_date or after feed_end_date.
4747
* <li>Feed valid beyond total service window: the feed validity period should not extend far
4848
* beyond the total service window. A {@link FeedValidBeyondTotalServiceWindowNotice} is
4949
* emitted when the feed start/end date exceeds the total service window bounds by more than
@@ -53,7 +53,7 @@
5353
* strictly after today's date.
5454
* </ol>
5555
*
56-
* <p>Generated notices: {@link ServiceWindowExtendsPastFeedPeriodNotice}, {@link
56+
* <p>Generated notices: {@link ServiceWindowOutsideFeedPeriodNotice}, {@link
5757
* FeedValidBeyondTotalServiceWindowNotice}, {@link FutureCalendarNotice}.
5858
*/
5959
@GtfsValidator
@@ -149,7 +149,7 @@ public void validate(NoticeContainer noticeContainer) {
149149
}
150150

151151
/**
152-
* Emits a {@link ServiceWindowExtendsPastFeedPeriodNotice} if the service active window extends
152+
* Emits a {@link ServiceWindowOutsideFeedPeriodNotice} if the service active window extends
153153
* outside the feed validity period.
154154
*/
155155
private static void checkServiceWindow(
@@ -170,7 +170,7 @@ private static void checkServiceWindow(
170170

171171
if (daysBeforeFeedStart > 0 || daysAfterFeedEnd > 0) {
172172
noticeContainer.addValidationNotice(
173-
new ServiceWindowExtendsPastFeedPeriodNotice(
173+
new ServiceWindowOutsideFeedPeriodNotice(
174174
serviceId,
175175
serviceStart.toString(),
176176
serviceEnd.toString(),
@@ -196,7 +196,7 @@ private static LocalDate latest(@Nullable LocalDate current, LocalDate candidate
196196
GtfsCalendarDateSchema.class,
197197
GtfsFeedInfoSchema.class
198198
}))
199-
static class ServiceWindowExtendsPastFeedPeriodNotice extends ValidationNotice {
199+
static class ServiceWindowOutsideFeedPeriodNotice extends ValidationNotice {
200200

201201
/** The service_id whose active window extends outside the feed validity period. */
202202
private final String serviceId;
@@ -213,7 +213,7 @@ static class ServiceWindowExtendsPastFeedPeriodNotice extends ValidationNotice {
213213
/** Number of days the service window extends after feed_end_date (0 if none). */
214214
private final long daysAfterFeedEnd;
215215

216-
ServiceWindowExtendsPastFeedPeriodNotice(
216+
ServiceWindowOutsideFeedPeriodNotice(
217217
String serviceId,
218218
String serviceWindowStart,
219219
String serviceWindowEnd,

main/src/test/java/org/mobilitydata/gtfsvalidator/validator/FeedServiceWindowValidatorTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.mobilitydata.gtfsvalidator.util.ServiceIntervalCache;
2323
import org.mobilitydata.gtfsvalidator.validator.FeedServiceWindowValidator.FeedValidBeyondTotalServiceWindowNotice;
2424
import org.mobilitydata.gtfsvalidator.validator.FeedServiceWindowValidator.FutureCalendarNotice;
25-
import org.mobilitydata.gtfsvalidator.validator.FeedServiceWindowValidator.ServiceWindowExtendsPastFeedPeriodNotice;
25+
import org.mobilitydata.gtfsvalidator.validator.FeedServiceWindowValidator.ServiceWindowOutsideFeedPeriodNotice;
2626

2727
public class FeedServiceWindowValidatorTest {
2828

@@ -250,7 +250,7 @@ public void emptyTripTable_noNotice() {
250250
}
251251

252252
// ---------------------------------------------------------------------------
253-
// ServiceWindowExtendsPastFeedPeriodNotice
253+
// ServiceWindowOutsideFeedPeriodNotice
254254
// ---------------------------------------------------------------------------
255255

256256
@Test
@@ -265,7 +265,7 @@ public void serviceStartsBeforeFeedStart_oneNotice() {
265265
ImmutableList.of("s1"));
266266

267267
assertThat(notices).hasSize(1);
268-
assertThat(notices.get(0)).isInstanceOf(ServiceWindowExtendsPastFeedPeriodNotice.class);
268+
assertThat(notices.get(0)).isInstanceOf(ServiceWindowOutsideFeedPeriodNotice.class);
269269
}
270270

271271
@Test
@@ -279,7 +279,7 @@ public void serviceEndsAfterFeedEnd_oneNotice() {
279279
ImmutableList.of("s1"));
280280

281281
assertThat(notices).hasSize(1);
282-
assertThat(notices.get(0)).isInstanceOf(ServiceWindowExtendsPastFeedPeriodNotice.class);
282+
assertThat(notices.get(0)).isInstanceOf(ServiceWindowOutsideFeedPeriodNotice.class);
283283
}
284284

285285
@Test
@@ -293,7 +293,7 @@ public void serviceBothSidesOutsideFeed_oneNoticeWithBothDays() {
293293
ImmutableList.of("s1"));
294294

295295
assertThat(notices).hasSize(1);
296-
assertThat(notices.get(0)).isInstanceOf(ServiceWindowExtendsPastFeedPeriodNotice.class);
296+
assertThat(notices.get(0)).isInstanceOf(ServiceWindowOutsideFeedPeriodNotice.class);
297297
}
298298

299299
@Test
@@ -309,7 +309,7 @@ public void multipleServices_onlyOutlierTriggersNotice() {
309309
ImmutableList.of("s1", "s2"));
310310

311311
assertThat(notices).hasSize(1);
312-
assertThat(notices.get(0)).isInstanceOf(ServiceWindowExtendsPastFeedPeriodNotice.class);
312+
assertThat(notices.get(0)).isInstanceOf(ServiceWindowOutsideFeedPeriodNotice.class);
313313
}
314314

315315
@Test
@@ -339,9 +339,9 @@ public void calendarDatesOnlyService_outsideFeedPeriod_oneNotice() {
339339
"20240131",
340340
ImmutableList.of("s1"));
341341

342-
// ServiceWindowExtendsPastFeedPeriodNotice + FeedValidBeyondTotalServiceWindowNotice.
342+
// ServiceWindowOutsideFeedPeriodNotice + FeedValidBeyondTotalServiceWindowNotice.
343343
assertThat(notices).hasSize(2);
344-
assertThat(notices.get(0)).isInstanceOf(ServiceWindowExtendsPastFeedPeriodNotice.class);
344+
assertThat(notices.get(0)).isInstanceOf(ServiceWindowOutsideFeedPeriodNotice.class);
345345
assertThat(notices.get(1)).isInstanceOf(FeedValidBeyondTotalServiceWindowNotice.class);
346346
}
347347

0 commit comments

Comments
 (0)