From bfb60e8ef52d7c33c52dfb15bcc8fff4436252f4 Mon Sep 17 00:00:00 2001 From: Sabina Fataliyeva Date: Wed, 11 Dec 2024 14:26:31 +0200 Subject: [PATCH] Fix in OsrmConfiguration --- .../netex/producer/NetexIdProducer.java | 3 +- .../uttu/routing/osrm/OsrmConfiguration.java | 3 +- .../producer/NetexObjectFactoryTest.java | 30 ++++++++++--------- 3 files changed, 20 insertions(+), 16 deletions(-) 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/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() + ); + } }