I have a batch class that needs a test class. In creating the test records, the insertion of a necessary object record triggers a Chatter Post via another trigger. That chatter post references a CollaborationGroup and uses the ConnectApi feature so I have to use (SeeAllData=True).
The problem is that by using the (SeeAllData=True) declaration, I get the error message
No more than one executeBatch can be called from within a testmethod
If I use the (SeeAllData=True) declaration, my test fails. If I don't use the (SeeAllData)=True declaration, my test fails. If I use the (!test.isRunningTest) method to skip this, my code coverage falls below 75%.
I'm in a predicament and need to figure out a way to test my batch class that also triggers a series of Chatter Posts at the same time.
Any suggestions would be greatly appreciated!