Skip to content

Instantly share code, notes, and snippets.

View bdovhan's full-sized avatar

Bohdan Dovhań bdovhan

View GitHub Profile
@bdovhan
bdovhan / TRB.apxc
Created August 6, 2019 10:37
Apex Test Class TRB reproducing the CalloutException bug
@isTest
public class TRB {
public class Mock implements HttpCalloutMock {
protected Integer code = 200;
protected String status = 'OK';
protected String body = '{"response":{"result":"success"}}';
/**
* @description Returns an HTTP response for the given request.
@bdovhan
bdovhan / b.apxc
Created August 6, 2019 10:35
Dummy Batchable Apex Class B
public class b implements Database.Batchable<SObject>,Database.AllowsCallouts{
public Database.QueryLocator start(Database.BatchableContext bc) {
return Database.getQueryLocator('SELECT id FROM user WHERE IsActive=true limit 1');
}
public void execute(Database.BatchableContext bc, List<User> users) {
new Http().send(new HttpRequest());
}
public void finish(Database.BatchableContext bc) {}
}