Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ public class OtpApiClient {
public static final StopResponseProjection STOP_PROJECTION =
new StopResponseProjection().gtfsId().name().code();
public static final PlaceResponseProjection PLACE_PROJECTION =
new PlaceResponseProjection().name().departureTime().arrivalTime().stop(STOP_PROJECTION);
new PlaceResponseProjection()
.name()
.departureTime()
.arrivalTime()
.stop(STOP_PROJECTION)
.lat()
.lon();

private final CloseableHttpClient httpClient = HttpClientBuilder.create().build();

Expand Down
12 changes: 8 additions & 4 deletions client/src/test/java/org/opentripplanner/IntegrationTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.opentripplanner;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -68,6 +69,9 @@ public void plan() throws IOException {
// First leg should not interline with previous leg (since there is no previous leg)
assertFalse(leg.interlineWithPreviousLeg());

assertEquals(OSLO_WEST.lat(), leg.from().lat(), 0.01);
assertEquals(OSLO_WEST.lon(), leg.from().lon(), 0.01);

var transitLeg =
result.transitItineraries().stream()
.filter(i -> i.legs().stream().anyMatch(l -> l.intermediatePlaces().isPresent()))
Expand All @@ -76,11 +80,11 @@ public void plan() throws IOException {
.transitLegs()
.get(0);
assertFalse(transitLeg.from().stop().isEmpty());
assertNotNull(transitLeg.from().coordinate());
assertNotNull(transitLeg.from().point());
assertNotEquals(0, transitLeg.from().coordinate().getX());
assertNotEquals(0, transitLeg.from().point().getX());
assertFalse(transitLeg.to().stop().isEmpty());
assertNotNull(transitLeg.to().coordinate());
assertNotNull(transitLeg.to().point());
assertNotEquals(0, transitLeg.to().coordinate().getY());
assertNotEquals(0, transitLeg.to().point().getY());
assertNotNull(transitLeg.from().stop().get().id());
assertTrue(transitLeg.trip().headsign().isPresent());
assertNotNull(transitLeg.agency());
Expand Down