2

I have generated a VF page for end users to change their password. Within the method, I used the outbound web service call to verify whether their old password entered are correct. The code is copied from this page: http://developer.force.com/cookbook/recipe/verifying-password.

But I just can't think of a way to test this... If I create a new user and runas that user, it will pop up all the user info into UserInfo class, but I don't think outbound webservice call to test.salesforce.com will have that user info. Any suggestions?

2

You will need to create a HttpCalloutMock that mocks the response from Salesforce Partner API.

See Testing HTTP Callouts by Implementing the HttpCalloutMock Interface

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.