Skip to content

Commit

Permalink
Add test for feedinfo query
Browse files Browse the repository at this point in the history
  • Loading branch information
vesameskanen committed May 8, 2024
1 parent 4b9b065 commit 119927e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.framework.i18n.NonLocalizedString;
import org.opentripplanner.framework.model.Grams;
import org.opentripplanner.model.FeedInfo;
import org.opentripplanner.model.fare.FareMedium;
import org.opentripplanner.model.fare.FareProduct;
import org.opentripplanner.model.fare.ItineraryFares;
Expand Down Expand Up @@ -84,6 +85,7 @@
import org.opentripplanner.transit.model.framework.FeedScopedId;
import org.opentripplanner.transit.model.network.BikeAccess;
import org.opentripplanner.transit.model.network.TripPattern;
import org.opentripplanner.transit.model.organization.Agency;
import org.opentripplanner.transit.model.site.RegularStop;
import org.opentripplanner.transit.model.site.StopLocation;
import org.opentripplanner.transit.model.timetable.RealTimeTripTimes;
Expand Down Expand Up @@ -151,6 +153,18 @@ static void setup() {

transitModel.addTripPattern(id("pattern-1"), pattern);

var feedId = "testfeed";
var feedInfo = FeedInfo.dummyForTest(feedId);
transitModel.addFeedInfo(feedInfo);

var agency = Agency
.of(new FeedScopedId(feedId, "agency-xx"))
.withName("speedtransit")
.withUrl("www.otp-foo.bar")
.withTimezone("Europe/Berlin")
.build();
transitModel.addAgency(agency);

transitModel.initTimeZone(ZoneIds.BERLIN);
transitModel.index();
var routes = Arrays
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"data" : {
"feeds" : [
{
"agencies" : [
{
"name" : "speedtransit",
"url" : "www.otp-foo.bar"
}
],
"publisherUrl" : "www.z.org",
"publisherName" : "publisher"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
feeds {
agencies {
name
url
}
publisherUrl
publisherName
}
}

0 comments on commit 119927e

Please sign in to comment.