Skip to content

Commit

Permalink
Global Settings: Fixed bug in rflib_LogbalSettings.overridePublishing…
Browse files Browse the repository at this point in the history
…LimitOrDefault introduced with the recent refactoring to remove all CMT records.
  • Loading branch information
j-fischer committed Jan 17, 2024
1 parent adb5fb6 commit 2ec1d6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rflib/main/default/classes/rflib_GlobalSettings.cls
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public with sharing class rflib_GlobalSettings {
throw new rflib_InvalidArgumentException('newLimit', 'value provided (' + newLimit + ') is less than 0 or higher than allowed limit: ' + Limits.getPublishImmediateDML());
}

String newLimitStr = newLimit != null ? String.valueOf(newLimit) : rflib_Global_Setting__mdt.getInstance('Publish_Platform_Event_Transaction_Limit').Value__c;
String newLimitStr = newLimit != null ? String.valueOf(newLimit) : rflib_Global_Setting__mdt.getInstance('Publish_Platform_Event_Transaction_Limit')?.Value__c;
SETTINGS.put('Publish_Platform_Event_Transaction_Limit', newLimitStr);
}
}
2 changes: 1 addition & 1 deletion rflib/test/default/classes/rflib_GlobalSettingsTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private class rflib_GlobalSettingsTest {

@IsTest
static void testPublishingLimitOrDefault() {
Integer expectedValue = getConfiguredIntegerValueOrDefault('Publish_Platform_Event_Transaction_Limit', rflib_GlobalSettings.ARCHIVE_LOG_QUERY_LIMIT_DEFAULT_VALUE);
Integer expectedValue = getConfiguredIntegerValueOrDefault('Publish_Platform_Event_Transaction_Limit', rflib_GlobalSettings.PUBLISH_PLATFORM_EVENT_TRANSACTION_LIMIT_DEFAULT_VALUE);

Test.startTest();
System.assertEquals(expectedValue, rflib_GlobalSettings.publishingLimitOrDefault);
Expand Down

0 comments on commit 2ec1d6f

Please sign in to comment.