+ Start a Discussion
MellycooksMellycooks 

Chatter Group not visible in Test Method, but Duplicate Record Error when attempting Insert

I'm having an issue with test methods for some new chatter functionality.

In my test method, if I query for a Public Chatter Group based on the group name, I get 'no rows for assignment' soql error.  If I attempt to insert a Group with that name within the test method, I get a 'DUPLICATE_VALUE, An active or archived group with this name already exists' error.

I'm not sure how to proceed with testing, if the group is not visible within test methods and I can't create it.
ShashankShashank (Salesforce Developers) 
Please check if you have seeAllData='true' for the test class.
Omkar Kumar 16Omkar Kumar 16
Facing the same issue. If seeAllData = 'false' for Test class, which is recommended.