diff --git a/src/main/java/no/entur/uttu/export/netex/producer/NetexIdProducer.java b/src/main/java/no/entur/uttu/export/netex/producer/NetexIdProducer.java index bdc1005b..d64a856c 100644 --- a/src/main/java/no/entur/uttu/export/netex/producer/NetexIdProducer.java +++ b/src/main/java/no/entur/uttu/export/netex/producer/NetexIdProducer.java @@ -126,7 +126,8 @@ public static String getEntityName(E entity) { } } else if (entity instanceof VersionedChildStructure) { if (localPart.endsWith("VersionedChildStructure")) { - localPart = localPart.substring(0, localPart.lastIndexOf("_VersionedChildStructure")); + localPart = + localPart.substring(0, localPart.lastIndexOf("_VersionedChildStructure")); } } return localPart; diff --git a/src/main/java/no/entur/uttu/export/netex/producer/common/ServiceLinkProducer.java b/src/main/java/no/entur/uttu/export/netex/producer/common/ServiceLinkProducer.java index 40928eb3..f449abca 100644 --- a/src/main/java/no/entur/uttu/export/netex/producer/common/ServiceLinkProducer.java +++ b/src/main/java/no/entur/uttu/export/netex/producer/common/ServiceLinkProducer.java @@ -136,24 +136,6 @@ Quay getQuay(String quayRef) { .get(0); } - String extractQuayRefFrom(Ref serviceLinkRef, NetexExportContext context) { - String suffix = NetexIdProducer.getObjectIdSuffix(serviceLinkRef.id).split("_")[0]; - return getQuayRef(context, suffix); - } - - String extractQuayRefTo(Ref serviceLinkRef, NetexExportContext context) { - String suffix = NetexIdProducer.getObjectIdSuffix(serviceLinkRef.id).split("_")[1]; - return getQuayRef(context, suffix); - } - - String getQuayRef(NetexExportContext context, String suffix) { - return context.quayRefs - .stream() - .filter(quay -> NetexIdProducer.getObjectIdSuffix(quay).equals(suffix)) - .findFirst() - .get(); - } - String getLineStringId(Ref serviceLinkRef) { String serviceLinkSuffix = NetexIdProducer.getObjectIdSuffix(serviceLinkRef.id); return "LS_" + serviceLinkSuffix; diff --git a/src/main/java/no/entur/uttu/routing/osrm/OsrmConfiguration.java b/src/main/java/no/entur/uttu/routing/osrm/OsrmConfiguration.java index 306f3c0f..e435313f 100644 --- a/src/main/java/no/entur/uttu/routing/osrm/OsrmConfiguration.java +++ b/src/main/java/no/entur/uttu/routing/osrm/OsrmConfiguration.java @@ -1,5 +1,6 @@ package no.entur.uttu.routing.osrm; +import no.entur.uttu.routing.RoutingService; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -10,7 +11,7 @@ public class OsrmConfiguration { @Bean - OsrmService osrmService(@Value("${uttu.routing.osrm-api}") String osrmApi) { + RoutingService routingService(@Value("${uttu.routing.osrm-api}") String osrmApi) { return new OsrmService(osrmApi); } } diff --git a/src/test/java/no/entur/uttu/export/netex/producer/NetexObjectFactoryTest.java b/src/test/java/no/entur/uttu/export/netex/producer/NetexObjectFactoryTest.java index c456cdab..c682b302 100644 --- a/src/test/java/no/entur/uttu/export/netex/producer/NetexObjectFactoryTest.java +++ b/src/test/java/no/entur/uttu/export/netex/producer/NetexObjectFactoryTest.java @@ -9,19 +9,21 @@ public class NetexObjectFactoryTest { - @Test - void populateIdReturnsValidIdForVersionedChildStructureElements() { - NetexObjectFactory factory = new NetexObjectFactory( - new DateUtils(), - new ExportTimeZone() - ); + @Test + void populateIdReturnsValidIdForVersionedChildStructureElements() { + NetexObjectFactory factory = new NetexObjectFactory( + new DateUtils(), + new ExportTimeZone() + ); - Assertions.assertEquals( - "ENT:ServiceLinkInJourneyPattern:1", - factory.populateId( - new ServiceLinkInJourneyPattern_VersionedChildStructure(), - new Ref("ENT:ServiceLink:1", "1") - ).getId() - ); - } + Assertions.assertEquals( + "ENT:ServiceLinkInJourneyPattern:1", + factory + .populateId( + new ServiceLinkInJourneyPattern_VersionedChildStructure(), + new Ref("ENT:ServiceLink:1", "1") + ) + .getId() + ); + } }