global class HelloWorld implements SandboxPostCopy { global void runApexClass(SandboxContext context) { System.debug('Hello Tester Pester ' + context.organizationId() + ' ' + context.sandboxId() + context.sandboxName()); } }
This is an example implementation of the System.SandboxPostCopy interface.
global class HelloWorld implements SandboxPostCopy { global void runApexClass(SandboxContext context) { System.debug('Hello Tester Pester ' + context.organizationId() + ' ' + context.sandboxId() + context.sandboxName()); } }
The following example tests the implementation:
@isTest class testHelloWorld{ @isTest static void testSandboxPostCopyScript() { HelloWorld apexclass = new HelloWorld(); Test.testSandboxPostCopyScript(apexClassName, 'orgID', 'sandboxID', 'sandboxName'); System.assertEquals(1,1,'Test something');