File tree Expand file tree Collapse file tree
main/java/org/mobilitydata/gtfsvalidator/validator
test/java/org/mobilitydata/gtfsvalidator/validator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525public class StopAccessValidator extends SingleEntityValidator <GtfsStop > {
2626 @ Override
2727 public void validate (GtfsStop entity , NoticeContainer noticeContainer ) {
28- if (entity .stopAccess () == null ) {
28+ if (entity .stopAccess () == null || ! entity . hasStopAccess () ) {
2929 return ;
3030 }
3131 if (entity .locationType () == GtfsLocationType .STOP ) {
Original file line number Diff line number Diff line change @@ -61,4 +61,30 @@ public void nonStopLocationWithStopAccess_generatesIncorrectLocationNotice() {
6161 GtfsStopAccess .NOT_ACCESSIBLE_VIA_PATHWAYS ,
6262 GtfsLocationType .STATION ));
6363 }
64+
65+ @ Test
66+ public void stopLocationWithoutParentStation_withoutStopAccess_generatesNoNotice () {
67+ GtfsStop stop =
68+ new GtfsStop .Builder ()
69+ .setCsvRowNumber (10 )
70+ .setStopId ("S3" )
71+ .setLocationType (GtfsLocationType .STOP )
72+ .setStopName ("Stop 3" )
73+ .build ();
74+
75+ assertThat (generateNotices (stop )).isEmpty ();
76+ }
77+
78+ @ Test
79+ public void nonStopLocation_withoutStopAccess_generatesNoNotice () {
80+ GtfsStop stop =
81+ new GtfsStop .Builder ()
82+ .setCsvRowNumber (11 )
83+ .setStopId ("S4" )
84+ .setLocationType (GtfsLocationType .STATION )
85+ .setStopName ("Stop 4" )
86+ .build ();
87+
88+ assertThat (generateNotices (stop )).isEmpty ();
89+ }
6490}
You can’t perform that action at this time.
0 commit comments