Skip to content

Commit

Permalink
Fix in OsrmConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
solita-sabinaf committed Dec 11, 2024
1 parent 5494a67 commit bfb60e8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public static <E> 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
}

0 comments on commit bfb60e8

Please sign in to comment.