+ Start a Discussion
pujapuja 

: Error: Compile Error: Invalid type: FeedPost

I created a test class but it gives a compilation error : Error: Compile Error: Invalid type: FeedPost at line 20 column 31

Please Help:

 

@isTest

private class TestChatterPostOnOpprty {

public static testMethod void unitTest() {

Opportunity opp = new Opportunity(
Name='Test',
StageName='Prospecting',
CloseDate=Date.today()
);
insert opp;

FeedItem fd= new FeedItem(
Body = 'aaaaa#nextstep @rrr eeeeeeeeee #nextstep',
parentId = opp.id
);
insert fd;

FeedPost feedPo = new FeedPost(
FeedItemId = fd.Id
);
insert feedPo;

opportunityFeed effdPo = new opportunityFeed(
FeedPostId = feedPo.Id
);
insert effdPo;

List<opportunityFeed> oppFeedList = new List<opportunityFeed>();


}
}