You need to sign in to do that
Don't have an account?
HTANIRS
test class for global registration handler
Hi Friends,
Need help to write test class for below class:
global class AutocreatedRegHandler1432826053915 implements Auth.RegistrationHandler{
global User createUser(Id portalId, Auth.UserData data){
User u = [SELECT ID FROM User Where Other_Salesforce_Org_Username__c = : data.username];
return u;
}
global void updateUser(Id userId, Id portalId, Auth.UserData data){
System.debug('Update User called for: ' + data.email);
User u = new User(id=userId);
u.email = data.email;
u.lastName = data.lastName;
u.firstName = data.firstName;
update(u);
}
}
Thanks.
Need help to write test class for below class:
global class AutocreatedRegHandler1432826053915 implements Auth.RegistrationHandler{
global User createUser(Id portalId, Auth.UserData data){
User u = [SELECT ID FROM User Where Other_Salesforce_Org_Username__c = : data.username];
return u;
}
global void updateUser(Id userId, Id portalId, Auth.UserData data){
System.debug('Update User called for: ' + data.email);
User u = new User(id=userId);
u.email = data.email;
u.lastName = data.lastName;
u.firstName = data.firstName;
update(u);
}
}
Thanks.
All Answers
Thanks for your reply. I am getting below error.
Class.AutocreatedRegHandler1432826053915.createUser: line 4, column 1
Class.AutocreatedRegHandler1432826053915Test.testCreateAndUpdateUser: line 8, column 1
Thanks.
Thanks for your reply. This is working. Could you please help in solving the below error I got when testing the code.
REGISTRATION_HANDLER_ERROR: Attempt to de-reference a null object.
Thanks.