Skip to content

Commit

Permalink
Fixing build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinhughpalmer committed Jan 19, 2022
1 parent 67a3adf commit 30183fe
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 17 deletions.
1 change: 1 addition & 0 deletions force-app/main/utilities/schema/classes/SchemaFacade.cls
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public without sharing class SchemaFacade {
* @description retrieves the field describe for the object and field name provided,
* it will traverse the SObjectField's so you don't have to
*/
@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
public DescribeFieldResult getFieldDescribe(String objectApiName, String fieldApiName) {
objectApiName = objectApiName.toLowerCase();
fieldApiName = fieldApiName.toLowerCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
*
**/
public with sharing class StateCountryCodeMapper extends Triggerable {
@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
private final PicklistValueSet stateValueSet = new PicklistValueSet(
Account.BillingStateCode.getDescribe()
);
@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
private final PicklistValueSet countryValueSet = new PicklistValueSet(
Account.BillingCountryCode.getDescribe()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public virtual class QueryBuilder {
protected final SchemaFacade schema = SchemaFacade.getInstance();
protected final DescribeSObjectResult objectDescribe;

@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
protected QueryBuilder(String objectName) {
validateObjectName(objectName);
this.objectName = objectName;
Expand Down
9 changes: 0 additions & 9 deletions force-app/tests/test-factories/classes/TestFactory.cls

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public with sharing class IdGeneratorMock {
String prefix;

try {
prefix = sObjectType.getDescribe().getKeyPrefix();
prefix = sObjectType.getDescribe(SObjectDescribeOptions.DEFERRED).getKeyPrefix();
} catch (Exception exceptionToHandle) {
throw new IdGeneratorMockException('Cannot resolve prefix for SObject,' + sObjectType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private class SObjectRecordTypesTest {
private static void getRecordTypeIdTest() {
SObjectRecordTypes opportunityRecordTypes = new SObjectRecordTypes('Opportunity');
final String recordTypeName = (new List<String>(
Account.SObjectType.getDescribe().getRecordTypeInfosByDeveloperName().keySet()
Account.SObjectType.getDescribe(SObjectDescribeOptions.DEFERRED).getRecordTypeInfosByDeveloperName().keySet()
))[0];
System.assertNotEquals(
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private class SObjectWrapperTest {
}

@isTest
@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
private static void describeTestObjectField() {
Account testAccount = new Account();
SObjectWrapper wrappedTestAccount = new SObjectWrapper(testAccount);
Expand All @@ -84,6 +85,7 @@ private class SObjectWrapperTest {
}

@isTest
@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
private static void describeTestRelatedObjectField() {
Contact testContact = new Contact();
SObjectWrapper wrappedTestContact = new SObjectWrapper(testContact);
Expand All @@ -95,6 +97,7 @@ private class SObjectWrapperTest {
}

@isTest
@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
private static void describeRelatedObjectFieldRecursive() {
Contact testContact = new Contact();
SObjectWrapper wrappedTestContact = new SObjectWrapper(testContact);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ private class SchemaFacadeTest {
@IsTest
private static void getDescribe() {
System.assertEquals(
Account.SObjectType.getDescribe(),
Account.SObjectType.getDescribe(SObjectDescribeOptions.DEFERRED),
SchemaFacade.getInstance().getDescribe('Account'),
'The dynamic describe call should return the account describe object'
);
}

@IsTest
@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
private static void getFieldDescribe() {
System.assertEquals(
Account.Name.getDescribe(),
Expand All @@ -56,6 +57,7 @@ private class SchemaFacadeTest {
}

@IsTest
@SuppressWarnings('PMD.EagerlyLoadedDescribeSObjectResult')
private static void getDescribeException() {
final String invalidObjectName = 'Invalid Object';
try {
Expand Down

0 comments on commit 30183fe

Please sign in to comment.