Skip to content

Commit

Permalink
#1604 Rename unused_parent_station rule to unused_station (#1959)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvansson authored Feb 4, 2025
1 parent 5ea40f1 commit 2ed4dd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* <ul>
* <li>{@link WrongParentLocationTypeNotice}.
* <li>{@link UnusedParentStationNotice}.
* <li>{@link UnusedStationNotice}.
* </ul>
*/
@GtfsValidator
Expand Down Expand Up @@ -114,7 +114,7 @@ public void validate(NoticeContainer noticeContainer) {
}
GtfsStop stationStop = optionalStationStop.get();
noticeContainer.addValidationNotice(
new UnusedParentStationNotice(
new UnusedStationNotice(
stationStop.csvRowNumber(), stationStop.stopId(), stationStop.stopName()));
}
}
Expand Down Expand Up @@ -190,12 +190,12 @@ static class WrongParentLocationTypeNotice extends ValidationNotice {
}

/**
* Unused parent station.
* Unused station.
*
* <p>A stop has `location_type` STATION (1) but does not appear in any stop's `parent_station`.
*/
@GtfsValidationNotice(severity = INFO, files = @FileRefs({GtfsStopSchema.class}))
static class UnusedParentStationNotice extends ValidationNotice {
static class UnusedStationNotice extends ValidationNotice {
/** The row number of the faulty record. */
private final int csvRowNumber;

Expand All @@ -205,7 +205,7 @@ static class UnusedParentStationNotice extends ValidationNotice {
/** The name of the faulty stop. */
private final String stopName;

UnusedParentStationNotice(int csvRowNumber, String stopId, String stopName) {
UnusedStationNotice(int csvRowNumber, String stopId, String stopName) {
this.csvRowNumber = csvRowNumber;
this.stopId = stopId;
this.stopName = stopName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.mobilitydata.gtfsvalidator.table.GtfsLocationType;
import org.mobilitydata.gtfsvalidator.table.GtfsStop;
import org.mobilitydata.gtfsvalidator.table.GtfsStopTableContainer;
import org.mobilitydata.gtfsvalidator.validator.ParentStationValidator.UnusedParentStationNotice;
import org.mobilitydata.gtfsvalidator.validator.ParentStationValidator.UnusedStationNotice;
import org.mobilitydata.gtfsvalidator.validator.ParentStationValidator.WrongParentLocationTypeNotice;

@RunWith(JUnit4.class)
Expand Down Expand Up @@ -94,7 +94,7 @@ public void stopParent() {
public void entranceParent() {
assertThat(validateChildAndParent(GtfsLocationType.ENTRANCE, GtfsLocationType.STATION))
// No issue with the types, but the station has no stop (just an entrance).
.containsExactly(new UnusedParentStationNotice(2, "parent", "Parent location"));
.containsExactly(new UnusedStationNotice(2, "parent", "Parent location"));
assertThat(validateChildAndParent(GtfsLocationType.ENTRANCE, GtfsLocationType.STOP))
.containsExactly(
new WrongParentLocationTypeNotice(
Expand All @@ -113,7 +113,7 @@ public void entranceParent() {
public void genericNodeParent() {
assertThat(validateChildAndParent(GtfsLocationType.GENERIC_NODE, GtfsLocationType.STATION))
// No issue with the types, but the station has no stop.
.containsExactly(new UnusedParentStationNotice(2, "parent", "Parent location"));
.containsExactly(new UnusedStationNotice(2, "parent", "Parent location"));
assertThat(validateChildAndParent(GtfsLocationType.GENERIC_NODE, GtfsLocationType.STOP))
.containsExactly(
new WrongParentLocationTypeNotice(
Expand Down Expand Up @@ -145,7 +145,7 @@ public void boardingAreaParent() {
"Parent location",
GtfsLocationType.STATION.getNumber(),
GtfsLocationType.STOP.getNumber()),
new UnusedParentStationNotice(2, "parent", "Parent location")));
new UnusedStationNotice(2, "parent", "Parent location")));
}

@Test
Expand Down Expand Up @@ -185,7 +185,7 @@ public void unusedStation() {
noticeContainer))
.validate(noticeContainer);
assertThat(noticeContainer.getValidationNotices())
.containsExactly(new UnusedParentStationNotice(2, "unused_station", "Unused station"));
.containsExactly(new UnusedStationNotice(2, "unused_station", "Unused station"));
}

@Test
Expand Down

0 comments on commit 2ed4dd7

Please sign in to comment.