Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add url to feed source summary #566

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
br648 marked this conversation as resolved.
Show resolved Hide resolved

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
Loading