@@ -1423,6 +1423,76 @@ public void discussion_labeled() throws Exception {
14231423 assertThat (label .getDescription (), is (nullValue ()));
14241424 }
14251425
1426+ /**
1427+ * Discussion comment created.
1428+ *
1429+ * @throws Exception
1430+ * the exception
1431+ */
1432+ @ Test
1433+ public void discussion_comment_created () throws Exception {
1434+ final GHEventPayload .DiscussionComment discussionCommentPayload = GitHub .offline ()
1435+ .parseEventPayload (payload .asReader (), GHEventPayload .DiscussionComment .class );
1436+
1437+ assertThat (discussionCommentPayload .getAction (), is ("created" ));
1438+ assertThat (discussionCommentPayload .getRepository ().getFullName (), is ("gsmet/quarkus-bot-java-playground" ));
1439+ assertThat (discussionCommentPayload .getSender ().getLogin (), is ("gsmet" ));
1440+
1441+ GHRepositoryDiscussion discussion = discussionCommentPayload .getDiscussion ();
1442+
1443+ GHRepositoryDiscussion .Category category = discussion .getCategory ();
1444+
1445+ assertThat (category .getId (), is (33522033L ));
1446+ assertThat (category .getNodeId (), is ("DIC_kwDOEq3cwc4B_4Fx" ));
1447+ assertThat (category .getEmoji (), is (":pray:" ));
1448+ assertThat (category .getName (), is ("Q&A" ));
1449+ assertThat (category .getDescription (), is ("Ask the community for help" ));
1450+ assertThat (category .getCreatedAt ().getTime (), is (1636991431000L ));
1451+ assertThat (category .getUpdatedAt ().getTime (), is (1636991431000L ));
1452+ assertThat (category .getSlug (), is ("q-a" ));
1453+ assertThat (category .isAnswerable (), is (true ));
1454+
1455+ assertThat (discussion .getAnswerHtmlUrl (), is (nullValue ()));
1456+ assertThat (discussion .getAnswerChosenAt (), is (nullValue ()));
1457+ assertThat (discussion .getAnswerChosenBy (), is (nullValue ()));
1458+
1459+ assertThat (discussion .getHtmlUrl ().toString (),
1460+ is ("https://github.com/gsmet/quarkus-bot-java-playground/discussions/162" ));
1461+ assertThat (discussion .getId (), is (6090566L ));
1462+ assertThat (discussion .getNodeId (), is ("D_kwDOEq3cwc4AXO9G" ));
1463+ assertThat (discussion .getNumber (), is (162 ));
1464+ assertThat (discussion .getTitle (), is ("New test question" ));
1465+
1466+ assertThat (discussion .getUser ().getLogin (), is ("gsmet" ));
1467+ assertThat (discussion .getUser ().getId (), is (1279749L ));
1468+ assertThat (discussion .getUser ().getNodeId (), is ("MDQ6VXNlcjEyNzk3NDk=" ));
1469+
1470+ assertThat (discussion .getState (), is (GHRepositoryDiscussion .State .OPEN ));
1471+ assertThat (discussion .isLocked (), is (false ));
1472+ assertThat (discussion .getComments (), is (1 ));
1473+ assertThat (discussion .getCreatedAt ().getTime (), is (1705586390000L ));
1474+ assertThat (discussion .getUpdatedAt ().getTime (), is (1705586399000L ));
1475+ assertThat (discussion .getAuthorAssociation (), is (GHCommentAuthorAssociation .OWNER ));
1476+ assertThat (discussion .getActiveLockReason (), is (nullValue ()));
1477+ assertThat (discussion .getBody (), is ("Test question" ));
1478+
1479+ GHRepositoryDiscussionComment comment = discussionCommentPayload .getComment ();
1480+
1481+ assertThat (comment .getHtmlUrl ().toString (),
1482+ is ("https://github.com/gsmet/quarkus-bot-java-playground/discussions/162#discussioncomment-8169669" ));
1483+ assertThat (comment .getId (), is (8169669L ));
1484+ assertThat (comment .getNodeId (), is ("DC_kwDOEq3cwc4AfKjF" ));
1485+ assertThat (comment .getAuthorAssociation (), is (GHCommentAuthorAssociation .OWNER ));
1486+ assertThat (comment .getCreatedAt ().getTime (), is (1705586398000L ));
1487+ assertThat (comment .getUpdatedAt ().getTime (), is (1705586399000L ));
1488+ assertThat (comment .getBody (), is ("Test comment." ));
1489+ assertThat (comment .getUser ().getLogin (), is ("gsmet" ));
1490+ assertThat (comment .getUser ().getId (), is (1279749L ));
1491+ assertThat (comment .getUser ().getNodeId (), is ("MDQ6VXNlcjEyNzk3NDk=" ));
1492+ assertThat (comment .getParentId (), is (nullValue ()));
1493+ assertThat (comment .getChildCommentCount (), is (0 ));
1494+ }
1495+
14261496 /**
14271497 * Starred.
14281498 *
0 commit comments