From 5bc0b78079eb2ec97a8e575cd3ec0ba9a2ee58a0 Mon Sep 17 00:00:00 2001 From: Vincent Paturet Date: Tue, 16 Jul 2024 13:55:27 +0200 Subject: [PATCH] Apply review suggestion --- .../mapping/MultiModalStationMapperTest.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/test/java/org/opentripplanner/netex/mapping/MultiModalStationMapperTest.java diff --git a/src/test/java/org/opentripplanner/netex/mapping/MultiModalStationMapperTest.java b/src/test/java/org/opentripplanner/netex/mapping/MultiModalStationMapperTest.java new file mode 100644 index 00000000000..435ba2878f2 --- /dev/null +++ b/src/test/java/org/opentripplanner/netex/mapping/MultiModalStationMapperTest.java @@ -0,0 +1,32 @@ +package org.opentripplanner.netex.mapping; + +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; +import org.opentripplanner.graph_builder.issue.service.DefaultDataImportIssueStore; +import org.opentripplanner.netex.NetexTestDataSupport; +import org.opentripplanner.netex.mapping.support.FeedScopedIdFactory; +import org.opentripplanner.transit.model._data.TransitModelForTest; +import org.rutebanken.netex.model.StopPlace; + +class MultiModalStationMapperTest { + + @Test + void testMissingCoordinates() { + DataImportIssueStore dataIssueStore = new DefaultDataImportIssueStore(); + FeedScopedIdFactory feedScopeIdFactory = new FeedScopedIdFactory(TransitModelForTest.FEED_ID); + MultiModalStationMapper multiModalStationMapper = new MultiModalStationMapper( + dataIssueStore, + feedScopeIdFactory + ); + StopPlace stopPlace = new StopPlace(); + stopPlace.setId(NetexTestDataSupport.STOP_PLACE_ID); + Assertions.assertNull(multiModalStationMapper.map(stopPlace, List.of())); + Assertions.assertEquals(1, dataIssueStore.listIssues().size()); + Assertions.assertEquals( + "MultiModalStationWithoutCoordinates", + dataIssueStore.listIssues().getFirst().getType() + ); + } +}