17
17
import org .zendesk .client .v2 .model .Brand ;
18
18
import org .zendesk .client .v2 .model .Collaborator ;
19
19
import org .zendesk .client .v2 .model .Comment ;
20
+ import org .zendesk .client .v2 .model .CommentType ;
20
21
import org .zendesk .client .v2 .model .ComplianceDeletionStatus ;
21
22
import org .zendesk .client .v2 .model .DeletedTicket ;
22
23
import org .zendesk .client .v2 .model .Field ;
@@ -1646,14 +1647,18 @@ public void getTicketCommentsShouldBeAscending() throws Exception {
1646
1647
Ticket ticket = null ;
1647
1648
try {
1648
1649
ticket = instance .createTicket (t );
1649
- instance .createComment (ticket .getId (), new Comment (TICKET_COMMENT2 ));
1650
+ final Comment comment = new Comment (TICKET_COMMENT2 );
1651
+ comment .setType (CommentType .COMMENT );
1652
+ instance .createComment (ticket .getId (), comment );
1650
1653
Iterable <Comment > ticketCommentsIt = instance .getTicketComments (ticket .getId ());
1651
1654
List <Comment > comments = new ArrayList <>();
1652
1655
ticketCommentsIt .forEach (comments ::add );
1653
1656
1654
1657
assertThat (comments .size (), is (2 ));
1655
1658
assertThat (comments .get (0 ).getBody (), containsString (TICKET_COMMENT1 ));
1659
+ assertThat (comments .get (0 ).getType (), is (CommentType .COMMENT ));
1656
1660
assertThat (comments .get (1 ).getBody (), containsString (TICKET_COMMENT2 ));
1661
+ assertThat (comments .get (1 ).getType (), is (CommentType .COMMENT ));
1657
1662
} finally {
1658
1663
if (ticket != null ) {
1659
1664
instance .deleteTicket (ticket .getId ());
@@ -1669,14 +1674,18 @@ public void getTicketCommentsDescending() throws Exception {
1669
1674
Ticket ticket = null ;
1670
1675
try {
1671
1676
ticket = instance .createTicket (t );
1672
- instance .createComment (ticket .getId (), new Comment (TICKET_COMMENT2 ));
1677
+ final Comment comment = new Comment (TICKET_COMMENT2 );
1678
+ comment .setType (CommentType .COMMENT );
1679
+ instance .createComment (ticket .getId (), comment );
1673
1680
Iterable <Comment > ticketCommentsIt = instance .getTicketComments (ticket .getId (), SortOrder .DESCENDING );
1674
1681
List <Comment > comments = new ArrayList <>();
1675
1682
ticketCommentsIt .forEach (comments ::add );
1676
1683
1677
1684
assertThat (comments .size (), is (2 ));
1678
1685
assertThat (comments .get (0 ).getBody (), containsString (TICKET_COMMENT2 ));
1686
+ assertThat (comments .get (0 ).getType (), is (CommentType .COMMENT ));
1679
1687
assertThat (comments .get (1 ).getBody (), containsString (TICKET_COMMENT1 ));
1688
+ assertThat (comments .get (1 ).getType (), is (CommentType .COMMENT ));
1680
1689
} finally {
1681
1690
if (ticket != null ) {
1682
1691
instance .deleteTicket (ticket .getId ());
0 commit comments