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
Brian Bell 41Brian Bell 41 

Testing ConnectApi Code

Hi, I am trying to write test classes for code that accepts a Connect.Community object as an arguement and then uses that community to determine behavior (for example, looking up specific records).  The methods used to get communites on the ConnectApi requires SeeAllData=true, however, I want to be able to write my tests so that they can run in a data silo.

Is there a way I can abstract my call to get communities outside of the test context so that I don't have to run tests with SeeAllData enabled?
rohit rahulrohit rahul
I am new to testing classes, would love to learn if somebody with proper knowledge answers it,
Thansk & Regards,
Rohit - Manager @ Cyberflix Official (