From a25b7c3ab8a74ca567071375ea73e708cd4d06a4 Mon Sep 17 00:00:00 2001 From: cka-y Date: Tue, 8 Oct 2024 15:08:45 -0400 Subject: [PATCH] merge: master --- .../validator/MissingStopsFileValidator.java | 8 ++++---- .../validator/MissingStopsFileValidatorTest.java | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/MissingStopsFileValidator.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/MissingStopsFileValidator.java index 9d00ffbbbd..90122eb071 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/MissingStopsFileValidator.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/MissingStopsFileValidator.java @@ -10,18 +10,18 @@ public class MissingStopsFileValidator extends FileValidator { private final GtfsStopTableContainer stopTableContainer; - private final GtfsGeojsonFeaturesContainer geojsonFeaturesContainer; + private final GtfsGeoJSONFeaturesContainer geoJSONFeaturesContainer; @Inject MissingStopsFileValidator( - GtfsStopTableContainer table, GtfsGeojsonFeaturesContainer geojsonFeaturesContainer) { + GtfsStopTableContainer table, GtfsGeoJSONFeaturesContainer geoJSONFeaturesContainer) { this.stopTableContainer = table; - this.geojsonFeaturesContainer = geojsonFeaturesContainer; + this.geoJSONFeaturesContainer = geoJSONFeaturesContainer; } @Override public void validate(NoticeContainer noticeContainer) { - if (stopTableContainer.isMissingFile() && geojsonFeaturesContainer.isMissingFile()) { + if (stopTableContainer.isMissingFile() && geoJSONFeaturesContainer.isMissingFile()) { noticeContainer.addValidationNotice(new MissingRequiredFileNotice("stops.txt")); } } diff --git a/main/src/test/java/org/mobilitydata/gtfsvalidator/validator/MissingStopsFileValidatorTest.java b/main/src/test/java/org/mobilitydata/gtfsvalidator/validator/MissingStopsFileValidatorTest.java index 88a6dfae60..f470de0d52 100644 --- a/main/src/test/java/org/mobilitydata/gtfsvalidator/validator/MissingStopsFileValidatorTest.java +++ b/main/src/test/java/org/mobilitydata/gtfsvalidator/validator/MissingStopsFileValidatorTest.java @@ -6,8 +6,8 @@ import org.junit.Test; import org.mobilitydata.gtfsvalidator.notice.MissingRequiredFileNotice; import org.mobilitydata.gtfsvalidator.notice.NoticeContainer; -import org.mobilitydata.gtfsvalidator.table.GtfsGeojsonFeaturesContainer; -import org.mobilitydata.gtfsvalidator.table.GtfsGeojsonFileDescriptor; +import org.mobilitydata.gtfsvalidator.table.GtfsGeoJSONFeaturesContainer; +import org.mobilitydata.gtfsvalidator.table.GtfsGeoJSONFileDescriptor; import org.mobilitydata.gtfsvalidator.table.GtfsStopTableContainer; import org.mobilitydata.gtfsvalidator.table.TableStatus; @@ -16,12 +16,12 @@ public class MissingStopsFileValidatorTest { public void stopsTxtMissingFileShouldGenerateNotice() { // If stops.txt is missing and locations.geojson is missing, a notice should be generated NoticeContainer noticeContainer = new NoticeContainer(); - GtfsGeojsonFileDescriptor descriptor = new GtfsGeojsonFileDescriptor(); - GtfsGeojsonFeaturesContainer geoJsonFeaturesContainer = + GtfsGeoJSONFileDescriptor descriptor = new GtfsGeoJSONFileDescriptor(); + GtfsGeoJSONFeaturesContainer geoJSONFeaturesContainer = descriptor.createContainerForInvalidStatus(TableStatus.MISSING_FILE); GtfsStopTableContainer stopTableContainer = GtfsStopTableContainer.forStatus(TableStatus.MISSING_FILE); - new MissingStopsFileValidator(stopTableContainer, geoJsonFeaturesContainer) + new MissingStopsFileValidator(stopTableContainer, geoJSONFeaturesContainer) .validate(noticeContainer); assertThat(noticeContainer.getValidationNotices()) .containsExactly(new MissingRequiredFileNotice("stops.txt")); @@ -31,12 +31,12 @@ public void stopsTxtMissingFileShouldGenerateNotice() { public void stopsTxtMissingFileShouldNotGenerateNotice() { // If stops.txt is missing, but locations.geojson is present, no notice should be generated NoticeContainer noticeContainer = new NoticeContainer(); - GtfsGeojsonFileDescriptor descriptor = new GtfsGeojsonFileDescriptor(); - GtfsGeojsonFeaturesContainer geoJsonFeaturesContainer = + GtfsGeoJSONFileDescriptor descriptor = new GtfsGeoJSONFileDescriptor(); + GtfsGeoJSONFeaturesContainer geoJSONFeaturesContainer = descriptor.createContainerForEntities(new ArrayList<>(), noticeContainer); GtfsStopTableContainer stopTableContainer = GtfsStopTableContainer.forStatus(TableStatus.MISSING_FILE); - new MissingStopsFileValidator(stopTableContainer, geoJsonFeaturesContainer) + new MissingStopsFileValidator(stopTableContainer, geoJSONFeaturesContainer) .validate(noticeContainer); assertThat(noticeContainer.getValidationNotices()).isEmpty(); }