function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Francisco Riccomagno 1Francisco Riccomagno 1 

Create instance of SandboxContext in test class

Hello, I'm implementing a robust class that implements the interface SandboxPostCopy. In there I have several private methods that are then individualy tested from the test class.
Now I have the need of creating another private method that should receive as a parameter the SandboxContext instance that the runApexClass receives, but I'm not able to create a test method for that particular private method as I'm not able to create an instance of SandboxContext that I need to send as a parameter.
I can see in different post how to instantiate my implementation of the SandboxPostCopy and send parameters that then are translated to the SandboxContext, but this will excecute all of the more than 20 private methods that I have. I don't want that, I need to unit test the private method that I have created.
Any idea on how this can be implemented? 
Thanks in advance.
Anshul Kumar 26Anshul Kumar 26
Please refer this link if it helps:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_install_handler.htm?search_text=SandboxContext#apex_install_handler