Skip to content

Instantly share code, notes, and snippets.

View ankushsomani09's full-sized avatar

Ankush Somani ankushsomani09

  • Bangalore
View GitHub Profile
@brianmfear
brianmfear / GetExtraLimitsForYourUnitTest.apxc
Last active January 11, 2024 05:09
Need more CPU or heap for creating your test data? Make it Queueable.
// Asking for extra CPU time and heap for those really "heavy" orgs
@isTest class GetExtraLimitsForYourUnitTest implements Queueable {
@testSetup static void testSetup() {
Test.startTest(); // TIP: this avoids governor limits for your @isTest methods
System.enqueueJob(new GetExtraLimitsForYourUnitTest()); // We'll get async limits!
// P.S. Did you know that the end of a unit test method triggers async code,
// just as if you called Test.stopTest()?
}
public void execute(QueueableContext context) {
// I now have 60000ms to do my setup, instead of just 10000ms.
@sjurgis
sjurgis / testBetaRelease.sh
Last active December 8, 2021 15:15
salesforce second generation package create, install and test using github actions
#!/bin/bash
set -e
set -o pipefail
CLIENT_ID=$1
rm -f ./server.key
cat > ./server.key
sfdx auth:jwt:grant --setdefaultusername --clientid "$CLIENT_ID" --jwtkeyfile ./server.key --username ci@devhub.mypackage.com -a HubOrg
mv .forceignore .forceignore.orig
@noeticpenguin
noeticpenguin / RestClient.java
Created October 21, 2013 13:05
A basic Rest Client for Salesforce's Apex
Public with sharing virtual class RestClient {
Public class RestClientException extends Exception {}
/*
* class variable creation - DO NOT EDIT
*/
Public Map<String,String> headers;
Public String url;
Public String method;