diff --git a/src/main/java/com/conveyal/datatools/manager/models/FeedSourceSummary.java b/src/main/java/com/conveyal/datatools/manager/models/FeedSourceSummary.java index 9cf031df7..2c5d6197f 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/FeedSourceSummary.java +++ b/src/main/java/com/conveyal/datatools/manager/models/FeedSourceSummary.java @@ -62,6 +62,8 @@ public class FeedSourceSummary { public LatestValidationResult latestValidation; + public String url; + public FeedSourceSummary() { } @@ -77,6 +79,7 @@ public FeedSourceSummary(String projectId, Document feedSourceDocument) { } // Convert to local date type for consistency. this.lastUpdated = getLocalDateFromDate(feedSourceDocument.getDate("lastUpdated")); + this.url = feedSourceDocument.getString("url"); } /** @@ -117,7 +120,8 @@ public static List getFeedSourceSummaries(String projectId) { "deployable": 1, "isPublic": 1, "lastUpdated": 1, - "labelIds": 1 + "labelIds": 1, + "url": 1 } }, { @@ -138,7 +142,8 @@ public static List getFeedSourceSummaries(String projectId) { "deployable", "isPublic", "lastUpdated", - "labelIds") + "labelIds", + "url") ) ), sort(Sorts.ascending("name")) diff --git a/src/test/java/com/conveyal/datatools/manager/controllers/api/FeedSourceControllerTest.java b/src/test/java/com/conveyal/datatools/manager/controllers/api/FeedSourceControllerTest.java index 21faa0dd9..a93f14630 100644 --- a/src/test/java/com/conveyal/datatools/manager/controllers/api/FeedSourceControllerTest.java +++ b/src/test/java/com/conveyal/datatools/manager/controllers/api/FeedSourceControllerTest.java @@ -75,8 +75,8 @@ public static void setUp() throws IOException { feedSourceWithUrl = createFeedSource("FeedSourceOne", new URL("http://www.feedsource.com"), project); feedSourceWithNoUrl = createFeedSource("FeedSourceTwo", null, project); - feedSourceWithLabels = createFeedSource("FeedSourceThree", null, projectToBeDeleted); - feedSourceWithInvalidLabels = createFeedSource("FeedSourceFour", null, project); + feedSourceWithLabels = createFeedSource("FeedSourceThree", new URL("http://www.feedsource.com"), projectToBeDeleted); + feedSourceWithInvalidLabels = createFeedSource("FeedSourceFour", new URL("http://www.feedsource.com"), project); adminOnlyLabel = createLabel("Admin Only Label"); adminOnlyLabel.adminOnly = true; @@ -89,7 +89,7 @@ public static void setUp() throws IOException { feedSourceWithLatestDeploymentFeedVersion = createFeedSource( "feed-source-with-latest-deployment-feed-version", "FeedSource", - null, + new URL("http://www.feedsource.com"), projectWithLatestDeployment, true, List.of("labelOne", "labelTwo") @@ -123,7 +123,7 @@ public static void setUp() throws IOException { feedSourceWithPinnedDeploymentFeedVersion = createFeedSource( "feed-source-with-pinned-deployment-feed-version", "FeedSourceWithPinnedFeedVersion", - null, + new URL("http://www.feedsource.com"), projectWithPinnedDeployment, true, List.of("labelOne", "labelTwo") @@ -344,6 +344,7 @@ void canRetrieveDeployedFeedVersionFromLatestDeployment() throws IOException { assertEquals(feedSourceWithLatestDeploymentFeedVersion.id, feedSourceSummaries.get(0).id); assertEquals(feedSourceWithLatestDeploymentFeedVersion.projectId, feedSourceSummaries.get(0).projectId); assertEquals(feedSourceWithLatestDeploymentFeedVersion.labelIds, feedSourceSummaries.get(0).labelIds); + assertEquals(feedSourceWithLatestDeploymentFeedVersion.url.toString(), feedSourceSummaries.get(0).url); assertEquals(feedVersionFromLatestDeployment.id, feedSourceSummaries.get(0).deployedFeedVersionId); assertEquals(feedVersionFromLatestDeployment.validationSummary().startDate, feedSourceSummaries.get(0).deployedFeedVersionStartDate); assertEquals(feedVersionFromLatestDeployment.validationSummary().endDate, feedSourceSummaries.get(0).deployedFeedVersionEndDate); @@ -375,6 +376,7 @@ void canRetrieveDeployedFeedVersionFromPinnedDeployment() throws IOException { assertEquals(feedSourceWithPinnedDeploymentFeedVersion.id, feedSourceSummaries.get(0).id); assertEquals(feedSourceWithPinnedDeploymentFeedVersion.projectId, feedSourceSummaries.get(0).projectId); assertEquals(feedSourceWithPinnedDeploymentFeedVersion.labelIds, feedSourceSummaries.get(0).labelIds); + assertEquals(feedSourceWithPinnedDeploymentFeedVersion.url.toString(), feedSourceSummaries.get(0).url); assertEquals(feedVersionFromPinnedDeployment.id, feedSourceSummaries.get(0).deployedFeedVersionId); assertEquals(feedVersionFromPinnedDeployment.validationSummary().startDate, feedSourceSummaries.get(0).deployedFeedVersionStartDate); assertEquals(feedVersionFromPinnedDeployment.validationSummary().endDate, feedSourceSummaries.get(0).deployedFeedVersionEndDate);