function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Testing Batch apex code with two batches

i am trying to test a trigger my trigger code is 


trigger PostFeedsToTimeLine on FeedItem (after insert) {
Map<String,String> contentMap = new Map<String,String>{'Object' =>'FeedItem','Content' =>'Body'};
if( > 5){
BatchPublishTimeLine publishBatch = new BatchPublishTimeLine(,contentMap);
else GMirrorUtil.createTimeLine(, contentMap);


batch will always get created if size is greater than 5 but when size is greater than 5 two batch will get executed  what to batch i am calling GMirrorUtil.createTimeLine which is making two callouts thats why this 5 limit .what to do in this case ?? because maximum 5 batch can be queued thats why if possible i try to make it without batch but in cases when more than 5 then i execute it using Batch.