This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IsTest | |
private class CustomMetadataInApex_Test { | |
@IsTest | |
private static void workLikeCustomObject() { | |
insert new ProductSetting__mdt(RelatedSObjectType__c = 'Account', DeveloperName = 'EnableFeature'); | |
System.assertEquals(1, [SELECT COUNT() FROM ProductSetting__mdt]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IsTest | |
private class DomainBuilder_Test { | |
@IsTest | |
private static void easyTestDataCreation() { | |
// Setup | |
Contact_t jack = new Contact_t().first('Ron').last('Harris'); | |
new Account_t() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class Opportunities extends fflib_SObjectDomain { | |
public Opportunities(List<Opportunity> records) { | |
super(records); | |
} | |
public override void onAfterInsert() { | |
new ApplyDefaultCurrency(recors).execute(); | |
new CalculateRevenueForecast(records) | |
.andThen(new PublishLeadScore().forNew(records)).execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class Accounts extends fflib_SObjectDomain { | |
public Accounts(List<Account> records) { | |
super(records); | |
} | |
public override void onAfterUpdate(Map<Id,SObject> old) { | |
new UnitOfWork(records) | |
.execute(new CheckTeamPermissions()) | |
.execute(new EnhanceData()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WorkBatch implements Database.Batchable<Work>, Database.Stateful { | |
private StateInfo state = new StateInfo(); | |
// PUBLIC | |
public List<Work> start(Database.BatchableContext context) { | |
return new List<Work>{ new AccountWork(), new ContactWork(), new OpportunityWork() }; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Default ruleset used by the CodeClimate Engine for Salesforce.com Apex" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> | |
<description>Default ruleset</description> | |
<rule name="CustomFieldNamingConvention" language="xml" message="Incorrectly named field" class="net.sourceforge.pmd.lang.rule.XPathRule"> | |
<properties> | |
<property name="version" value="2.0"/> | |
<property name="xpath"> | |
<value><![CDATA[ | |
//CustomField[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IsTest | |
public class HttpMock implements HttpCalloutMock { | |
private static final String ANY_URL = null; | |
private Map<String, Map<String, Object>> responses = new Map<String, Map<String, Object>>(); | |
// PUBLIC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rawGraph":{ | |
"nodes":[ | |
{ | |
"id":"Napoleon", | |
"degree":1, | |
"pagerank":0.005542802377608484, | |
"node_id":"Napoleon" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Default ruleset used by the CodeClimate Engine for Salesforce.com Apex" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> | |
<description>Default ruleset for PMD/Codacy</description> | |
<!-- CUSTOM RULES --> | |
<rule name="AvoidProductionDebugLogs" language="apex" class="net.sourceforge.pmd.lang.apex.rule.ApexXPathRule" | |
message="Avoid leaving System.debug() statments in code as they negativly influence performance."> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"engine":"sfge", | |
"fileName":"/Users/rsoesemann/dev/projects/lma-app-cockpit/force-app/main/default/classes/SetupArchiveErrors.cls", | |
"violations":[ | |
{ | |
"ruleName":"ApexFlsViolationRule", | |
"severity":1, | |
"message":"FLS validation is missing for [READ] operation on [ArchivedAppError__b] with field(s) [dtm_ArchivedDate__c]", | |
"category":"Security", |
OlderNewer