Skip to main content
added 215 characters in body
Source Link
rna7
  • 347
  • 5
  • 20

I have a trigger that posts a ConnectApi.AnnouncementInput, but how do I test that this has been posted, and to the correct chattergroup?

I've created the test collaborationgroup in my test method, but I don't know how I can find the related objects to test the feed has been updated.

Thank you.

Edit: Both methods listed in answers seem to work, but the problem now is why the Advanced Apex Superbadge has implement !Test.isRunning() for the method that holds the functionality of posting the chatter feed.

I have a trigger that posts a ConnectApi.AnnouncementInput, but how do I test that this has been posted, and to the correct chattergroup?

I've created the test collaborationgroup in my test method, but I don't know how I can find the related objects to test the feed has been updated.

Thank you.

I have a trigger that posts a ConnectApi.AnnouncementInput, but how do I test that this has been posted, and to the correct chattergroup?

I've created the test collaborationgroup in my test method, but I don't know how I can find the related objects to test the feed has been updated.

Thank you.

Edit: Both methods listed in answers seem to work, but the problem now is why the Advanced Apex Superbadge has implement !Test.isRunning() for the method that holds the functionality of posting the chatter feed.

Source Link
rna7
  • 347
  • 5
  • 20

How do I test that a ConnectApi.AnnouncementInput has been posted to a CollaborationGroup?

I have a trigger that posts a ConnectApi.AnnouncementInput, but how do I test that this has been posted, and to the correct chattergroup?

I've created the test collaborationgroup in my test method, but I don't know how I can find the related objects to test the feed has been updated.

Thank you.