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?

1 Answer 1


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

See Testing HTTP Callouts by Implementing the HttpCalloutMock Interface

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .