Skip to content

Commit

Permalink
Merge pull request #566 from ibi-group/add-url-to-feed-source-summary
Browse files Browse the repository at this point in the history
Add url to feed source summary
  • Loading branch information
br648 authored Oct 6, 2023
2 parents 390423e + ebbfdaf commit b22b422
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public class FeedSourceSummary {

public LatestValidationResult latestValidation;

public String url;

public FeedSourceSummary() {
}

Expand All @@ -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");
}

/**
Expand Down Expand Up @@ -117,7 +120,8 @@ public static List<FeedSourceSummary> getFeedSourceSummaries(String projectId) {
"deployable": 1,
"isPublic": 1,
"lastUpdated": 1,
"labelIds": 1
"labelIds": 1,
"url": 1
}
},
{
Expand All @@ -138,7 +142,8 @@ public static List<FeedSourceSummary> getFeedSourceSummaries(String projectId) {
"deployable",
"isPublic",
"lastUpdated",
"labelIds")
"labelIds",
"url")
)
),
sort(Sorts.ascending("name"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b22b422

Please sign in to comment.