You need to sign in to do that
Don't have an account?
dlatte
Help creating a test class to test UserManagement.obfuscateUser(uid)
I would like direction on approaches to write Test Classes for UserManagement.obfuscateUser(uid) please.
My design includes a List of Portal User Ids to Obfuscate and System.enqueueJob to delete the related Contact Records.
Would it be accurate to build my test data for Portal User and related Contact in the Test Method and then issue the UserManagement.obfuscateUser(uid) method to obfuscate the Portal User and then Delete the related Contact?
Or
Would it be more accurate to use Mock Test Data instead?
Also my ideas for assertEquals would be to see if the Contact was deleted. My knowledge of obfuscated Portal User is once they are obfuscated there is no way to access them, so I'm not certain what I would test with assertEquals for UserManagement.obfuscateUser(uid) method.
I am developing with Test Driven Development process.
Thank you,
Donna
My design includes a List of Portal User Ids to Obfuscate and System.enqueueJob to delete the related Contact Records.
Would it be accurate to build my test data for Portal User and related Contact in the Test Method and then issue the UserManagement.obfuscateUser(uid) method to obfuscate the Portal User and then Delete the related Contact?
Or
Would it be more accurate to use Mock Test Data instead?
Also my ideas for assertEquals would be to see if the Contact was deleted. My knowledge of obfuscated Portal User is once they are obfuscated there is no way to access them, so I'm not certain what I would test with assertEquals for UserManagement.obfuscateUser(uid) method.
I am developing with Test Driven Development process.
Thank you,
Donna
Raj Vakati
Try like below