You need to sign in to do that
Don't have an account?
indranily81
test class in version 24 can not access AccountShare.
Hi,
Recently I was trying to query AccountShare record through test class for one of my projects. The data is prepared in test class itself but the query could not fetch any record when fired from the particular user context. I am always getting 0 rows within the System.runAs context.
Once I downgraded both the test class and target class to v23 it worked.
Are the sharing tables for the standard objects not exposed in v24, if queried from specific user context ?
Thanks
Indranil
Have you tried quering Account Object?
If you try, you will probably notice that there is nothing to query (0 results, unless you insert something in the testMethod ).
This is one of the changes performed in Spring 12. If you want to access all data created outside your test method context, you will need to use seeAllData parameter for @IsTest notation.
See the example below.
For more information
Regards,
Thanks SeAlVa for the quick response.
Yes Account is accessible from the test method. The problem is with the sharing table associated with Account. I have already stated that all the test data is created within the test method hence I don't see a reason for seeAllData. We setup our test data in such a way that it should never match with any real data. More over our customer have very strict policies regarding data visibility so we can not even use that annotation in production as in that case all data will be exposed. We don'i want that to happen.
Hope my question is making sense.
Regards,
Indranil