+ 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(Trigger.new.size() > 5){
BatchPublishTimeLine publishBatch = new BatchPublishTimeLine(Trigger.new,contentMap);
else GMirrorUtil.createTimeLine(Trigger.new, 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 do.in 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.