Skip to content

Instantly share code, notes, and snippets.

@surajp
Created January 19, 2021 19:12
Show Gist options
  • Save surajp/9f55c453f0a21894875e032ebf61d22e to your computer and use it in GitHub Desktop.
Save surajp/9f55c453f0a21894875e032ebf61d22e to your computer and use it in GitHub Desktop.
Check if you're running with seeAllData = true
@isTest
public static void it_should_say_seeall_is_false() {
Boolean seeAllData = true;
try {
ConnectApi.UserProfiles.getUserProfile(null, UserInfo.getUserId());
} catch (UnsupportedOperationException ex) {
seeAllData = false;
}
System.assert(!seeAllData, 'See All data returned true');
}
@isTest(seeAllData=true)
public static void it_should_say_seeall_is_true() {
Boolean seeAllData = true;
try {
ConnectApi.UserProfiles.getUserProfile(null, UserInfo.getUserId());
} catch (UnsupportedOperationException ex) {
seeAllData = false;
}
System.assert(seeAllData, 'See All data returned false');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment