+ Start a Discussion

Test functions in managed package and using "with sharing"

We added the "with sharing" keyword to all classes and controllers in our managed package.


The test functions work fine in the master dev org, but when I install a beta version into another dev org,

I now get many test errors of type:


"System.NullPointerException: Attempt to de-reference a null object


The installation worked before we used "with sharing".



Is there some guidance available how to simulate the scenario during the installation process in our master dev org.


There are no line numbers given, only function names. I have no idea what could cause these errors or how to fix them.



Forget this message, I made a mistake.