Backend: Add support for Announcement Description (#6493)

This commit is contained in:
Vivek Ratnavel Subramanian 2022-08-01 16:19:45 -07:00 committed by GitHub
parent 550b4645cf
commit 39df2a4845
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -116,6 +116,10 @@
"description": "Details about the announcement. This is only applicable if thread is of type announcement.",
"type": "object",
"properties": {
"description": {
"description": "Announcement description in markdown format. See markdown support for more details.",
"type": "string"
},
"startTime": {
"description": "Timestamp of the start time from when the announcement should be shown.",
"$ref": "../../type/basic.json#/definitions/timestamp"

View File

@ -425,6 +425,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
LocalDateTime now = LocalDateTime.now();
AnnouncementDetails announcementDetails =
new AnnouncementDetails()
.withDescription("First announcement")
.withStartTime(now.plusDays(1L).toEpochSecond(ZoneOffset.UTC))
.withEndTime(now.plusDays(2L).toEpochSecond(ZoneOffset.UTC));
CreateThread create =
@ -455,6 +456,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
// create one active announcement
announcementDetails
.withDescription("Active Announcement")
.withStartTime(now.minusDays(2L).toEpochSecond(ZoneOffset.UTC))
.withEndTime(now.plusDays(5L).toEpochSecond(ZoneOffset.UTC));
create =
@ -479,6 +481,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
assertEquals(1, activeAnnouncementCount);
assertEquals(1, announcements.getData().size());
assertEquals("Active Announcement", announcements.getData().get(0).getAnnouncement().getDescription());
announcements = listAnnouncements(create.getAbout(), null, true, ADMIN_AUTH_HEADERS);
assertEquals(activeAnnouncementCount, announcements.getPaging().getTotal());