I hereby claim:
- I am alan-morey on github.
- I am alanmorey (https://keybase.io/alanmorey) on keybase.
- I have a public key ASC_PfYGuMi76Hro7GXR8FQJowknG2Za0s0RWmEZaELM3wo
To claim this, I am signing this object:
Salesforce package.xml | |
xmlstarlet sel -t -m _:Package/_:types -s A:T:U _:name -n -v _:name -n -m _:members -s A:T:U . -v "concat(' - ', .)" -n package.xml | |
xmlstarlet sel -t -m _:Package/_:types -s A:T:U _:name -m _:members -s A:T:U . -v "concat(../_:name, '::', .)" -n package.xml |
I hereby claim:
To claim this, I am signing this object:
class SetupAuditTrails { | |
public Map<String, Set<String>> getModifiedClassesSince(Id sinceTrailId) { | |
return getModifiedClassesSince(sinceDate(sinceTrailId)); | |
} | |
public Map<String, Set<String>> getModifiedClassesSince(DateTime sinceDate) { | |
Map<String, Set<String>> changes = new Map<String, Set<String>>(); | |
for (SetupAuditTrail t : [ | |
SELECT display |
public abstract class AnonApp implements MainMethod { | |
final String[] OUT = new String[0]; | |
public static void run(Type clazz) { | |
AnonApp app = (AnonApp) clazz.newInstance(); | |
app.run(); | |
} | |
public void run() { | |
try { |
public class Uuid { | |
static final String GROUP_SEP = '-'; | |
Uuid() {} | |
public static String randomUuid() { | |
String hex = EncodingUtil.convertToHex(Crypto.generateAesKey(128)); | |
return String.join(new String[] { | |
hex.substring(0,8), |
// Unexpected results for System.hashCode() when using same values for Salesforce IDs with different reference types. | |
// | |
// https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_system.htm?CSHID=apex_methods_system_system.htm#apex_system_system_hashcode | |
// | |
// API v33 | |
@isTest | |
class SystemHashCodeBugTest { | |
static final String STR_VAL = 'foobar'; | |
static final Id USER_ID_VAL = UserInfo.getUserId(); | |
static final Id LITERAL_ID_VAL = '001000000000001'; |
// Apex seems to have a bug when trying to represent the minimum value for both | |
// Long and Integer primitive types as a literal value. | |
// | |
//Long MIN_LONG = -9223372036854775808L; // Compile Error: Invalid Long: 9223372036854775808L | |
//Integer MIN_INT = -2147483648; // Compile Error: Invalid Integer: 2147483648 | |
// Workaround: Overflow the MAX values | |
Long LONG_MAX_VALUE = 9223372036854775807L; | |
Long LONG_MIN_VALUE = LONG_MAX_VALUE + 1; // Overflow => -9223372036854775808L | |
public class PairNumbers { | |
Integer x,y; | |
public PairNumbers(Integer a, Integer b) { | |
x=a; | |
y=b; | |
} | |
public Boolean equals(Object obj) { | |
if (obj != null && obj instanceof PairNumbers) { |
/** | |
* Salesforce does not allow the ability to write to certain SObject fields | |
* such as LastModifiedDate, CreatedDate etc. Even if those objects are | |
* not going to be inserted into the DB. This makes testing around these | |
* fields difficult as we always need to hit the database to load these values | |
* and it's not possible to inject the values you require. | |
* | |
* This method gets around that limitation by using JSON. We first create | |
* a representation of the data as a map of fields/values pairs. Then we | |
* transform the map into a JSON representation. This respresentation includes |
@isTest | |
public class TestSpy { | |
public static final String UNKNOWN = '<unknown>'; | |
public static final String VOID_RETURN_TYPE = '<void>'; | |
String methodName; | |
List<Object[]> callArgs; | |
Exception throwResult; | |
Boolean isVoidReturn = true; |