You need to sign in to do that
Don't have an account?
BoolsEye
UserInfo.getUserId() available in a testMethod ?
Is it possible to call the UserInfo.getUserId() in a testMethod and do I always get a valid User Id when uploading my package ?
Are the tests run under a generic user Id and this method will return NULL instead of a valid user id ?
Anyone used this before ? I add events for this user id in my test methods and wonder if this will work in all cases.
Thanks.
eliotstock2
When running your unit tests in the IDE, the user is yourself, ie. the user you're logged in to salesforce.com as in your project properties. UserInfo.getUserId() works in a test method and will give you your own user ID.