-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5329 from entur/fix_vehicle_filtering_in_bike_ren…
…tal_station_api Fix filtering of rental vehicle in vehicle station BBox search
- Loading branch information
Showing
5 changed files
with
86 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...a/org/opentripplanner/service/vehiclerental/internal/DefaultVehicleRentalServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.opentripplanner.service.vehiclerental.internal; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
import org.opentripplanner.service.vehiclerental.model.TestFreeFloatingRentalVehicleBuilder; | ||
import org.opentripplanner.service.vehiclerental.model.TestVehicleRentalStationBuilder; | ||
import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; | ||
import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; | ||
import org.opentripplanner.transit.model.framework.FeedScopedId; | ||
|
||
class DefaultVehicleRentalServiceTest { | ||
|
||
@Test | ||
void getVehicleRentalStationForEnvelopeShouldExcludeVehicleRentalVehicle() { | ||
DefaultVehicleRentalService defaultVehicleRentalService = new DefaultVehicleRentalService(); | ||
|
||
VehicleRentalStation vehicleRentalStation = new TestVehicleRentalStationBuilder() | ||
.withLatitude(1) | ||
.withLongitude(1) | ||
.build(); | ||
defaultVehicleRentalService.addVehicleRentalStation(vehicleRentalStation); | ||
|
||
VehicleRentalVehicle vehicleRentalVehicle = new TestFreeFloatingRentalVehicleBuilder() | ||
.withLatitude(2) | ||
.withLongitude(2) | ||
.build(); | ||
defaultVehicleRentalService.addVehicleRentalStation(vehicleRentalVehicle); | ||
|
||
List<VehicleRentalStation> vehicleRentalStationForEnvelope = defaultVehicleRentalService.getVehicleRentalStationForEnvelope( | ||
0, | ||
0, | ||
10, | ||
10 | ||
); | ||
assertEquals(1, vehicleRentalStationForEnvelope.size()); | ||
assertEquals(vehicleRentalStation, vehicleRentalStationForEnvelope.get(0)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters