You need to sign in to do that
Don't have an account?
Test Coverage for ConnectApi.FeedItemPage in Version 34
I have to test cover this line:
ConnectApi.FeedItemPage items = ConnectApi.ChatterFeeds.getFeedItemsFromFeed(null, ConnectApi.FeedType.News, 'me');
Here is my test class:
@isTest private class NewsFeedClassTest {
@IsTest static void doTest() {
// Build a simple feed item
ConnectApi.FeedItemPage testPage = new ConnectApi.FeedItemPage();
List<ConnectApi.FeedItem> testItemList = new List<ConnectApi.FeedItem>();
testItemList.add(new ConnectApi.FeedItem());
testItemList.add(new ConnectApi.FeedItem());
testPage.items = testItemList;
}
}
This works fine with Version 30, but whenever I change to version 34 of apex it givers deprecated property error, any one knows how to test cover the following lines of code??
Thanks & Regards,
Ajay
For more info, the docs are at:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_ChatterFeeds_static_methods.htm#apex_ConnectAPI_ChatterFeeds_getFeedElementsFromFeed_2