Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev-2.x' into stop-times-helper
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Mar 4, 2025
2 parents 16b6fe5 + 04fadbf commit 2dc7bab
Show file tree
Hide file tree
Showing 1,458 changed files with 23,591 additions and 20,896 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# project-wide reformatting with prettier
9c9dd613489a348d2381acdcbeab8f86589154d7
e8e9a7716955b68b5b37997a0267148f1dcbcf9e

# graphql test and documentation reformatting with prettier
12c51f44f204db31d34a1eeb0d59204226e0fa5d
Expand Down
12 changes: 7 additions & 5 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.14.2</version>
<version>5.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -359,17 +359,17 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.46.0</version>
<version>1.55.2</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-messaging-servicebus</artifactId>
<version>7.15.0</version>
<version>7.17.8</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.15.1</version>
<version>1.15.3</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -496,6 +496,8 @@
<inputGlob>src/ext-test/java/**/*.java</inputGlob>
<inputGlob>src/**/*.json</inputGlob>
<inputGlob>src/test/resources/org/opentripplanner/apis/**/*.graphql</inputGlob>
<!-- Ignore patterns. -->
<inputGlob>!src/test/resources/org/opentripplanner/apis/vectortiles/style.json</inputGlob>
</inputGlobs>
</configuration>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions application/src/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/img/otp-logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OTP Debug</title>
<script type="module" crossorigin src="https://www.opentripplanner.org/debug-client-assets/2025/02/2025-02-12T05:49/assets/index-CoUlulCU.js"></script>
<link rel="stylesheet" crossorigin href="https://www.opentripplanner.org/debug-client-assets/2025/02/2025-02-12T05:49/assets/index-CiWBeHPw.css">
<script type="module" crossorigin src="https://www.opentripplanner.org/debug-client-assets/2025/02/2025-02-21T08:26/assets/index-VgIShtst.js"></script>
<link rel="stylesheet" crossorigin href="https://www.opentripplanner.org/debug-client-assets/2025/02/2025-02-21T08:26/assets/index-CiWBeHPw.css">
</head>
<body>
<div id="root"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
class DecorateWithAccessibilityScoreTest implements PlanTestConstants {

private static final int ID = 1;
private static final DecorateWithAccessibilityScore DECORATOR = new DecorateWithAccessibilityScore(
WheelchairPreferences.DEFAULT.maxSlope()
);
private static final DecorateWithAccessibilityScore DECORATOR =
new DecorateWithAccessibilityScore(WheelchairPreferences.DEFAULT.maxSlope());

static List<Arguments> accessibilityScoreTestCase() {
return List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public class EmissionsModuleTest {
void testMultipleGtfsDataReading() {
inputData.put(GTFS, new FileDataSource(CO2_GTFS_ZIP, GTFS));
inputData.put(GTFS, new FileDataSource(CO2_GTFS, GTFS));
Iterable<ConfiguredDataSource<GtfsFeedParameters>> configuredDataSource = getGtfsConfiguredDatasource();
Iterable<ConfiguredDataSource<GtfsFeedParameters>> configuredDataSource =
getGtfsConfiguredDatasource();
EmissionsDataModel emissionsDataModel = new EmissionsDataModel();
EmissionsModule emissionsModule = new EmissionsModule(
configuredDataSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,26 @@ class EmissionsTest {
private static DefaultEmissionsService eService;
private static DecorateWithEmission decorateWithEmission;

static final ZonedDateTime TIME = OffsetDateTime
.parse("2023-07-20T17:49:06+03:00")
.toZonedDateTime();
static final ZonedDateTime TIME = OffsetDateTime.parse(
"2023-07-20T17:49:06+03:00"
).toZonedDateTime();

private static final StreetLeg STREET_LEG = StreetLeg
.create()
private static final StreetLeg STREET_LEG = StreetLeg.create()
.withMode(TraverseMode.CAR)
.withDistanceMeters(214.4)
.withStartTime(TIME)
.withEndTime(TIME.plusHours(1))
.build();

private static final Route ROUTE_WITH_EMISSIONS = TimetableRepositoryForTest
.route(id("1"))
.build();
private static final Route ROUTE_WITH_ZERO_EMISSIONS = TimetableRepositoryForTest
.route(id("2"))
.build();
private static final Route ROUTE_WITHOUT_EMISSIONS_CONFIGURED = TimetableRepositoryForTest
.route(id("3"))
.build();
private static final Route ROUTE_WITH_EMISSIONS = TimetableRepositoryForTest.route(
id("1")
).build();
private static final Route ROUTE_WITH_ZERO_EMISSIONS = TimetableRepositoryForTest.route(
id("2")
).build();
private static final Route ROUTE_WITHOUT_EMISSIONS_CONFIGURED = TimetableRepositoryForTest.route(
id("3")
).build();

@BeforeAll
static void SetUp() {
Expand Down Expand Up @@ -129,12 +128,10 @@ private ScheduledTransitLeg createTransitLeg(Route route) {
var stopTwo = testModel.stop("1:stop1", 61, 25).build();
var stopThree = testModel.stop("1:stop1", 62, 25).build();
var stopPattern = TimetableRepositoryForTest.stopPattern(stopOne, stopTwo, stopThree);
var pattern = TimetableRepositoryForTest
.tripPattern("1", route)
var pattern = TimetableRepositoryForTest.tripPattern("1", route)
.withStopPattern(stopPattern)
.build();
var trip = Trip
.of(FeedScopedId.parse("FOO:BAR"))
var trip = Trip.of(FeedScopedId.parse("FOO:BAR"))
.withMode(TransitMode.BUS)
.withRoute(route)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class FareRuleSetTest {
@BeforeEach
void setUp() {
FeedScopedId id = new FeedScopedId("feed", "fare1");
FareAttribute fareAttribute = FareAttribute
.of(id)
FareAttribute fareAttribute = FareAttribute.of(id)
.setPrice(TWO_FIFTY)
.setPaymentMethod(1)
.setTransfers(1)
Expand Down Expand Up @@ -175,8 +174,7 @@ void testMatchesWithTransferDuration() {

@Test
void testMatchesWithJourneyDuration() {
FareAttribute journeyFare = FareAttribute
.of(new FeedScopedId("feed", "journey"))
FareAttribute journeyFare = FareAttribute.of(new FeedScopedId("feed", "journey"))
.setPrice(Money.usDollars(3.00f))
.setPaymentMethod(1)
.setJourneyDuration(7200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,11 @@ void fromCobbTransfers() {
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE).plus(usDollars(3)));

// Local to circulator to express
rides =
List.of(
getLeg(COBB_AGENCY_ID, 0),
getLeg(COBB_AGENCY_ID, "BLUE", 1),
getLeg(COBB_AGENCY_ID, "101", 1)
);
rides = List.of(
getLeg(COBB_AGENCY_ID, 0),
getLeg(COBB_AGENCY_ID, "BLUE", 1),
getLeg(COBB_AGENCY_ID, "101", 1)
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(usDollars(1)));
}

Expand All @@ -122,45 +121,41 @@ void tooManyLegs() {
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));

rides =
List.of(
getLeg(MARTA_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, 1),
getLeg(GCT_AGENCY_ID, 2),
getLeg(GCT_AGENCY_ID, 3),
getLeg(MARTA_AGENCY_ID, 4),
getLeg(COBB_AGENCY_ID, 5)
);
rides = List.of(
getLeg(MARTA_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, 1),
getLeg(GCT_AGENCY_ID, 2),
getLeg(GCT_AGENCY_ID, 3),
getLeg(MARTA_AGENCY_ID, 4),
getLeg(COBB_AGENCY_ID, 5)
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));

rides =
List.of(
getLeg(GCT_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, 1),
getLeg(MARTA_AGENCY_ID, 2),
getLeg(MARTA_AGENCY_ID, 3)
);
rides = List.of(
getLeg(GCT_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, 1),
getLeg(MARTA_AGENCY_ID, 2),
getLeg(MARTA_AGENCY_ID, 3)
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE);

rides =
List.of(
getLeg(GCT_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, 1),
getLeg(MARTA_AGENCY_ID, 2),
getLeg(MARTA_AGENCY_ID, 3),
// new transfer - only got 3 from GCT
getLeg(MARTA_AGENCY_ID, 4)
);
rides = List.of(
getLeg(GCT_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, 1),
getLeg(MARTA_AGENCY_ID, 2),
getLeg(MARTA_AGENCY_ID, 3),
// new transfer - only got 3 from GCT
getLeg(MARTA_AGENCY_ID, 4)
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));

rides =
List.of(
getLeg(MARTA_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, 1),
getLeg(MARTA_AGENCY_ID, 2),
getLeg(GCT_AGENCY_ID, 3),
getLeg(GCT_AGENCY_ID, 4)
);
rides = List.of(
getLeg(MARTA_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, 1),
getLeg(MARTA_AGENCY_ID, 2),
getLeg(GCT_AGENCY_ID, 3),
getLeg(GCT_AGENCY_ID, 4)
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE);
}

Expand All @@ -174,14 +169,13 @@ void expiredTransfer() {
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));

rides =
List.of(
getLeg(MARTA_AGENCY_ID, 0),
getLeg(GCT_AGENCY_ID, 1),
getLeg(GCT_AGENCY_ID, 181),
getLeg(MARTA_AGENCY_ID, 181 + 178),
getLeg(MARTA_AGENCY_ID, 181 + 179)
);
rides = List.of(
getLeg(MARTA_AGENCY_ID, 0),
getLeg(GCT_AGENCY_ID, 1),
getLeg(GCT_AGENCY_ID, 181),
getLeg(MARTA_AGENCY_ID, 181 + 178),
getLeg(MARTA_AGENCY_ID, 181 + 179)
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE));
}

Expand All @@ -197,12 +191,11 @@ void useStreetcar() {
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(STREETCAR_PRICE));

rides =
List.of(
getLeg(COBB_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, "atlsc", 1),
getLeg(COBB_AGENCY_ID, "101", 2)
);
rides = List.of(
getLeg(COBB_AGENCY_ID, 0),
getLeg(MARTA_AGENCY_ID, "atlsc", 1),
getLeg(COBB_AGENCY_ID, "101", 2)
);
calculateFare(rides, DEFAULT_TEST_RIDE_PRICE.plus(usDollars(1)).plus(STREETCAR_PRICE));
}

Expand Down Expand Up @@ -263,8 +256,7 @@ private static Leg createLeg(String agencyId, String shortName, long startTimeMi

private static Itinerary createItinerary(String agencyId, String shortName, long startTimeMins) {
var siteRepositoryBuilder = SiteRepository.of();
Agency agency = Agency
.of(new FeedScopedId(FEED_ID, agencyId))
Agency agency = Agency.of(new FeedScopedId(FEED_ID, agencyId))
.withName(agencyId)
.withTimezone(ZoneIds.NEW_YORK.getId())
.build();
Expand All @@ -282,8 +274,7 @@ private static Itinerary createItinerary(String agencyId, String shortName, long
.build();

FeedScopedId routeFeedScopeId = new FeedScopedId(FEED_ID, "123");
Route route = Route
.of(routeFeedScopeId)
Route route = Route.of(routeFeedScopeId)
.withAgency(agency)
.withShortName(shortName)
.withLongName(new NonLocalizedString("123"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@
class DefaultFareServiceTest implements PlanTestConstants {

private static final Money TEN_DOLLARS = Money.usDollars(10);
private static final FareProduct OTHER_FEED_PRODUCT = FareProduct
.of(OTHER_FEED_ATTRIBUTE.getId(), "regular", TEN_DOLLARS)
.build();
private static final FareProduct AIRPORT_TO_CITY_CENTER_PRODUCT = FareProduct
.of(AIRPORT_TO_CITY_CENTER_SET.getFareAttribute().getId(), "regular", TEN_DOLLARS)
.build();
private static final FareProduct OTHER_FEED_PRODUCT = FareProduct.of(
OTHER_FEED_ATTRIBUTE.getId(),
"regular",
TEN_DOLLARS
).build();
private static final FareProduct AIRPORT_TO_CITY_CENTER_PRODUCT = FareProduct.of(
AIRPORT_TO_CITY_CENTER_SET.getFareAttribute().getId(),
"regular",
TEN_DOLLARS
).build();

@Test
void noRules() {
Expand Down Expand Up @@ -92,13 +96,11 @@ void applyToSeveralLegs() {
List.of(
new FareProductUse(
"ddbf1572-18bc-3724-8b64-e1c7d5c8b6c6",
FareProduct
.of(
FREE_TRANSFERS_IN_CITY_SET.getFareAttribute().getId(),
"regular",
TEN_DOLLARS.plus(TEN_DOLLARS)
)
.build()
FareProduct.of(
FREE_TRANSFERS_IN_CITY_SET.getFareAttribute().getId(),
"regular",
TEN_DOLLARS.plus(TEN_DOLLARS)
).build()
)
),
firstProducts
Expand Down
Loading

0 comments on commit 2dc7bab

Please sign in to comment.