From 7c6f49c4a7ebed0e24f15725ef2e47d7294ece49 Mon Sep 17 00:00:00 2001 From: Jonathan Gillespie Date: Tue, 10 May 2022 17:11:27 -0400 Subject: [PATCH] Bugfix: logging no longer fails when parent transaction ID is not found (#307) * Fixed #300 by adding new field Log__c.ParentLogTransactionId__c and updated trigger handler logic to optionally set Log__c.ParentLog__c when the parent log is found/skips it when the parent log is not found * Adding new plugin to add additional logging options for async failures (#309) for BatchApexErrorEvent and default Finalizer implementation for logging failures * Updated the description of perm set LoggerLogCreator to indicate that it's currently optional, but might be needed in the future * Optimized LogEntryEventHandler.TAG_ASSIGNMENT_RULES by adding lazy-loading (discussed in #303) and added a check on `LogEntryTagRule__mdt.getAll().isEmpty() == true` to minimize the usage of querying on LogEntryTagRule__mdt * Cleaned up some methods in Logger_Tests, added TODOs for several test methods that will eventually be rewritten, alphabetized some fields in LogEntryEventBuilder * Fixed #308 by adding the Schema namespace to a reference of FieldSetMember (now Schema.FieldSetMember) * Further fixed issues like #308 by adding empty classes with problematic names (FieldSet, FieldSetMember, SObjectField, SObjectType and Test for now) - this will cause deployment errors in the pipeline if there are any references that don't use the System/Schema namespaces * Removed overload for LoggerMockDataCreator.createAggregateResult(Map) since the current approach doesn't actually set any fields on AggregateResult Thanks to @jamessimone for pointing this out in my last PR. Long term, I'll change the approach used for AggregateResult * Removed some stale @SuppressWarnings annotations in a couple of Apex classes, promoted a few buried strings to be constants, and a cleaned up a few other small code bits * Fixed some broken images in some plugin README.md * Added CODEOWNERS file * Changed build.yml so that the managed package build is a dependency for creating the unlocked package This will add more time to the build, but it will ensure that the managed package (the more problematic package) can be created before creating the unlocked package * Fixed some dependabot alerts by adding some packages in package.json's dependencies & recreating package-lock.json Co-authored-by: James Simone <16430727+jamessimone@users.noreply.github.com> --- .github/CODEOWNERS | 1 + .github/workflows/build.yml | 56 +- README.md | 6 +- config/linters/lint-staged.config.js | 3 +- .../Test-Utilities/LoggerMockDataCreator.md | 24 +- ...ger SObject Handler Layout.layout-meta.xml | 4 + .../SObjectTypeOverride__c.field-meta.xml | 15 + .../fields/SObjectType__c.field-meta.xml | 2 +- .../log-management/classes/LogBatchPurger.cls | 4 +- .../classes/LogEntryEventHandler.cls | 144 +- .../classes/LogEntryFieldSetPicklist.cls | 4 +- .../classes/LogEntryHandler.cls | 2 +- .../classes/LogEntryTagHandler.cls | 2 +- .../log-management/classes/LogHandler.cls | 27 +- .../classes/LoggerEmailSender.cls | 2 - .../classes/LoggerTagHandler.cls | 2 +- .../classes/RelatedLogEntriesController.cls | 13 +- .../LogRecordPage.flexipage-meta.xml | 4 +- .../layouts/Log__c-Log Layout.layout-meta.xml | 2 +- .../LogCompactLayout.compactLayout-meta.xml | 1 - .../fields/ParentLogLink__c.field-meta.xml | 17 + .../ParentLogTransactionId__c.field-meta.xml | 13 + .../LoggerAdmin.permissionset-meta.xml | 10 + .../LoggerEndUser.permissionset-meta.xml | 10 + .../LoggerLogCreator.permissionset-meta.xml | 3 +- .../LoggerLogViewer.permissionset-meta.xml | 10 + .../classes/LogEntryEventBuilder.cls | 8 +- .../main/logger-engine/classes/Logger.cls | 11 +- .../logger-engine/classes/LoggerDataStore.cls | 5 +- .../classes/LoggerSObjectHandler.cls | 23 +- .../utilities/LoggerMockDataCreator.cls | 23 +- .../classes/LogBatchPurger_Tests.cls | 24 +- .../classes/LogEntryEventHandler_Tests.cls | 20 +- .../LogEntryFieldSetPicklist_Tests.cls | 12 +- .../classes/LogEntryHandler_Tests.cls | 2 +- .../classes/LogHandler_Tests.cls | 26 + .../classes/LogMassDeleteExtension_Tests.cls | 4 +- .../classes/LoggerSObjectMetadata_Tests.cls | 2 +- .../RelatedLogEntriesController_Tests.cls | 8 +- .../classes/ComponentLogger_Tests.cls | 2 +- .../classes/FlowCollectionLogEntry_Tests.cls | 2 +- .../classes/FlowLogEntry_Tests.cls | 4 +- .../classes/FlowLogger_Tests.cls | 2 +- .../classes/FlowRecordLogEntry_Tests.cls | 2 +- .../classes/LogEntryEventBuilder_Tests.cls | 36 +- .../classes/LoggerSObjectHandler_Tests.cls | 24 +- .../logger-engine/classes/Logger_Tests.cls | 1159 ++++++++--------- .../classes/ExampleInboundEmailHandler.cls | 10 +- .../extra-tests/classes/FieldSet.cls | 10 + .../extra-tests/classes/FieldSet.cls-meta.xml | 5 + .../extra-tests/classes/FieldSetMember.cls | 10 + .../classes/FieldSetMember.cls-meta.xml | 5 + .../extra-tests/classes/SObjectField.cls | 10 + .../classes/SObjectField.cls-meta.xml | 5 + .../extra-tests/classes/SObjectType.cls | 10 + .../classes/SObjectType.cls-meta.xml | 5 + nebula-logger/extra-tests/classes/Test.cls | 10 + .../extra-tests/classes/Test.cls-meta.xml | 5 + .../LogBatchPurger_Tests_Integration.cls | 4 +- ...gMassDeleteExtension_Tests_Integration.cls | 2 +- .../tests/LoggerSObjectHandler_Tests_Flow.cls | 2 +- .../tests/Logger_Tests_ExperienceSite.cls | 4 +- .../Logger_Tests_InboundEmailHandler.cls | 10 +- .../tests/Logger_Tests_MergeResult.cls | 112 +- .../classes/LoggerInstallHandler_Tests.cls | 12 +- ...all-unlocked-package-plugin-production.png | Bin 0 -> 40456 bytes ...nstall-unlocked-package-plugin-sandbox.png | Bin 39945 -> 39944 bytes .../btn-install-unlocked-package-plugin.png | Bin 29432 -> 0 bytes ...to-batch-logging-with-logger-parameter.png | Bin 0 -> 26889 bytes .../plugins/async-failure-additions/README.md | 53 + .../classes/LogBatchApexErrorEventHandler.cls | 67 + ...LogBatchApexErrorEventHandler.cls-meta.xml | 5 + .../LogBatchApexErrorEventHandler_Tests.cls | 100 ++ ...chApexErrorEventHandler_Tests.cls-meta.xml | 5 + .../plugin/classes/LogFinalizer.cls | 33 + .../plugin/classes/LogFinalizer.cls-meta.xml | 5 + .../plugin/classes/LogFinalizer_Tests.cls | 55 + .../classes/LogFinalizer_Tests.cls-meta.xml | 5 + .../LogBatchApexErrorEventTrigger.trigger | 7 + ...atchApexErrorEventTrigger.trigger-meta.xml | 5 + .../plugins/big-object-archiving/README.md | 10 +- .../plugin/classes/LogEntryArchiveBuilder.cls | 2 +- .../plugin/classes/LogEntryArchivePlugin.cls | 2 +- .../classes/LogEntryArchivePlugin_Tests.cls | 16 +- .../LoggerPlugin.LogEntryArchive.md-meta.xml | 2 +- ...ogEntryArchiveAdmin.permissionset-meta.xml | 2 +- .../plugins/log-retention-rules/README.md | 7 +- .../classes/LogRetentionRulesPlugin_Tests.cls | 4 +- .../plugins/logger-admin-dashboard/README.md | 5 +- nebula-logger/plugins/slack/README.md | 7 +- .../slack/classes/SlackLoggerPlugin.cls | 1 - .../slack/classes/SlackLoggerPlugin_Tests.cls | 24 +- package-lock.json | 77 +- package.json | 16 +- sfdx-project.json | 24 +- 95 files changed, 1511 insertions(+), 1039 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 nebula-logger/core/main/configuration/objects/LoggerSObjectHandler__mdt/fields/SObjectTypeOverride__c.field-meta.xml create mode 100644 nebula-logger/core/main/log-management/objects/Log__c/fields/ParentLogLink__c.field-meta.xml create mode 100644 nebula-logger/core/main/log-management/objects/Log__c/fields/ParentLogTransactionId__c.field-meta.xml create mode 100644 nebula-logger/extra-tests/classes/FieldSet.cls create mode 100644 nebula-logger/extra-tests/classes/FieldSet.cls-meta.xml create mode 100644 nebula-logger/extra-tests/classes/FieldSetMember.cls create mode 100644 nebula-logger/extra-tests/classes/FieldSetMember.cls-meta.xml create mode 100644 nebula-logger/extra-tests/classes/SObjectField.cls create mode 100644 nebula-logger/extra-tests/classes/SObjectField.cls-meta.xml create mode 100644 nebula-logger/extra-tests/classes/SObjectType.cls create mode 100644 nebula-logger/extra-tests/classes/SObjectType.cls-meta.xml create mode 100644 nebula-logger/extra-tests/classes/Test.cls create mode 100644 nebula-logger/extra-tests/classes/Test.cls-meta.xml create mode 100644 nebula-logger/plugins/.images/btn-install-unlocked-package-plugin-production.png delete mode 100644 nebula-logger/plugins/.images/btn-install-unlocked-package-plugin.png create mode 100644 nebula-logger/plugins/async-failure-additions/.images/opt-into-batch-logging-with-logger-parameter.png create mode 100644 nebula-logger/plugins/async-failure-additions/README.md create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler.cls create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler.cls-meta.xml create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler_Tests.cls create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler_Tests.cls-meta.xml create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer.cls create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer.cls-meta.xml create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer_Tests.cls create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer_Tests.cls-meta.xml create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/triggers/LogBatchApexErrorEventTrigger.trigger create mode 100644 nebula-logger/plugins/async-failure-additions/plugin/triggers/LogBatchApexErrorEventTrigger.trigger-meta.xml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..a9b2e5058 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @jongpie \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0e8d514f..8ed152ae6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -235,8 +235,8 @@ jobs: run: npm run org:delete:noprompt if: ${{ always() }} - create-unlocked-package-release-candidate: - name: 'Create Core Package Release Candidate' + create-managed-package-beta: + name: 'Create Managed Package Beta' needs: [lwc-tests, base-scratch-org-tests, experience-cloud-scratch-org-tests] if: ${{ github.ref != 'refs/heads/main' }} runs-on: ubuntu-latest @@ -272,31 +272,12 @@ jobs: DEV_HUB_CONSUMER_KEY: ${{ secrets.DEV_HUB_CONSUMER_KEY }} DEV_HUB_JWT_SERVER_KEY: ${{ secrets.DEV_HUB_JWT_SERVER_KEY }} - - name: 'Authorize Demo Org' - shell: bash - run: | - echo ${{ env.PKG_DEMO_ORG_SFDX_URL }} > ./PKG_DEMO_ORG_SFDX_URL.txt - npx sfdx auth:sfdxurl:store --sfdxurlfile ./PKG_DEMO_ORG_SFDX_URL.txt --setalias nebula-logger-package-demo - env: - PKG_DEMO_ORG_SFDX_URL: ${{ secrets.NEBULA_PKG_DEMO_SANDBOX_SFDX_URL }} - - - name: 'Create & Install Package Version' - run: npx pwsh ./scripts/build/create-and-install-package-version.ps1 -targetpackagealias '"Nebula Logger - Core"' -targetreadme ./README.md -targetusername nebula-logger-package-demo - - - name: 'Commit New Package Version' - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action Bot" - npm run sfdx:plugins:link:bummer - npx sfdx bummer:package:aliases:sort - npx prettier --write ./sfdx-project.json - git add ./sfdx-project.json - git commit -m "Created new package version" - git push + - name: 'Create Beta Managed Package Version' + run: npm run package:version:create:managed - create-managed-package-beta: - name: 'Create Managed Package Beta' - needs: [lwc-tests, base-scratch-org-tests, experience-cloud-scratch-org-tests] + create-unlocked-package-release-candidate: + name: 'Create Core Package Release Candidate' + needs: [create-managed-package-beta] if: ${{ github.ref != 'refs/heads/main' }} runs-on: ubuntu-latest environment: 'Demo Org' @@ -331,8 +312,27 @@ jobs: DEV_HUB_CONSUMER_KEY: ${{ secrets.DEV_HUB_CONSUMER_KEY }} DEV_HUB_JWT_SERVER_KEY: ${{ secrets.DEV_HUB_JWT_SERVER_KEY }} - - name: 'Create Beta Managed Package Version' - run: npm run package:version:create:managed + - name: 'Authorize Demo Org' + shell: bash + run: | + echo ${{ env.PKG_DEMO_ORG_SFDX_URL }} > ./PKG_DEMO_ORG_SFDX_URL.txt + npx sfdx auth:sfdxurl:store --sfdxurlfile ./PKG_DEMO_ORG_SFDX_URL.txt --setalias nebula-logger-package-demo + env: + PKG_DEMO_ORG_SFDX_URL: ${{ secrets.NEBULA_PKG_DEMO_SANDBOX_SFDX_URL }} + + - name: 'Create & Install Package Version' + run: npx pwsh ./scripts/build/create-and-install-package-version.ps1 -targetpackagealias '"Nebula Logger - Core"' -targetreadme ./README.md -targetusername nebula-logger-package-demo + + - name: 'Commit New Package Version' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action Bot" + npm run sfdx:plugins:link:bummer + npx sfdx bummer:package:aliases:sort + npx prettier --write ./sfdx-project.json + git add ./sfdx-project.json + git commit -m "Created new package version" + git push promote-package-versions: name: 'Promote Package Versions' diff --git a/README.md b/README.md index 8fa307f18..d5d37e128 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ Designed for Salesforce admins, developers & architects. A robust logger for Apex, Lightning Components, Flow, Process Builder & Integrations. -## Unlocked Package - v4.7.1 +## Unlocked Package - v4.7.2 -[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgBQAQ) -[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgBQAQ) +[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lhdQAA) +[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lhdQAA) [![View Documentation](./images/btn-view-documentation.png)](https://jongpie.github.io/NebulaLogger/) ## Managed Package - v4.7.0 diff --git a/config/linters/lint-staged.config.js b/config/linters/lint-staged.config.js index 6951981ea..c3f818655 100644 --- a/config/linters/lint-staged.config.js +++ b/config/linters/lint-staged.config.js @@ -7,6 +7,7 @@ module.exports = { return [`eslint --config ./config/linters/.eslintrc.json ${filenames.join(' ')} --fix`, `npm run test:lwc`]; }, '*.{cls,trigger}': () => { - return [`npm run lint:verify:apex`, `npm run docs:fix && git add ./docs/ && git commit --amend --no-edit`]; + return [`npm run lint:verify:apex`]; + // return [`npm run lint:verify:apex`, `npm run docs:fix && git add ./docs/ && git commit --amend --no-edit`]; } }; diff --git a/docs/apex/Test-Utilities/LoggerMockDataCreator.md b/docs/apex/Test-Utilities/LoggerMockDataCreator.md index 3c1ede437..292d962a2 100644 --- a/docs/apex/Test-Utilities/LoggerMockDataCreator.md +++ b/docs/apex/Test-Utilities/LoggerMockDataCreator.md @@ -18,27 +18,7 @@ Utility class used to help with generating mock data when writing Apex tests for #### `createAggregateResult()` → `AggregateResult` -Instances of `AggregateResult` can not be created directly in Apex. This method uses a workaround to generate a mock. - -##### Return - -**Type** - -AggregateResult - -**Description** - -The mock instance of `AggregateResult` - -#### `createAggregateResult(Map mockAggregateKeyValues)` → `AggregateResult` - -Instances of `AggregateResult` can not be created directly in Apex. This method uses a workaround to generate a mock, using the provided map of aliases & aggregate values - -##### Parameters - -| Param | Description | -| ------------------------ | --------------------------------------------------------------------------------------- | -| `mockAggregateKeyValues` | A map of aliases & aggregate values to use when creating the mock `AggregateResult` | +Instances of `AggregateResult` can not be created directly in Apex. This method uses a workaround to generate a mock, although it will not have any fields or aggregate values populated on the object. ##### Return @@ -611,7 +591,7 @@ A new copy of the original `SObject` record that has the specified read-only fie #### LoggerMockDataCreator.SObjectTestDataBuilder class -Class used to create or update an `SObject` record with static fake data. This is useful in situations where you need to have fields populated, but the specific values used are not relevant to a particular test. This class can be used when Apex writing tests for plugins. +Class used to create or update an `SObject` record with static fake data. This is useful in situations where you need to have fields populated, but the specific values used are not relevant to a particular test method. This class can be used when Apex writing tests for plugins. --- diff --git a/nebula-logger/core/main/configuration/layouts/LoggerSObjectHandler__mdt-Logger SObject Handler Layout.layout-meta.xml b/nebula-logger/core/main/configuration/layouts/LoggerSObjectHandler__mdt-Logger SObject Handler Layout.layout-meta.xml index 055e5a5c6..d274e2a70 100644 --- a/nebula-logger/core/main/configuration/layouts/LoggerSObjectHandler__mdt-Logger SObject Handler Layout.layout-meta.xml +++ b/nebula-logger/core/main/configuration/layouts/LoggerSObjectHandler__mdt-Logger SObject Handler Layout.layout-meta.xml @@ -18,6 +18,10 @@ Required SObjectHandlerApexClass__c + + Edit + SObjectTypeOverride__c + diff --git a/nebula-logger/core/main/configuration/objects/LoggerSObjectHandler__mdt/fields/SObjectTypeOverride__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerSObjectHandler__mdt/fields/SObjectTypeOverride__c.field-meta.xml new file mode 100644 index 000000000..fc048f435 --- /dev/null +++ b/nebula-logger/core/main/configuration/objects/LoggerSObjectHandler__mdt/fields/SObjectTypeOverride__c.field-meta.xml @@ -0,0 +1,15 @@ + + + SObjectTypeOverride__c + Not all base platform types can be selected using the SObjectType picklist. If your object is not supported, supply the API name for the object here instead. + false + SubscriberControlled + Not all base platform types can be selected using the SObjectType picklist. If your object is not supported, supply the API name for the object here instead. + + 255 + false + Text + false + diff --git a/nebula-logger/core/main/configuration/objects/LoggerSObjectHandler__mdt/fields/SObjectType__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerSObjectHandler__mdt/fields/SObjectType__c.field-meta.xml index 2bcd98bfb..80c5bd339 100644 --- a/nebula-logger/core/main/configuration/objects/LoggerSObjectHandler__mdt/fields/SObjectType__c.field-meta.xml +++ b/nebula-logger/core/main/configuration/objects/LoggerSObjectHandler__mdt/fields/SObjectType__c.field-meta.xml @@ -7,7 +7,7 @@ EntityDefinition Logger SObject Handler Configurations LoggerSObjectHandlerConfigurations - true + false MetadataRelationship true diff --git a/nebula-logger/core/main/log-management/classes/LogBatchPurger.cls b/nebula-logger/core/main/log-management/classes/LogBatchPurger.cls index 747f39549..f843b8e8d 100644 --- a/nebula-logger/core/main/log-management/classes/LogBatchPurger.cls +++ b/nebula-logger/core/main/log-management/classes/LogBatchPurger.cls @@ -25,7 +25,7 @@ global with sharing class LogBatchPurger implements Database.Batchable, @TestVisible private Integer chainedBatchSize = 200; @TestVisible - private SObjectType currentSObjectType; + private Schema.SObjectType currentSObjectType; private List pluginConfigurations; private Map> methodToExecutedApexPlugins = new Map>(); private Map> methodToExecutedFlowPlugins = new Map>(); @@ -244,7 +244,6 @@ global with sharing class LogBatchPurger implements Database.Batchable, } } - @SuppressWarnings('PMD.AvoidDebugStatements') private void executeApexPlugin(BatchableMethod method, LoggerPlugin__mdt pluginConfiguration, LoggerBatchableContext input, List scopeRecords) { if (String.isBlank(pluginConfiguration.BatchPurgerApexClass__c) == true) { return; @@ -274,7 +273,6 @@ global with sharing class LogBatchPurger implements Database.Batchable, } } - @SuppressWarnings('PMD.AvoidDebugStatements') private void executeFlowPlugin(BatchableMethod method, LoggerPlugin__mdt pluginConfiguration, LoggerBatchableContext input, List scopeRecords) { if (String.isBlank(pluginConfiguration.BatchPurgerFlowName__c) == true) { return; diff --git a/nebula-logger/core/main/log-management/classes/LogEntryEventHandler.cls b/nebula-logger/core/main/log-management/classes/LogEntryEventHandler.cls index b4054d678..bc8e2bb46 100644 --- a/nebula-logger/core/main/log-management/classes/LogEntryEventHandler.cls +++ b/nebula-logger/core/main/log-management/classes/LogEntryEventHandler.cls @@ -7,18 +7,29 @@ * @group Log Management * @description Processes `LogEntryEvent__e` platform events and normalizes the data into `Log__c` and `LogEntry__c` records */ -@SuppressWarnings('PMD.ApexCrudViolation, PMD.AvoidDebugStatements, PMD.CognitiveComplexity, PMD.CyclomaticComplexity') +@SuppressWarnings( + 'PMD.ApexCrudViolation, PMD.CognitiveComplexity, PMD.CyclomaticComplexity, PMD.FieldDeclarationsShouldBeAtStart, PMD.PropertyNamingConventions' +) public without sharing class LogEntryEventHandler extends LoggerSObjectHandler { @TestVisible private static final String DEFAULT_STORAGE_LOCATION_NAME = 'CUSTOM_OBJECTS'; private static final Database.DmlOptions DML_OPTIONS = createDmlOptions(); + private static final String GUEST_USER_LICENSE_NAME = 'Guest User License'; private static final Map TRANSACTION_ID_TO_LOG = new Map(); + @TestVisible - private static final List TAG_ASSIGNMENT_RULES = getTagAssignmentRules(); + private static List TAG_ASSIGNMENT_RULES { + get { + if (TAG_ASSIGNMENT_RULES == null) { + TAG_ASSIGNMENT_RULES = getTagAssignmentRules(); + } + return TAG_ASSIGNMENT_RULES; + } + set; + } @TestVisible private List logEntryEvents; - private List logEntries = new List(); private Map> logEntryEventUuidToTagNames = new Map>(); private Set tagNames = new Set(); @@ -34,7 +45,7 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler { * @description Returns SObject Type that the handler is responsible for processing * @return The instance of `SObjectType` */ - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return Schema.LogEntryEvent__e.SObjectType; } @@ -73,70 +84,63 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler { continue; } - Log__c parentLog = new Log__c(TransactionId__c = logEntryEvent.ParentLogTransactionId__c); - Log__c log = new Log__c(); - - // Guest users cannot own records, so keep the log owner as the current user (Automated Process) - String guestUserLicenseName = 'Guest User License'; - Id logOwnerId; - if (logEntryEvent.UserLicenseName__c == guestUserLicenseName || String.isBlank(logEntryEvent.CreatedById)) { + Id logOwnerId = logEntryEvent.CreatedById; + if (logEntryEvent.UserLicenseName__c == GUEST_USER_LICENSE_NAME || String.isBlank(logEntryEvent.CreatedById)) { + // Guest users cannot own records, so keep the log owner as the current user (Automated Process) logOwnerId = UserInfo.getUserId(); - } else { - logOwnerId = logEntryEvent.CreatedById; } - if (recentLogWithApiReleaseDetails != null) { - log.ApiReleaseNumber__c = recentLogWithApiReleaseDetails.ApiReleaseNumber__c; - log.ApiReleaseVersion__c = recentLogWithApiReleaseDetails.ApiReleaseVersion__c; - } - - log.ApiVersion__c = logEntryEvent.ApiVersion__c; - log.Locale__c = logEntryEvent.Locale__c; - log.LoggedBy__c = logEntryEvent.LoggedById__c; - log.LoggedByUsername__c = logEntryEvent.LoggedByUsername__c; - log.LoggerVersionNumber__c = logEntryEvent.LoggerVersionNumber__c; - log.LoginApplication__c = logEntryEvent.LoginApplication__c; - log.LoginBrowser__c = logEntryEvent.LoginBrowser__c; - log.LoginDomain__c = logEntryEvent.LoginDomain__c; - log.LoginHistoryId__c = logEntryEvent.LoginHistoryId__c; - log.LoginPlatform__c = logEntryEvent.LoginPlatform__c; - log.LoginType__c = logEntryEvent.LoginType__c; - log.LogoutUrl__c = logEntryEvent.LogoutUrl__c; - log.NetworkId__c = logEntryEvent.NetworkId__c; - log.NetworkLoginUrl__c = logEntryEvent.NetworkLoginUrl__c; - log.NetworkLogoutUrl__c = logEntryEvent.NetworkLogoutUrl__c; - log.NetworkName__c = logEntryEvent.NetworkName__c; - log.NetworkSelfRegistrationUrl__c = logEntryEvent.NetworkSelfRegistrationUrl__c; - log.NetworkUrlPathPrefix__c = logEntryEvent.NetworkUrlPathPrefix__c; - log.OrganizationDomainUrl__c = logEntryEvent.OrganizationDomainUrl__c; - log.OrganizationEnvironmentType__c = logEntryEvent.OrganizationEnvironmentType__c; - log.OrganizationId__c = logEntryEvent.OrganizationId__c; - log.OrganizationInstanceName__c = logEntryEvent.OrganizationInstanceName__c; - log.OrganizationName__c = logEntryEvent.OrganizationName__c; - log.OrganizationNamespacePrefix__c = logEntryEvent.OrganizationNamespacePrefix__c; - log.OrganizationType__c = logEntryEvent.OrganizationType__c; - log.OwnerId = logOwnerId; - log.ParentLog__r = logEntryEvent.ParentLogTransactionId__c == null ? null : parentLog; - log.ProfileId__c = logEntryEvent.ProfileId__c; - log.ProfileName__c = logEntryEvent.ProfileName__c; - log.Scenario__c = logEntryEvent.Scenario__c; - log.SessionId__c = logEntryEvent.SessionId__c; - log.SessionSecurityLevel__c = logEntryEvent.SessionSecurityLevel__c; - log.SessionType__c = logEntryEvent.SessionType__c; - log.SourceIp__c = logEntryEvent.SourceIp__c; - log.SystemMode__c = logEntryEvent.SystemMode__c; - log.ThemeDisplayed__c = logEntryEvent.ThemeDisplayed__c; - log.TimeZoneId__c = logEntryEvent.TimeZoneId__c; - log.TimeZoneName__c = logEntryEvent.TimeZoneName__c; - log.TransactionId__c = logEntryEvent.TransactionId__c; - log.UserLicenseDefinitionKey__c = logEntryEvent.UserLicenseDefinitionKey__c; - log.UserLicenseId__c = logEntryEvent.UserLicenseId__c; - log.UserLicenseName__c = logEntryEvent.UserLicenseName__c; - log.UserLoggingLevel__c = logEntryEvent.UserLoggingLevel__c; - log.UserLoggingLevelOrdinal__c = logEntryEvent.UserLoggingLevelOrdinal__c; - log.UserRoleId__c = logEntryEvent.UserRoleId__c; - log.UserRoleName__c = logEntryEvent.UserRoleName__c; - log.UserType__c = logEntryEvent.UserType__c; + Log__c log = new Log__c( + ApiReleaseNumber__c = recentLogWithApiReleaseDetails?.ApiReleaseNumber__c, + ApiReleaseVersion__c = recentLogWithApiReleaseDetails?.ApiReleaseVersion__c, + ApiVersion__c = logEntryEvent.ApiVersion__c, + Locale__c = logEntryEvent.Locale__c, + LoggedBy__c = logEntryEvent.LoggedById__c, + LoggedByUsername__c = logEntryEvent.LoggedByUsername__c, + LoggerVersionNumber__c = logEntryEvent.LoggerVersionNumber__c, + LoginApplication__c = logEntryEvent.LoginApplication__c, + LoginBrowser__c = logEntryEvent.LoginBrowser__c, + LoginDomain__c = logEntryEvent.LoginDomain__c, + LoginHistoryId__c = logEntryEvent.LoginHistoryId__c, + LoginPlatform__c = logEntryEvent.LoginPlatform__c, + LoginType__c = logEntryEvent.LoginType__c, + LogoutUrl__c = logEntryEvent.LogoutUrl__c, + NetworkId__c = logEntryEvent.NetworkId__c, + NetworkLoginUrl__c = logEntryEvent.NetworkLoginUrl__c, + NetworkLogoutUrl__c = logEntryEvent.NetworkLogoutUrl__c, + NetworkName__c = logEntryEvent.NetworkName__c, + NetworkSelfRegistrationUrl__c = logEntryEvent.NetworkSelfRegistrationUrl__c, + NetworkUrlPathPrefix__c = logEntryEvent.NetworkUrlPathPrefix__c, + OrganizationDomainUrl__c = logEntryEvent.OrganizationDomainUrl__c, + OrganizationEnvironmentType__c = logEntryEvent.OrganizationEnvironmentType__c, + OrganizationId__c = logEntryEvent.OrganizationId__c, + OrganizationInstanceName__c = logEntryEvent.OrganizationInstanceName__c, + OrganizationName__c = logEntryEvent.OrganizationName__c, + OrganizationNamespacePrefix__c = logEntryEvent.OrganizationNamespacePrefix__c, + OrganizationType__c = logEntryEvent.OrganizationType__c, + OwnerId = logOwnerId, + ParentLogTransactionId__c = logEntryEvent.ParentLogTransactionId__c, + ProfileId__c = logEntryEvent.ProfileId__c, + ProfileName__c = logEntryEvent.ProfileName__c, + Scenario__c = logEntryEvent.Scenario__c, + SessionId__c = logEntryEvent.SessionId__c, + SessionSecurityLevel__c = logEntryEvent.SessionSecurityLevel__c, + SessionType__c = logEntryEvent.SessionType__c, + SourceIp__c = logEntryEvent.SourceIp__c, + SystemMode__c = logEntryEvent.SystemMode__c, + ThemeDisplayed__c = logEntryEvent.ThemeDisplayed__c, + TimeZoneId__c = logEntryEvent.TimeZoneId__c, + TimeZoneName__c = logEntryEvent.TimeZoneName__c, + TransactionId__c = logEntryEvent.TransactionId__c, + UserLicenseDefinitionKey__c = logEntryEvent.UserLicenseDefinitionKey__c, + UserLicenseId__c = logEntryEvent.UserLicenseId__c, + UserLicenseName__c = logEntryEvent.UserLicenseName__c, + UserLoggingLevel__c = logEntryEvent.UserLoggingLevel__c, + UserLoggingLevelOrdinal__c = logEntryEvent.UserLoggingLevelOrdinal__c, + UserRoleId__c = logEntryEvent.UserRoleId__c, + UserRoleName__c = logEntryEvent.UserRoleName__c, + UserType__c = logEntryEvent.UserType__c + ); TRANSACTION_ID_TO_LOG.put(log.TransactionId__c, log); } @@ -368,6 +372,10 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler { } private static List getTagAssignmentRules() { + if (LogEntryTagRule__mdt.getAll().isEmpty() == true) { + return new List(); + } + List tagAssignmentRules = [ SELECT Id, SObjectField__r.QualifiedApiName, ComparisonType__c, ComparisonValue__c, Tags__c FROM LogEntryTagRule__mdt @@ -420,11 +428,7 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler { LIMIT 1 ]; - if (logs.isEmpty()) { - return null; - } else { - return logs.get(0); - } + return logs.isEmpty() == true ? null : logs.get(0); } private static Integer getCountOfOpenJobs() { diff --git a/nebula-logger/core/main/log-management/classes/LogEntryFieldSetPicklist.cls b/nebula-logger/core/main/log-management/classes/LogEntryFieldSetPicklist.cls index d470d2f10..96dc9ecc1 100644 --- a/nebula-logger/core/main/log-management/classes/LogEntryFieldSetPicklist.cls +++ b/nebula-logger/core/main/log-management/classes/LogEntryFieldSetPicklist.cls @@ -24,8 +24,8 @@ public without sharing class LogEntryFieldSetPicklist extends VisualEditor.Dynam public override VisualEditor.DynamicPickListRows getValues() { VisualEditor.DynamicPickListRows picklistRows = new VisualEditor.DynamicPickListRows(); - List
fieldSets = Schema.SObjectType.LogEntry__c.fieldSets.getMap().values(); - for (FieldSet fieldSet : fieldSets) { + List fieldSets = Schema.SObjectType.LogEntry__c.fieldSets.getMap().values(); + for (Schema.FieldSet fieldSet : fieldSets) { String namespacePrefix = String.isBlank(fieldSet.getNameSpace()) ? '' : fieldSet.getNameSpace() + '__'; VisualEditor.DataRow picklistRow = new VisualEditor.DataRow(fieldSet.getLabel(), namespacePrefix + fieldSet.getName()); diff --git a/nebula-logger/core/main/log-management/classes/LogEntryHandler.cls b/nebula-logger/core/main/log-management/classes/LogEntryHandler.cls index d31a8897b..f9a4ed0dc 100644 --- a/nebula-logger/core/main/log-management/classes/LogEntryHandler.cls +++ b/nebula-logger/core/main/log-management/classes/LogEntryHandler.cls @@ -18,7 +18,7 @@ public without sharing class LogEntryHandler extends LoggerSObjectHandler { * @description Returns SObject Type that the handler is responsible for processing * @return The instance of `SObjectType` */ - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return Schema.LogEntry__c.SObjectType; } diff --git a/nebula-logger/core/main/log-management/classes/LogEntryTagHandler.cls b/nebula-logger/core/main/log-management/classes/LogEntryTagHandler.cls index 014b67f9c..40ee83902 100644 --- a/nebula-logger/core/main/log-management/classes/LogEntryTagHandler.cls +++ b/nebula-logger/core/main/log-management/classes/LogEntryTagHandler.cls @@ -17,7 +17,7 @@ public without sharing class LogEntryTagHandler extends LoggerSObjectHandler { * @description Returns SObject Type that the handler is responsible for processing * @return The instance of `SObjectType` */ - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return Schema.LogEntryTag__c.SObjectType; } diff --git a/nebula-logger/core/main/log-management/classes/LogHandler.cls b/nebula-logger/core/main/log-management/classes/LogHandler.cls index bd7b7ab2e..d7df35ac0 100644 --- a/nebula-logger/core/main/log-management/classes/LogHandler.cls +++ b/nebula-logger/core/main/log-management/classes/LogHandler.cls @@ -21,7 +21,7 @@ public without sharing class LogHandler extends LoggerSObjectHandler { * @description Returns SObject Type that the handler is responsible for processing * @return The instance of `SObjectType` */ - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return Schema.Log__c.SObjectType; } @@ -31,6 +31,7 @@ public without sharing class LogHandler extends LoggerSObjectHandler { this.setClosedStatusFields(); // The log OwnerId field should support being manually changed, so only auto-set it on insert this.setOwnerId(); + this.setParentLog(); // The log retention date field should support being manually changed, so only auto-set it on insert this.setLogRetentionDetails(); } @@ -105,6 +106,30 @@ public without sharing class LogHandler extends LoggerSObjectHandler { } } + private void setParentLog() { + Set parentLogTransactionIds = new Set(); + for (Log__c log : this.logs) { + if (String.isNotBlank(log.ParentLogTransactionId__c) == true) { + parentLogTransactionIds.add(log.ParentLogTransactionId__c); + } + } + + if (parentLogTransactionIds.isEmpty() == true) { + return; + } + + Map parentLogTransactionIdToRecordId = new Map(); + for (Log__c parentLog : [SELECT Id, TransactionId__c FROM Log__c WHERE TransactionId__c IN :parentLogTransactionIds]) { + parentLogTransactionIdToRecordId.put(parentLog.TransactionId__c, parentLog.Id); + } + + for (Log__c log : this.logs) { + if (String.isNotBlank(log.ParentLogTransactionId__c) == true) { + log.ParentLog__c = parentLogTransactionIdToRecordId.get(log.ParentLogTransactionId__c); + } + } + } + private void setLogRetentionDetails() { Map scenarioToScenarioRule = queryScenarioRules(this.logs); for (Log__c log : this.logs) { diff --git a/nebula-logger/core/main/log-management/classes/LoggerEmailSender.cls b/nebula-logger/core/main/log-management/classes/LoggerEmailSender.cls index 916e11692..cde783a2e 100644 --- a/nebula-logger/core/main/log-management/classes/LoggerEmailSender.cls +++ b/nebula-logger/core/main/log-management/classes/LoggerEmailSender.cls @@ -74,7 +74,6 @@ public without sharing class LoggerEmailSender { sendErrorEmail(sobjectType, errorMessages); } - @SuppressWarnings('PMD.AvoidDebugStatements') private static void sendErrorEmail(Schema.SObjectType sobjectType, List errorMessages) { if (errorMessages.isEmpty() == true) { return; @@ -118,7 +117,6 @@ public without sharing class LoggerEmailSender { return errorMessages; } - @SuppressWarnings('PMD.AvoidDebugStatements') private static void sendEmail(Messaging.SingleEmailMessage message) { if (IS_EMAIL_DELIVERABILITY_ENABLED == true) { List messages = new List{ message }; diff --git a/nebula-logger/core/main/log-management/classes/LoggerTagHandler.cls b/nebula-logger/core/main/log-management/classes/LoggerTagHandler.cls index 72316d4ef..80fd8df90 100644 --- a/nebula-logger/core/main/log-management/classes/LoggerTagHandler.cls +++ b/nebula-logger/core/main/log-management/classes/LoggerTagHandler.cls @@ -17,7 +17,7 @@ public without sharing class LoggerTagHandler extends LoggerSObjectHandler { * @description Returns SObject Type that the handler is responsible for processing * @return The instance of `SObjectType` */ - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return Schema.LoggerTag__c.SObjectType; } diff --git a/nebula-logger/core/main/log-management/classes/RelatedLogEntriesController.cls b/nebula-logger/core/main/log-management/classes/RelatedLogEntriesController.cls index e48f92a66..f964d3347 100644 --- a/nebula-logger/core/main/log-management/classes/RelatedLogEntriesController.cls +++ b/nebula-logger/core/main/log-management/classes/RelatedLogEntriesController.cls @@ -9,8 +9,8 @@ */ @SuppressWarnings('PMD.ExcessivePublicCount') public with sharing class RelatedLogEntriesController { - private static final SObjectType LOG_SOBJECT_TYPE = Schema.Log__c.SObjectType; - private static final SObjectType LOG_ENTRY_SOBJECT_TYPE = Schema.LogEntry__c.SObjectType; + private static final Schema.SObjectType LOG_SOBJECT_TYPE = Schema.Log__c.SObjectType; + private static final Schema.SObjectType LOG_ENTRY_SOBJECT_TYPE = Schema.LogEntry__c.SObjectType; private static final String DEFAULT_SORT_FIELD_NAME = String.valueOf(Schema.LogEntry__c.Timestamp__c); private static final String DEFAULT_SORT_DIRECTION = 'DESC'; @@ -107,7 +107,6 @@ public with sharing class RelatedLogEntriesController { return String.join(fieldNames, ','); } - @SuppressWarnings('PMD.AvoidDebugStatements') private static String getOrderByClause(String sortByFieldName, String sortDirection) { sortByFieldName = String.isNotBlank(sortByFieldName) ? sortByFieldName : DEFAULT_SORT_FIELD_NAME; sortDirection = String.isNotBlank(sortDirection) ? sortDirection : DEFAULT_SORT_DIRECTION; @@ -123,7 +122,7 @@ public with sharing class RelatedLogEntriesController { private static String getDisplayFieldApiName(Schema.DescribeFieldResult lookupFieldDescribe) { String relationshipName = lookupFieldDescribe.getRelationshipName(); - SObjectType lookupSObjectType = lookupFieldDescribe.getReferenceTo().get(0); + Schema.SObjectType lookupSObjectType = lookupFieldDescribe.getReferenceTo().get(0); // Use username instead of name for user if (lookupSObjectType == Schema.User.SObjectType) { @@ -277,11 +276,11 @@ public with sharing class RelatedLogEntriesController { @AuraEnabled public String name { get; set; } - private FieldSetMetadata(SObjectType sobjectType, String fieldSetName) { + private FieldSetMetadata(Schema.SObjectType sobjectType, String fieldSetName) { this.fields = new List(); Schema.FieldSet fieldSet = sobjectType.getDescribe().fieldSets.getMap().get(fieldSetName); - for (FieldSetMember fieldSetMember : fieldSet.getFields()) { + for (Schema.FieldSetMember fieldSetMember : fieldSet.getFields()) { // Enforce field-level security (FLS) if (fieldSetMember.getSObjectField().getDescribe().isAccessible()) { this.fields.add(new FieldMetadata(fieldSetMember)); @@ -341,7 +340,7 @@ public with sharing class RelatedLogEntriesController { @AuraEnabled public String type { get; set; } - private FieldMetadata(FieldSetMember fieldSetMember) { + private FieldMetadata(Schema.FieldSetMember fieldSetMember) { Schema.DescribeFieldResult fieldDescribe = fieldSetMember.getSObjectField().getDescribe(); this.fieldName = fieldSetMember.getFieldPath(); diff --git a/nebula-logger/core/main/log-management/flexipages/LogRecordPage.flexipage-meta.xml b/nebula-logger/core/main/log-management/flexipages/LogRecordPage.flexipage-meta.xml index f5c97a038..a6cc540a7 100644 --- a/nebula-logger/core/main/log-management/flexipages/LogRecordPage.flexipage-meta.xml +++ b/nebula-logger/core/main/log-management/flexipages/LogRecordPage.flexipage-meta.xml @@ -178,8 +178,8 @@ uiBehavior readonly - Record.ParentLog__c - RecordParentLog__cField + Record.ParentLogLink__c + RecordParentLogLink__cField Facet-af147cb3-e6b1-4ef7-a00b-d4746d5a1c90 diff --git a/nebula-logger/core/main/log-management/layouts/Log__c-Log Layout.layout-meta.xml b/nebula-logger/core/main/log-management/layouts/Log__c-Log Layout.layout-meta.xml index 47c5814bb..17435940c 100644 --- a/nebula-logger/core/main/log-management/layouts/Log__c-Log Layout.layout-meta.xml +++ b/nebula-logger/core/main/log-management/layouts/Log__c-Log Layout.layout-meta.xml @@ -43,7 +43,7 @@ Readonly - ParentLog__c + ParentLogLink__c diff --git a/nebula-logger/core/main/log-management/objects/Log__c/compactLayouts/LogCompactLayout.compactLayout-meta.xml b/nebula-logger/core/main/log-management/objects/Log__c/compactLayouts/LogCompactLayout.compactLayout-meta.xml index 467c07ac8..249b7fd62 100644 --- a/nebula-logger/core/main/log-management/objects/Log__c/compactLayouts/LogCompactLayout.compactLayout-meta.xml +++ b/nebula-logger/core/main/log-management/objects/Log__c/compactLayouts/LogCompactLayout.compactLayout-meta.xml @@ -8,6 +8,5 @@ Priority__c Status__c LogEntriesSummary__c - ParentLog__c diff --git a/nebula-logger/core/main/log-management/objects/Log__c/fields/ParentLogLink__c.field-meta.xml b/nebula-logger/core/main/log-management/objects/Log__c/fields/ParentLogLink__c.field-meta.xml new file mode 100644 index 000000000..d4b9075b6 --- /dev/null +++ b/nebula-logger/core/main/log-management/objects/Log__c/fields/ParentLogLink__c.field-meta.xml @@ -0,0 +1,17 @@ + + + ParentLogLink__c + false + IF( + NOT(ISBLANK(ParentLog__c)), + HYPERLINK(ParentLog__c, ParentLog__r.Name + ' - ' + ParentLogTransactionId__c), + ParentLogTransactionId__c +) + BlankAsZero + + false + false + false + Text + false + diff --git a/nebula-logger/core/main/log-management/objects/Log__c/fields/ParentLogTransactionId__c.field-meta.xml b/nebula-logger/core/main/log-management/objects/Log__c/fields/ParentLogTransactionId__c.field-meta.xml new file mode 100644 index 000000000..d6fbace6e --- /dev/null +++ b/nebula-logger/core/main/log-management/objects/Log__c/fields/ParentLogTransactionId__c.field-meta.xml @@ -0,0 +1,13 @@ + + + ParentLogTransactionId__c + false + + 36 + false + false + false + false + Text + false + diff --git a/nebula-logger/core/main/log-management/permissionsets/LoggerAdmin.permissionset-meta.xml b/nebula-logger/core/main/log-management/permissionsets/LoggerAdmin.permissionset-meta.xml index 6cf000c60..a5c9e54ba 100644 --- a/nebula-logger/core/main/log-management/permissionsets/LoggerAdmin.permissionset-meta.xml +++ b/nebula-logger/core/main/log-management/permissionsets/LoggerAdmin.permissionset-meta.xml @@ -929,6 +929,16 @@ Log__c.ParentLog__c true + + false + Log__c.ParentLogLink__c + true + + + false + Log__c.ParentLogTransactionId__c + true + true Log__c.Priority__c diff --git a/nebula-logger/core/main/log-management/permissionsets/LoggerEndUser.permissionset-meta.xml b/nebula-logger/core/main/log-management/permissionsets/LoggerEndUser.permissionset-meta.xml index 6ba95179a..70c2ad468 100644 --- a/nebula-logger/core/main/log-management/permissionsets/LoggerEndUser.permissionset-meta.xml +++ b/nebula-logger/core/main/log-management/permissionsets/LoggerEndUser.permissionset-meta.xml @@ -729,6 +729,16 @@ Log__c.ParentLog__c true + + false + Log__c.ParentLogLink__c + true + + + false + Log__c.ParentLogTransactionId__c + true + false Log__c.ProfileId__c diff --git a/nebula-logger/core/main/log-management/permissionsets/LoggerLogCreator.permissionset-meta.xml b/nebula-logger/core/main/log-management/permissionsets/LoggerLogCreator.permissionset-meta.xml index 796fa6f9c..8e68d4123 100644 --- a/nebula-logger/core/main/log-management/permissionsets/LoggerLogCreator.permissionset-meta.xml +++ b/nebula-logger/core/main/log-management/permissionsets/LoggerLogCreator.permissionset-meta.xml @@ -28,7 +28,8 @@ Logger true - Provides access to generate log entries via Apex, Lightning Components, Flow and Process Builder + Provides access to generate log entries via Apex, Lightning Components, Flow and Process Builder. This is currently optional, but required if/when Salesforce activates the release update called "Require User Access to Apex Classes Invoked by Flow". false diff --git a/nebula-logger/core/main/log-management/permissionsets/LoggerLogViewer.permissionset-meta.xml b/nebula-logger/core/main/log-management/permissionsets/LoggerLogViewer.permissionset-meta.xml index 02a039642..010277ccd 100644 --- a/nebula-logger/core/main/log-management/permissionsets/LoggerLogViewer.permissionset-meta.xml +++ b/nebula-logger/core/main/log-management/permissionsets/LoggerLogViewer.permissionset-meta.xml @@ -857,6 +857,16 @@ Log__c.ParentLog__c true + + false + Log__c.ParentLogLink__c + true + + + false + Log__c.ParentLogTransactionId__c + true + false Log__c.Priority__c diff --git a/nebula-logger/core/main/logger-engine/classes/LogEntryEventBuilder.cls b/nebula-logger/core/main/logger-engine/classes/LogEntryEventBuilder.cls index efeb9b18e..f29f9ed4b 100644 --- a/nebula-logger/core/main/logger-engine/classes/LogEntryEventBuilder.cls +++ b/nebula-logger/core/main/logger-engine/classes/LogEntryEventBuilder.cls @@ -577,7 +577,7 @@ global with sharing class LogEntryEventBuilder { * @param stackTraceString The Apex stack trace string to parse * @return The same instance of `LogEntryEventBuilder`, useful for chaining methods */ - @SuppressWarnings('PMD.NcssMethodCount, PMD.StdCyclomaticComplexity, PMD.CyclomaticComplexity, PMD.CognitiveComplexity') + @SuppressWarnings('PMD.NcssMethodCount') global LogEntryEventBuilder parseStackTrace(String stackTraceString) { if (this.shouldSave == false) { return this; @@ -702,6 +702,8 @@ global with sharing class LogEntryEventBuilder { } if (Logger.getUserSettings().IsApexSystemDebugLoggingEnabled__c == true) { + // 1 of 2 places in the codebase (except tests) that should use System.debug() + // The rest of the codebase should use a method in Logger.cls System.debug(this.entryLoggingLevel, this.debugMessage); } } @@ -769,13 +771,13 @@ global with sharing class LogEntryEventBuilder { LoggingLevel userLoggingLevel = Logger.getUserLoggingLevel(); this.logEntryEvent.Locale__c = UserInfo.getLocale(); - this.logEntryEvent.NetworkId__c = Network.getNetworkId(); - this.logEntryEvent.LoginHistoryId__c = CACHED_AUTH_SESSION?.LoginHistoryId; this.logEntryEvent.LoginApplication__c = CACHED_AUTH_SESSION?.LoginHistory.Application; this.logEntryEvent.LoginBrowser__c = CACHED_AUTH_SESSION?.LoginHistory.Browser; + this.logEntryEvent.LoginHistoryId__c = CACHED_AUTH_SESSION?.LoginHistoryId; this.logEntryEvent.LoginPlatform__c = CACHED_AUTH_SESSION?.LoginHistory.Platform; this.logEntryEvent.LoginType__c = CACHED_AUTH_SESSION?.LoginType; this.logEntryEvent.LogoutUrl__c = CACHED_AUTH_SESSION?.LogoutUrl; + this.logEntryEvent.NetworkId__c = Network.getNetworkId(); this.logEntryEvent.ProfileId__c = UserInfo.getProfileId(); this.logEntryEvent.SessionId__c = CACHED_AUTH_SESSION?.Id; this.logEntryEvent.SessionSecurityLevel__c = CACHED_AUTH_SESSION?.SessionSecurityLevel; diff --git a/nebula-logger/core/main/logger-engine/classes/Logger.cls b/nebula-logger/core/main/logger-engine/classes/Logger.cls index c602a5566..cbc563847 100644 --- a/nebula-logger/core/main/logger-engine/classes/Logger.cls +++ b/nebula-logger/core/main/logger-engine/classes/Logger.cls @@ -9,13 +9,11 @@ * @see LogEntryEventBuilder * @see LogMessage */ -@SuppressWarnings( - 'PMD.ApexCrudViolation, PMD.AvoidDebugStatements, PMD.AvoidGlobalModifier, PMD.CyclomaticComplexity, PMD.CognitiveComplexity, PMD.ExcessiveClassLength' -) +@SuppressWarnings('PMD.AvoidDebugStatements, PMD.AvoidGlobalModifier, PMD.ExcessiveClassLength, PMD.CognitiveComplexity, PMD.CyclomaticComplexity') global with sharing class Logger { // There's no reliable way to get the version number dynamically in Apex @TestVisible - private static final String CURRENT_VERSION_NUMBER = 'v4.7.1'; + private static final String CURRENT_VERSION_NUMBER = 'v4.7.2'; private static final LoggingLevel DEFAULT_LOGGING_LEVEL = LoggingLevel.DEBUG; private static final List LOG_ENTRIES_BUFFER = new List(); private static final Map MOCK_SCENARIO_TO_SCENARIO_RULE = new Map(); @@ -53,6 +51,8 @@ global with sharing class Logger { } static { + // 1 of 2 places in the codebase (except tests) that should use System.debug() + // The rest of the codebase should use a method in Logger.cls System.debug(LoggingLevel.INFO, 'Logger - Version Number: ' + getVersionNumber()); System.debug(LoggingLevel.INFO, 'Logger - Transaction ID: ' + getTransactionId()); } @@ -2485,6 +2485,7 @@ global with sharing class Logger { * and `Log__c.Scenario__c`, and can be used to filter & group logs * @param scenario The name to use for the current transaction's scenario */ + @SuppressWarnings('PMD.ApexCrudViolation') global static void setScenario(String scenario) { transactionScenario = scenario; @@ -2546,7 +2547,7 @@ global with sharing class Logger { * All subsequent calls to saveLog() will use the transaction save method. * @param saveMethodName The String value of the save method to use for this specific save action. */ - @SuppressWarnings('PMD.NcssMethodCount') + @SuppressWarnings('PMD.CognitiveComplexity, PMD.CyclomaticComplexity, PMD.NcssMethodCount') public static void saveLog(String saveMethodName) { saveLogCallCount++; lastSaveMethodNameUsed = saveMethodName; diff --git a/nebula-logger/core/main/logger-engine/classes/LoggerDataStore.cls b/nebula-logger/core/main/logger-engine/classes/LoggerDataStore.cls index 623230546..28c12c4f4 100644 --- a/nebula-logger/core/main/logger-engine/classes/LoggerDataStore.cls +++ b/nebula-logger/core/main/logger-engine/classes/LoggerDataStore.cls @@ -8,7 +8,7 @@ * @description Class used to manage any data-related operations, including database DML statements, * publishing platform events via the event bus, and enqueueing queueable jobs */ -@SuppressWarnings('PMD.ApexCRUDViolation, PMD.CyclomaticComplexity, PMD.EmptyStatementBlock, PMD.ExcessivePublicCount, PMD.FieldDeclarationsShouldBeAtStart') +@SuppressWarnings('PMD.ExcessivePublicCount') public without sharing class LoggerDataStore { private static Database databaseInstance = new Database(); private static EventBus eventBusInstance = new EventBus(); @@ -59,6 +59,7 @@ public without sharing class LoggerDataStore { * @description Class used to centralize the handling of any DML operations */ public virtual class Database { + @SuppressWarnings('PMD.EmptyStatementBlock') protected Database() { } @@ -254,6 +255,7 @@ public without sharing class LoggerDataStore { * @description Class used to centralize the handling of any platform event publishing operations */ public virtual class EventBus { + @SuppressWarnings('PMD.EmptyStatementBlock') protected EventBus() { } @@ -280,6 +282,7 @@ public without sharing class LoggerDataStore { * @description Class used to centralize the handling of enqueueing any queueable jobs */ public virtual class JobQueue { + @SuppressWarnings('PMD.EmptyStatementBlock') protected JobQueue() { } diff --git a/nebula-logger/core/main/logger-engine/classes/LoggerSObjectHandler.cls b/nebula-logger/core/main/logger-engine/classes/LoggerSObjectHandler.cls index 878ac6d6e..640ca683e 100644 --- a/nebula-logger/core/main/logger-engine/classes/LoggerSObjectHandler.cls +++ b/nebula-logger/core/main/logger-engine/classes/LoggerSObjectHandler.cls @@ -10,6 +10,8 @@ @SuppressWarnings('PMD.ApexCRUDViolation, PMD.CyclomaticComplexity, PMD.EmptyStatementBlock, PMD.FieldDeclarationsShouldBeAtStart') public without sharing abstract class LoggerSObjectHandler { private static Boolean isEnabled = true; + private static final String FLOW_PLUGIN_CONFIGURATION_INPUT_NAME = 'pluginConfiguration'; + private static final String FLOW_PLUGIN_INPUT_NAME = 'pluginInput'; private static final Map> SOBJECT_TYPE_TO_EXECUTED_HANDLERS = new Map>(); private static final Map SOBJECT_TYPE_TO_HANDLER_CONFIGURATIONS = queryHandlerConfigurations(); @@ -180,7 +182,6 @@ public without sharing abstract class LoggerSObjectHandler { } } - @SuppressWarnings('PMD.AvoidDebugStatements') private void executeApexPlugin(LoggerPlugin__mdt configuration) { try { LoggerPlugin.Triggerable apexPlugin = LoggerPlugin.newTriggerableInstance(configuration.SObjectHandlerApexClass__c); @@ -196,12 +197,11 @@ public without sharing abstract class LoggerSObjectHandler { } } - @SuppressWarnings('PMD.AvoidDebugStatements') private void executeFlowPlugin(LoggerPlugin__mdt configuration) { try { Map flowInputs = new Map(); - flowInputs.put('pluginConfiguration', configuration); - flowInputs.put('pluginInput', this.input); + flowInputs.put(FLOW_PLUGIN_CONFIGURATION_INPUT_NAME, configuration); + flowInputs.put(FLOW_PLUGIN_INPUT_NAME, this.input); Flow.Interview flowPlugin = Flow.Interview.createInterview(configuration.SObjectHandlerFlowName__c, flowInputs); flowPlugin.start(); @@ -250,12 +250,12 @@ public without sharing abstract class LoggerSObjectHandler { private static Map queryHandlerConfigurations() { Map sobjectTypeToHandlerConfiguration = new Map(); for (LoggerSObjectHandler__mdt handlerConfiguration : [ - SELECT IsEnabled__c, SObjectHandlerApexClass__c, SObjectType__r.QualifiedApiName + SELECT IsEnabled__c, SObjectHandlerApexClass__c, SObjectType__r.QualifiedApiName, SObjectTypeOverride__c FROM LoggerSObjectHandler__mdt WHERE IsEnabled__c = TRUE ]) { handlerConfiguration.SObjectType__c = handlerConfiguration.SObjectType__r.QualifiedApiName; - Schema.SObjectType sobjectType = ((SObject) Type.forName(handlerConfiguration.SObjectType__c).newInstance()).getSObjectType(); + Schema.SObjectType sobjectType = prepHandlerType(handlerConfiguration); sobjectTypeToHandlerConfiguration.put(sobjectType, handlerConfiguration); } @@ -266,6 +266,14 @@ public without sharing abstract class LoggerSObjectHandler { return sobjectTypeToHandlerConfiguration; } + private static Schema.SObjectType prepHandlerType(LoggerSObjectHandler__mdt handlerConfiguration) { + if (String.isNotBlank(handlerConfiguration.SObjectTypeOverride__c)) { + handlerConfiguration.SObjectType__c = handlerConfiguration.SObjectTypeOverride__c; + } + + return ((SObject) Type.forName(handlerConfiguration.SObjectType__c).newInstance()).getSObjectType(); + } + @TestVisible private static LoggerSObjectHandler__mdt getHandlerConfiguration(Schema.SObjectType sobjectType) { return SOBJECT_TYPE_TO_HANDLER_CONFIGURATIONS.get(sobjectType); @@ -273,8 +281,7 @@ public without sharing abstract class LoggerSObjectHandler { @TestVisible private static void setMock(LoggerSObjectHandler__mdt handlerConfiguration) { - //TODO cleanup code duplication - Schema.SObjectType sobjectType = ((SObject) Type.forName(handlerConfiguration.SObjectType__c).newInstance()).getSObjectType(); + Schema.SObjectType sobjectType = prepHandlerType(handlerConfiguration); SOBJECT_TYPE_TO_HANDLER_CONFIGURATIONS.put(sobjectType, handlerConfiguration); } diff --git a/nebula-logger/core/tests/configuration/utilities/LoggerMockDataCreator.cls b/nebula-logger/core/tests/configuration/utilities/LoggerMockDataCreator.cls index a1a6d5de3..368fba8bf 100644 --- a/nebula-logger/core/tests/configuration/utilities/LoggerMockDataCreator.cls +++ b/nebula-logger/core/tests/configuration/utilities/LoggerMockDataCreator.cls @@ -22,27 +22,12 @@ public class LoggerMockDataCreator { /** * @description Instances of `AggregateResult` can not be created directly in Apex. - * This method uses a workaround to generate a mock. + * This method uses a workaround to generate a mock, although it will not have any fields or aggregate values populated on the object. * @return The mock instance of `AggregateResult` */ public static AggregateResult createAggregateResult() { - Map defaultMockAggregateKeyValues = new Map{ - 'fieldAvg' => 62.5, - 'fieldMax' => 100, - 'fieldMin' => 25, - 'fieldCount' => 4 - }; - return createAggregateResult(defaultMockAggregateKeyValues); - } - - /** - * @description Instances of `AggregateResult` can not be created directly in Apex. - * This method uses a workaround to generate a mock, using the provided map of aliases & aggregate values - * @param mockAggregateKeyValues A map of aliases & aggregate values to use when creating the mock `AggregateResult` - * @return The mock instance of `AggregateResult` - */ - public static AggregateResult createAggregateResult(Map mockAggregateKeyValues) { - return (AggregateResult) JSON.deserialize(JSON.serialize(mockAggregateKeyValues), AggregateResult.class); + Map emptyAggregateKeyValues = new Map(); + return (AggregateResult) JSON.deserialize(JSON.serialize(emptyAggregateKeyValues), AggregateResult.class); } /** @@ -485,7 +470,7 @@ public class LoggerMockDataCreator { /** * @description Class used to create or update an `SObject` record with static fake data. * This is useful in situations where you need to have fields populated, but the specific - * values used are not relevant to a particular test. + * values used are not relevant to a particular test method. * This class can be used when Apex writing tests for plugins. */ public without sharing class SObjectTestDataBuilder { diff --git a/nebula-logger/core/tests/log-management/classes/LogBatchPurger_Tests.cls b/nebula-logger/core/tests/log-management/classes/LogBatchPurger_Tests.cls index de294434a..3f1a8d525 100644 --- a/nebula-logger/core/tests/log-management/classes/LogBatchPurger_Tests.cls +++ b/nebula-logger/core/tests/log-management/classes/LogBatchPurger_Tests.cls @@ -101,13 +101,13 @@ private class LogBatchPurger_Tests { Log__c log = logs.get(0); System.assertNotEquals(null, log.LogRetentionDate__c); System.assert(log.LogRetentionDate__c < System.today()); - Test.startTest(); + System.Test.startTest(); LoggerSObjectHandler.shouldExecute(true); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); Database.executeBatch(new LogBatchPurger()); - Test.stopTest(); + System.Test.stopTest(); logs = [SELECT Id FROM Log__c WHERE Id IN :logs]; logEntries = [SELECT Id FROM LogEntry__c WHERE Id IN :logEntries]; System.assertEquals(0, logs.size(), logs); @@ -131,13 +131,13 @@ private class LogBatchPurger_Tests { Log__c log = logs.get(0); System.assertNotEquals(null, log.LogRetentionDate__c); System.assert(log.LogRetentionDate__c < System.today()); - Test.startTest(); + System.Test.startTest(); LoggerSObjectHandler.shouldExecute(false); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); Database.executeBatch(new LogBatchPurger()); - Test.stopTest(); + System.Test.stopTest(); logs = [SELECT Id FROM Log__c WHERE Id IN :logs]; logEntries = [SELECT Id FROM LogEntry__c WHERE Id IN :logEntries]; System.assertEquals(0, logs.size(), logs); @@ -157,13 +157,13 @@ private class LogBatchPurger_Tests { update log; log = [SELECT Id, LogRetentionDate__c FROM Log__c]; System.assert(log.LogRetentionDate__c > System.today()); - Test.startTest(); + System.Test.startTest(); LoggerSObjectHandler.shouldExecute(false); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); Database.executeBatch(new LogBatchPurger()); - Test.stopTest(); + System.Test.stopTest(); logs = [SELECT Id FROM Log__c WHERE Id IN :logs]; logEntries = [SELECT Id FROM LogEntry__c WHERE Id IN :logEntries]; System.assertEquals(1, logs.size()); @@ -184,13 +184,13 @@ private class LogBatchPurger_Tests { update log; log = [SELECT Id, LogRetentionDate__c FROM Log__c]; System.assertEquals(null, log.LogRetentionDate__c); - Test.startTest(); + System.Test.startTest(); LoggerSObjectHandler.shouldExecute(false); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); Database.executeBatch(new LogBatchPurger()); - Test.stopTest(); + System.Test.stopTest(); logs = [SELECT Id FROM Log__c WHERE Id IN :logs]; logEntries = [SELECT Id FROM LogEntry__c WHERE Id IN :logEntries]; System.assertEquals(1, logs.size(), logs); @@ -208,13 +208,13 @@ private class LogBatchPurger_Tests { log = [SELECT Id, LogRetentionDate__c, TotalLogEntries__c FROM Log__c WHERE Id = :log.Id]; System.assertEquals(retentionDate, log.LogRetentionDate__c, 'Log should not have a retention date'); System.assertEquals(0, log.TotalLogEntries__c, 'Log should not have any related log entries'); - Test.startTest(); + System.Test.startTest(); LoggerSObjectHandler.shouldExecute(false); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); Database.executeBatch(new LogBatchPurger()); - Test.stopTest(); + System.Test.stopTest(); List matchingLogs = [SELECT Id FROM Log__c WHERE Id = :log.Id]; System.assertEquals(0, matchingLogs.size(), 'Test log should have been deleted'); } @@ -229,13 +229,13 @@ private class LogBatchPurger_Tests { log = [SELECT Id, LogRetentionDate__c, TotalLogEntries__c FROM Log__c WHERE Id = :log.Id]; System.assertEquals(null, log.LogRetentionDate__c, 'Log should not have a retention date'); System.assertEquals(0, log.TotalLogEntries__c, 'Log should not have any related log entries'); - Test.startTest(); + System.Test.startTest(); LoggerSObjectHandler.shouldExecute(false); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); Database.executeBatch(new LogBatchPurger()); - Test.stopTest(); + System.Test.stopTest(); List matchingLogs = [SELECT Id FROM Log__c WHERE Id = :log.Id]; System.assertEquals(0, matchingLogs.size(), 'Test log should have been deleted'); } diff --git a/nebula-logger/core/tests/log-management/classes/LogEntryEventHandler_Tests.cls b/nebula-logger/core/tests/log-management/classes/LogEntryEventHandler_Tests.cls index 154a3dad5..596c84b7a 100644 --- a/nebula-logger/core/tests/log-management/classes/LogEntryEventHandler_Tests.cls +++ b/nebula-logger/core/tests/log-management/classes/LogEntryEventHandler_Tests.cls @@ -169,11 +169,11 @@ private class LogEntryEventHandler_Tests { // TransactionId__c = transactionId // ); - // Test.startTest(); + // System.Test.startTest(); // LogEntryEventHandler.TAGGING_IS_ENABLED = true; // LogEntryEventHandler.TAG_USING_TOPICS = true; // Database.SaveResult saveResult = EventBus.publish(logEntryEvent); - // Test.stopTest(); + // System.Test.stopTest(); // System.assertEquals(true, saveResult.isSuccess(), saveResult.getErrors()); @@ -437,7 +437,7 @@ private class LogEntryEventHandler_Tests { System.assertEquals(true, LoggerParameter.CALL_STATUS_API); LogEntryEvent__e logEntryEvent = createLogEntryEvent(); - // TODO Test.startTest() & stopTest() are still being used so that the callout in LogEntryEventHandler executes, + // TODO System.Test.startTest() & stopTest() are still being used so that the callout in LogEntryEventHandler executes, // but it be nice if this was instead mocked via LoggerMockDataStore (? or some other similar class?) System.Test.startTest(); Database.SaveResult saveResult = LoggerMockDataStore.getEventBus().publishRecord(logEntryEvent); @@ -472,7 +472,7 @@ private class LogEntryEventHandler_Tests { LoggerTestConfigurator.setMock(mockCallStatusApiParameter); LogEntryEvent__e logEntryEvent = createLogEntryEvent(); - // TODO Test.startTest() & stopTest() are still being used so that the callout in LogEntryEventHandler executes, + // TODO System.Test.startTest() & stopTest() are still being used so that the callout in LogEntryEventHandler executes, // but it be nice if this was instead mocked via LoggerMockDataStore (? or some other similar class?) System.Test.startTest(); Database.SaveResult saveResult = LoggerMockDataStore.getEventBus().publishRecord(logEntryEvent); @@ -502,12 +502,12 @@ private class LogEntryEventHandler_Tests { LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false; LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LogEntry__c.SObjectType).IsEnabled__c = false; - Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(400).setResponseBody(createStatusApiResponseJson())); + System.Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(400).setResponseBody(createStatusApiResponseJson())); LoggerParameter__mdt mockCallStatusApiParameter = new LoggerParameter__mdt(DeveloperName = 'CallStatusApi', Value__c = 'false'); LoggerTestConfigurator.setMock(mockCallStatusApiParameter); LogEntryEvent__e logEntryEvent = createLogEntryEvent(); - // TODO Test.startTest() & stopTest() are still being used so that the callout in LogEntryEventHandler executes, + // TODO System.Test.startTest() & stopTest() are still being used so that the callout in LogEntryEventHandler executes, // but it be nice if this was instead mocked via LoggerMockDataStore (? or some other similar class?) System.Test.startTest(); Database.SaveResult saveResult = LoggerMockDataStore.getEventBus().publishRecord(logEntryEvent); @@ -537,14 +537,14 @@ private class LogEntryEventHandler_Tests { LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false; LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LogEntry__c.SObjectType).IsEnabled__c = false; - Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(400).setResponseBody(createStatusApiResponseJson())); + System.Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(400).setResponseBody(createStatusApiResponseJson())); LoggerParameter__mdt mockCallStatusApiParameter = new LoggerParameter__mdt(DeveloperName = 'CallStatusApi', Value__c = 'true'); LoggerTestConfigurator.setMock(mockCallStatusApiParameter); LogEntryEvent__e logEntryEvent = createLogEntryEvent(); Database.SaveResult saveResult; try { - // TODO Test.startTest() & stopTest() are still being used so that the callout in LogEntryEventHandler executes, + // TODO System.Test.startTest() & stopTest() are still being used so that the callout in LogEntryEventHandler executes, // but it be nice if this was instead mocked via LoggerMockDataStore (? or some other similar class?) System.Test.startTest(); saveResult = LoggerMockDataStore.getEventBus().publishRecord(logEntryEvent); @@ -587,7 +587,6 @@ private class LogEntryEventHandler_Tests { logEntryEvent.UserLoggingLevelOrdinal__c = LoggingLevel.INFO.ordinal(); logEntryEvent.ProfileId__c = UserInfo.getProfileId(); logEntryEvent.TimestampString__c = String.valueOf(logEntryEvent.Timestamp__c.getTime()); - logEntryEvent.ParentLogTransactionId__c = null; logEntryEvent.RecordId__c = UserInfo.getUserId(); logEntryEvent.RecordCollectionSize__c = 1; logEntryEvent.RecordCollectionType__c = 'Single'; @@ -626,7 +625,7 @@ private class LogEntryEventHandler_Tests { OrganizationNamespacePrefix__c, OrganizationType__c, OwnerId, - ParentLog__c, + ParentLogTransactionId__c, ProfileId__c, ProfileName__c, Scenario__c, @@ -755,6 +754,7 @@ private class LogEntryEventHandler_Tests { System.assertEquals(logEntryEvent.LogoutUrl__c, log.LogoutUrl__c, 'log.LogoutUrl__c was not properly set'); System.assertEquals(logEntryEvent.NetworkId__c, log.NetworkId__c, 'log.NetworkId__c was not properly set'); System.assertEquals(logOwnerId, log.OwnerId, 'log.OwnerId was not properly set'); + System.assertEquals(logEntryEvent.ParentLogTransactionId__c, log.ParentLogTransactionId__c, 'log.ParentLogTransactionId__c was not properly set'); System.assertEquals(logEntryEvent.ProfileId__c, log.ProfileId__c, 'log.ProfileId__c was not properly set'); System.assertEquals(logEntryEvent.ProfileName__c, log.ProfileName__c, 'log.ProfileName__c was not properly set'); System.assertEquals(logEntryEvent.Scenario__c, log.Scenario__c, 'log.Scenario__c was not properly set'); diff --git a/nebula-logger/core/tests/log-management/classes/LogEntryFieldSetPicklist_Tests.cls b/nebula-logger/core/tests/log-management/classes/LogEntryFieldSetPicklist_Tests.cls index 9fb7bbf8b..459537e15 100644 --- a/nebula-logger/core/tests/log-management/classes/LogEntryFieldSetPicklist_Tests.cls +++ b/nebula-logger/core/tests/log-management/classes/LogEntryFieldSetPicklist_Tests.cls @@ -9,20 +9,20 @@ private class LogEntryFieldSetPicklist_Tests { @IsTest static void it_should_return_null_for_default_value() { // Admins should choose a field set, so always return null for the default - Test.startTest(); + System.Test.startTest(); LogEntryFieldSetPicklist instance = new LogEntryFieldSetPicklist(); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(null, instance.getDefaultValue()); } @IsTest static void it_should_return_all_field_sets_as_values() { - Map expectedFieldSets = Schema.SObjectType.LogEntry__c.fieldSets.getMap(); + Map expectedFieldSets = Schema.SObjectType.LogEntry__c.fieldSets.getMap(); - Test.startTest(); + System.Test.startTest(); LogEntryFieldSetPicklist instance = new LogEntryFieldSetPicklist(); - Test.stopTest(); + System.Test.stopTest(); List dataRows = instance.getValues().getDataRows(); System.assertEquals(expectedFieldSets.size(), dataRows.size()); @@ -32,7 +32,7 @@ private class LogEntryFieldSetPicklist_Tests { System.assert(expectedFieldSets.containsKey(fieldSetName)); - FieldSet fieldSet = expectedFieldSets.get(fieldSetName); + Schema.FieldSet fieldSet = expectedFieldSets.get(fieldSetName); System.assertEquals(fieldSet.getLabel(), fieldSetLabel); } } diff --git a/nebula-logger/core/tests/log-management/classes/LogEntryHandler_Tests.cls b/nebula-logger/core/tests/log-management/classes/LogEntryHandler_Tests.cls index 182082e55..eec7c2c3e 100644 --- a/nebula-logger/core/tests/log-management/classes/LogEntryHandler_Tests.cls +++ b/nebula-logger/core/tests/log-management/classes/LogEntryHandler_Tests.cls @@ -11,7 +11,7 @@ private class LogEntryHandler_Tests { LoggerSObjectHandler.shouldExecute(false); Log__c log = (Log__c) LoggerMockDataCreator.createDataBuilder(Schema.Log__c.SObjectType).populateRequiredFields().getRecord(); insert log; - Test.setCreatedDate(log.Id, System.now().addDays(-8)); + System.Test.setCreatedDate(log.Id, System.now().addDays(-8)); } @IsTest diff --git a/nebula-logger/core/tests/log-management/classes/LogHandler_Tests.cls b/nebula-logger/core/tests/log-management/classes/LogHandler_Tests.cls index 99b9a3fce..630e685e4 100644 --- a/nebula-logger/core/tests/log-management/classes/LogHandler_Tests.cls +++ b/nebula-logger/core/tests/log-management/classes/LogHandler_Tests.cls @@ -193,6 +193,32 @@ private class LogHandler_Tests { System.assertEquals(UserInfo.getUserId(), log.OwnerId, log); } + @IsTest + static void it_should_skip_setting_parent_log_when_it_does_not_exist() { + String parentLogTransactionId = 'ABC-1234'; + Log__c log = new Log__c(ParentLogTransactionId__c = parentLogTransactionId, TransactionId__c = 'XYZ-5678'); + + insert log; + + log = [SELECT Id, ParentLogTransactionId__c, ParentLog__c FROM Log__c WHERE Id = :log.Id]; + System.assertEquals(parentLogTransactionId, log.ParentLogTransactionId__c, log); + System.assertEquals(null, log.ParentLog__c, log); + } + + @IsTest + static void it_should_set_parent_log_when_it_exists() { + String parentLogTransactionId = 'ABC-1234'; + Log__c parentLog = new Log__c(TransactionId__c = parentLogTransactionId); + insert parentLog; + Log__c log = new Log__c(ParentLogTransactionId__c = parentLogTransactionId, TransactionId__c = 'XYZ-5678'); + + insert log; + + log = [SELECT Id, ParentLogTransactionId__c, ParentLog__c FROM Log__c WHERE Id = :log.Id]; + System.assertEquals(parentLogTransactionId, log.ParentLogTransactionId__c, log); + System.assertEquals(parentLog.Id, log.ParentLog__c, log); + } + @IsTest static void it_should_keep_existing_retention_details_when_populated() { setupConfigurations(); diff --git a/nebula-logger/core/tests/log-management/classes/LogMassDeleteExtension_Tests.cls b/nebula-logger/core/tests/log-management/classes/LogMassDeleteExtension_Tests.cls index b0e173215..5c1a94303 100644 --- a/nebula-logger/core/tests/log-management/classes/LogMassDeleteExtension_Tests.cls +++ b/nebula-logger/core/tests/log-management/classes/LogMassDeleteExtension_Tests.cls @@ -37,7 +37,7 @@ private class LogMassDeleteExtension_Tests { ApexPages.StandardSetController controller = new ApexPages.StandardSetController(logs); controller.setSelected(logs); PageReference pageReference = Page.LogMassDelete; - Test.setCurrentPage(pageReference); + System.Test.setCurrentPage(pageReference); LogMassDeleteExtension extension = new LogMassDeleteExtension(controller); List returnedDeletableLogs = extension.getDeletableLogs(); @@ -61,7 +61,7 @@ private class LogMassDeleteExtension_Tests { ApexPages.StandardSetController controller = new ApexPages.StandardSetController(logs); controller.setSelected(logsToDelete); PageReference pageReference = Page.LogMassDelete; - Test.setCurrentPage(pageReference); + System.Test.setCurrentPage(pageReference); LogMassDeleteExtension extension = new LogMassDeleteExtension(controller); extension.deleteSelectedLogs(); diff --git a/nebula-logger/core/tests/log-management/classes/LoggerSObjectMetadata_Tests.cls b/nebula-logger/core/tests/log-management/classes/LoggerSObjectMetadata_Tests.cls index 803773c8e..d2b9f7b75 100644 --- a/nebula-logger/core/tests/log-management/classes/LoggerSObjectMetadata_Tests.cls +++ b/nebula-logger/core/tests/log-management/classes/LoggerSObjectMetadata_Tests.cls @@ -27,7 +27,7 @@ private class LoggerSObjectMetadata_Tests { validateSObjectDetails(userSObjectType, sobjectSchema); } - private static void validateSObjectDetails(SObjectType sobjectType, LoggerSObjectMetadata.SObjectSchema sobjectSchema) { + private static void validateSObjectDetails(Schema.SObjectType sobjectType, LoggerSObjectMetadata.SObjectSchema sobjectSchema) { // SObject details System.assertEquals(sobjectType.getDescribe().getLabel(), sobjectSchema.label); System.assertEquals(sobjectType.getDescribe().getLabelPlural(), sobjectSchema.labelPlural); diff --git a/nebula-logger/core/tests/log-management/classes/RelatedLogEntriesController_Tests.cls b/nebula-logger/core/tests/log-management/classes/RelatedLogEntriesController_Tests.cls index 9efd31e79..aba289cb7 100644 --- a/nebula-logger/core/tests/log-management/classes/RelatedLogEntriesController_Tests.cls +++ b/nebula-logger/core/tests/log-management/classes/RelatedLogEntriesController_Tests.cls @@ -47,7 +47,7 @@ private class RelatedLogEntriesController_Tests { String sortDirection = 'ASC'; String search = null; - Test.startTest(); + System.Test.startTest(); RelatedLogEntriesController.LogEntryQueryResult result = RelatedLogEntriesController.getQueryResult( recordId, @@ -58,7 +58,7 @@ private class RelatedLogEntriesController_Tests { sortDirection, search ); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(fieldSetName, result.fieldSet.name); @@ -95,7 +95,7 @@ private class RelatedLogEntriesController_Tests { } System.assertEquals(1, countOfMatches, logEntries); - Test.startTest(); + System.Test.startTest(); RelatedLogEntriesController.LogEntryQueryResult result = RelatedLogEntriesController.getQueryResult( recordId, @@ -106,7 +106,7 @@ private class RelatedLogEntriesController_Tests { sortDirection, search ); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(fieldSetName, result.fieldSet.name); // FIXME diff --git a/nebula-logger/core/tests/logger-engine/classes/ComponentLogger_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/ComponentLogger_Tests.cls index 93a7edd17..3a9daf24e 100644 --- a/nebula-logger/core/tests/logger-engine/classes/ComponentLogger_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/ComponentLogger_Tests.cls @@ -87,7 +87,7 @@ private class ComponentLogger_Tests { componentLogEntry.record = currentUser; componentLogEntry.timestamp = System.now().addDays(-1 / 24); componentLogEntry.tags = new List{ 'some tag', 'one more tag' }; - Test.startTest(); + System.Test.startTest(); System.assertEquals(0, Logger.saveLogCallCount); System.assertEquals(0, LoggerMockDataStore.getEventBus().getPublishCallCount()); System.assertEquals(0, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size()); diff --git a/nebula-logger/core/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls index a7906acc7..97a64cf9d 100644 --- a/nebula-logger/core/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls @@ -105,7 +105,7 @@ private class FlowCollectionLogEntry_Tests { LoggingLevel userLoggingLevel = LoggingLevel.FINEST; LoggingLevel flowCollectionEntryLoggingLevel = LoggingLevel.DEBUG; System.assert(userLoggingLevel.ordinal() < flowCollectionEntryLoggingLevel.ordinal()); - Test.startTest(); + System.Test.startTest(); System.assertEquals(0, Limits.getQueueableJobs(), 'Test should start with 0 queueable jobs used'); Logger.getUserSettings().LoggingLevel__c = userLoggingLevel.name(); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); diff --git a/nebula-logger/core/tests/logger-engine/classes/FlowLogEntry_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/FlowLogEntry_Tests.cls index 984b5dea2..5abbc94e2 100644 --- a/nebula-logger/core/tests/logger-engine/classes/FlowLogEntry_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/FlowLogEntry_Tests.cls @@ -188,7 +188,7 @@ private class FlowLogEntry_Tests { static void it_should_set_log_scenario() { LoggerDataStore.setMock(LoggerMockDataStore.getEventBus()); LoggingLevel userLoggingLevel = LoggingLevel.FINEST; - Test.startTest(); + System.Test.startTest(); Logger.getUserSettings().LoggingLevel__c = userLoggingLevel.name(); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); FlowLogEntry flowEntry = createFlowLogEntry(); @@ -216,7 +216,7 @@ private class FlowLogEntry_Tests { LoggingLevel userLoggingLevel = LoggingLevel.FINEST; LoggingLevel flowEntryLoggingLevel = LoggingLevel.DEBUG; System.assert(userLoggingLevel.ordinal() < flowEntryLoggingLevel.ordinal()); - Test.startTest(); + System.Test.startTest(); Logger.getUserSettings().LoggingLevel__c = userLoggingLevel.name(); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); List tags = new List{ 'first tag', 'SECOND TAG' }; diff --git a/nebula-logger/core/tests/logger-engine/classes/FlowLogger_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/FlowLogger_Tests.cls index c5bdb7525..785b803db 100644 --- a/nebula-logger/core/tests/logger-engine/classes/FlowLogger_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/FlowLogger_Tests.cls @@ -43,7 +43,7 @@ private class FlowLogger_Tests { static void it_should_auto_save_entry_when_saveLog_is_true() { LoggerDataStore.setMock(LoggerMockDataStore.getEventBus()); LoggingLevel entryLoggingLevel = LoggingLevel.DEBUG; - Test.startTest(); + System.Test.startTest(); Logger.getUserSettings().LoggingLevel__c = entryLoggingLevel.name(); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); System.assertEquals(0, Logger.getBufferSize()); diff --git a/nebula-logger/core/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls index ca06b3418..e92507e6c 100644 --- a/nebula-logger/core/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls @@ -27,7 +27,7 @@ private class FlowRecordLogEntry_Tests { LoggingLevel userLoggingLevel = LoggingLevel.FINEST; LoggingLevel flowRecordEntryLoggingLevel = LoggingLevel.DEBUG; System.assert(userLoggingLevel.ordinal() < flowRecordEntryLoggingLevel.ordinal()); - Test.startTest(); + System.Test.startTest(); Logger.getUserSettings().LoggingLevel__c = userLoggingLevel.name(); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); FlowRecordLogEntry flowRecordEntry = createFlowRecordLogEntry(); diff --git a/nebula-logger/core/tests/logger-engine/classes/LogEntryEventBuilder_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/LogEntryEventBuilder_Tests.cls index 7b230d3c9..363482d6e 100644 --- a/nebula-logger/core/tests/logger-engine/classes/LogEntryEventBuilder_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/LogEntryEventBuilder_Tests.cls @@ -893,7 +893,7 @@ private class LogEntryEventBuilder_Tests { } @IsTest - static void it_should_set_detailed_fields() { + static void it_should_not_set_user_fields_when_anonymous_mode_disabled() { // Get expected data Organization organization = LoggerMockDataCreator.getOrganization(); String organizationEnvironmentType = LoggerMockDataCreator.getOrganizationEnvironmentType(); @@ -920,6 +920,40 @@ private class LogEntryEventBuilder_Tests { System.assertEquals(USER.UserRole?.Name, builder.getLogEntryEvent().UserRoleName__c); } + @IsTest + static void it_should_not_set_user_fields_when_anonymous_mode_enabled() { + Logger.getUserSettings().IsAnonymousModeEnabled__c = true; + + LogEntryEventBuilder builder = Logger.debug('test log entry'); + + System.assertEquals(null, builder.getLogEntryEvent().Locale__c); + System.assertEquals(null, builder.getLogEntryEvent().LoggedById__c); + System.assertEquals(null, builder.getLogEntryEvent().LoggedByUsername__c); + System.assertEquals(null, builder.getLogEntryEvent().LoginApplication__c); + System.assertEquals(null, builder.getLogEntryEvent().LoginBrowser__c); + System.assertEquals(null, builder.getLogEntryEvent().LoginHistoryId__c); + System.assertEquals(null, builder.getLogEntryEvent().LoginPlatform__c); + System.assertEquals(null, builder.getLogEntryEvent().LoginType__c); + System.assertEquals(null, builder.getLogEntryEvent().LogoutUrl__c); + System.assertEquals(null, builder.getLogEntryEvent().ProfileId__c); + System.assertEquals(null, builder.getLogEntryEvent().ProfileName__c); + System.assertEquals(null, builder.getLogEntryEvent().SessionId__c); + System.assertEquals(null, builder.getLogEntryEvent().SessionSecurityLevel__c); + System.assertEquals(null, builder.getLogEntryEvent().SessionType__c); + System.assertEquals(null, builder.getLogEntryEvent().SourceIp__c); + System.assertEquals(null, builder.getLogEntryEvent().ThemeDisplayed__c); + System.assertEquals(null, builder.getLogEntryEvent().TimeZoneId__c); + System.assertEquals(null, builder.getLogEntryEvent().TimeZoneName__c); + System.assertEquals(null, builder.getLogEntryEvent().UserLicenseDefinitionKey__c); + System.assertEquals(null, builder.getLogEntryEvent().UserLicenseId__c); + System.assertEquals(null, builder.getLogEntryEvent().UserLicenseName__c); + System.assertEquals(null, builder.getLogEntryEvent().UserLoggingLevel__c); + System.assertEquals(null, builder.getLogEntryEvent().UserLoggingLevelOrdinal__c); + System.assertEquals(null, builder.getLogEntryEvent().UserRoleId__c); + System.assertEquals(null, builder.getLogEntryEvent().UserRoleName__c); + System.assertEquals(null, builder.getLogEntryEvent().UserType__c); + } + @IsTest static void it_should_use_configured_log_entry_event_fields_for_debug_string() { LoggerParameter.setMock( diff --git a/nebula-logger/core/tests/logger-engine/classes/LoggerSObjectHandler_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/LoggerSObjectHandler_Tests.cls index aa8cdd7fc..cccd481be 100644 --- a/nebula-logger/core/tests/logger-engine/classes/LoggerSObjectHandler_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/LoggerSObjectHandler_Tests.cls @@ -33,6 +33,26 @@ private class LoggerSObjectHandler_Tests { ); } + @IsTest + static void it_should_return_handler_via_override() { + Schema.SObjectType sobjectType = new MockSObjectHandler().getSObjectType(); + LoggerSObjectHandler.setMock( + new LoggerSObjectHandler__mdt( + IsEnabled__c = true, + SObjectHandlerApexClass__c = MockSObjectHandler.class.getName(), + SObjectTypeOverride__c = sobjectType.getDescribe().getName() + ) + ); + + LoggerSObjectHandler configuredInstance = LoggerSObjectHandler.getHandler(sobjectType); + + System.assertEquals( + true, + configuredInstance instanceof MockSObjectHandler, + 'The handler returned via override should be an instance of the configured class, MockSObjectHandler' + ); + } + @IsTest static void it_should_return_default_sobject_handler_implementation_when_no_configuration_provided() { Schema.SObjectType sobjectType = new MockDefaultImplementationSObjectHandler().getSObjectType(); @@ -317,7 +337,7 @@ private class LoggerSObjectHandler_Tests { } public class MockDefaultImplementationSObjectHandler extends LoggerSObjectHandler { - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return Schema.User.SObjectType; } } @@ -339,7 +359,7 @@ private class LoggerSObjectHandler_Tests { this.sobjectType = sobjectType; } - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return this.sobjectType; } diff --git a/nebula-logger/core/tests/logger-engine/classes/Logger_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/Logger_Tests.cls index 98252de77..85daf4b42 100644 --- a/nebula-logger/core/tests/logger-engine/classes/Logger_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/Logger_Tests.cls @@ -101,6 +101,7 @@ private class Logger_Tests { @IsTest static void it_should_return_transaction_id() { String transactionId = Logger.getTransactionId(); + System.assert(String.isNotBlank(transactionId)); System.assertEquals(System.Request.getCurrent().getRequestId(), transactionId); } @@ -110,6 +111,7 @@ private class Logger_Tests { Pattern pattern = Pattern.compile('[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}'); Logger.Uuid uuid = new Logger.Uuid(); + System.assertEquals(36, uuid.getValue().length()); Matcher matcher = pattern.matcher(uuid.getValue()); System.assert(matcher.matches(), 'Generated UUID=' + uuid.getValue()); @@ -119,6 +121,7 @@ private class Logger_Tests { static void it_should_set_logger_version_number() { for (Integer i = 0; i < 10; i++) { LogEntryEventBuilder builder = Logger.info('my log entry'); + System.assertNotEquals(null, builder.getLogEntryEvent().LoggerVersionNumber__c); System.assertEquals(Logger.CURRENT_VERSION_NUMBER, builder.getLogEntryEvent().LoggerVersionNumber__c); } @@ -128,12 +131,14 @@ private class Logger_Tests { static void it_should_set_transaction_entry_number() { for (Integer i = 0; i < 10; i++) { LogEntryEventBuilder builder = Logger.info('my log entry'); + System.assertEquals(i + 1, builder.getLogEntryEvent().TransactionEntryNumber__c); } } @IsTest - static void it_should_default_scenario_when_configured() { + static void it_should_set_scenario_when_default_scenario_configured() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data String transactionScenarioName = 'some test scenario for this transaction'; LoggerSettings__c userSettings = LoggerSettings__c.getInstance(); userSettings.DefaultLogScenario__c = transactionScenarioName; @@ -152,7 +157,8 @@ private class Logger_Tests { } @IsTest - static void it_should_set_scenario() { + static void it_should_set_scenario_when_specified() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data String transactionId = Logger.getTransactionId(); String transactionScenarioName = 'some test scenario for this transaction'; @@ -169,7 +175,8 @@ private class Logger_Tests { } @IsTest - static void it_should_set_scenario_and_apply_scenario_rule_logging_level() { + static void it_should_apply_scenario_rule_logging_level_when_scenario_is_set() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data String transactionId = Logger.getTransactionId(); String transactionScenarioName = 'some test scenario for this transaction'; LogScenarioRule__mdt scenarioRule = new LogScenarioRule__mdt(Scenario__c = transactionScenarioName, UserLoggingLevel__c = LoggingLevel.FINER.name()); @@ -195,6 +202,7 @@ private class Logger_Tests { @IsTest static void it_should_use_last_scenario_when_multiple_scenarios_specified() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data String transactionId = Logger.getTransactionId(); String initialTransactionScenarioName = 'some test scenario for this transaction'; String lastTransactionScenarioName = 'some test scenario for this transaction'; @@ -215,49 +223,48 @@ private class Logger_Tests { @IsTest static void it_should_set_parent_transaction_id() { String expectedParentTransactionId = 'imagineThisWereAGuid'; + Logger.setParentLogTransactionId(expectedParentTransactionId); + System.assertEquals(expectedParentTransactionId, Logger.getParentLogTransactionId()); } @IsTest static void it_should_ignore_parent_transaction_id_when_set_to_current_transaction_id() { String currentTransactionId = Logger.getTransactionId(); + Logger.setParentLogTransactionId(currentTransactionId); + System.assertEquals(null, Logger.getParentLogTransactionId()); } @IsTest static void it_should_return_quiddity_level() { List acceptableDefaultQuidditiesForTests = new List{ Quiddity.RUNTEST_ASYNC, Quiddity.RUNTEST_DEPLOY, Quiddity.RUNTEST_SYNC }; - System.assertEquals(true, acceptableDefaultQuidditiesForTests.contains(Logger.getCurrentQuiddity())); - System.assertEquals(System.Request.getCurrent().getQuiddity(), Logger.getCurrentQuiddity()); + Quiddity currentQuiddity = Logger.getCurrentQuiddity(); + + System.assertEquals(true, acceptableDefaultQuidditiesForTests.contains(currentQuiddity)); + System.assertEquals(System.Request.getCurrent().getQuiddity(), currentQuiddity); } @IsTest static void it_should_return_user_logging_level() { - LoggingLevel expectedValue = LoggingLevel.FINE; - Logger.getUserSettings().LoggingLevel__c = expectedValue.name(); + LoggingLevel expectedLoggingLevel = LoggingLevel.FINE; + Logger.getUserSettings().LoggingLevel__c = expectedLoggingLevel.name(); - Test.startTest(); - LoggingLevel returnedValue = Logger.getUserLoggingLevel(); - Test.stopTest(); + LoggingLevel returnedLoggingLevel = Logger.getUserLoggingLevel(); - System.assertEquals(expectedValue, returnedValue); + System.assertEquals(expectedLoggingLevel, returnedLoggingLevel); } @IsTest static void it_should_return_true_when_enabled() { Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Boolean returnedValue = Logger.isEnabled(); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @@ -265,128 +272,88 @@ private class Logger_Tests { static void it_should_return_true_when_provided_logging_level_is_enabled() { LoggingLevel loggingLevel = LoggingLevel.FINE; Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Logger.getUserSettings().LoggingLevel__c = loggingLevel.name(); Boolean returnedValue = Logger.isEnabled(loggingLevel); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @IsTest static void it_should_return_true_when_error_logging_level_is_enabled() { Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.ERROR.name(); Boolean returnedValue = Logger.isErrorEnabled(); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @IsTest static void it_should_return_true_when_warn_logging_level_is_enabled() { Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.WARN.name(); Boolean returnedValue = Logger.isWarnEnabled(); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @IsTest static void it_should_return_true_when_info_logging_level_is_enabled() { Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.INFO.name(); Boolean returnedValue = Logger.isInfoEnabled(); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @IsTest static void it_should_return_true_when_debug_logging_level_is_enabled() { Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.DEBUG.name(); Boolean returnedValue = Logger.isDebugEnabled(); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @IsTest static void it_should_return_true_when_fine_logging_level_is_enabled() { Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.FINE.name(); Boolean returnedValue = Logger.isFineEnabled(); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @IsTest static void it_should_return_true_when_finer_logging_level_is_enabled() { Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.FINER.name(); Boolean returnedValue = Logger.isFinerEnabled(); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @IsTest static void it_should_return_true_when_finest_logging_level_is_enabled() { Boolean expectedValue = true; - - Test.startTest(); - Logger.getUserSettings().IsEnabled__c = expectedValue; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.FINEST.name(); Boolean returnedValue = Logger.isFinestEnabled(); - Test.stopTest(); - System.assertEquals(expectedValue, returnedValue); } @@ -394,19 +361,18 @@ private class Logger_Tests { static void it_should_return_true_when_saving_is_suspended() { System.assertEquals(false, Logger.isSavingSuspended()); - Test.startTest(); Logger.suspendSaving(); - Test.stopTest(); System.assertEquals(true, Logger.isSavingSuspended()); } @IsTest static void it_should_suspend_saving() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfExistingLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfExistingLogEntries); - Test.startTest(); + System.Test.startTest(); Logger.getUserSettings().IsEnabled__c = true; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.DEBUG.name(); @@ -416,7 +382,7 @@ private class Logger_Tests { Logger.debug('test log entry'); Logger.saveLog(); - Test.stopTest(); + System.Test.stopTest(); countOfExistingLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfExistingLogEntries); @@ -424,10 +390,11 @@ private class Logger_Tests { @IsTest static void it_should_resume_saving() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); - Test.startTest(); + System.Test.startTest(); Logger.getUserSettings().IsEnabled__c = true; Logger.getUserSettings().LoggingLevel__c = LoggingLevel.FINEST.name(); @@ -454,7 +421,7 @@ private class Logger_Tests { System.Test.getEventBus().deliver(); - Test.stopTest(); + System.Test.stopTest(); countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(logEntriesToCreate, countOfLogEntries); @@ -462,9 +429,9 @@ private class Logger_Tests { @IsTest static void it_should_save_accurate_timestamp_when_logging_user_has_different_time_zone() { + // TODO Move this test to LogEntryEventBuilder_Tests, see if there's a way to eliminate creating a user User automatedProcessUser = [SELECT Id, TimeZoneSidKey FROM User WHERE Name = 'Automated Process' AND Profile.Name = NULL]; User testStandardUser = LoggerMockDataCreator.createUser(); - // Make sure that the test user has a different time zone from the automated process user if (automatedProcessUser.TimeZoneSidKey == testStandardUser.TimeZoneSidKey) { switch on automatedProcessUser.TimeZoneSidKey { @@ -501,20 +468,15 @@ private class Logger_Tests { static void it_should_return_the_buffer_size() { System.assertEquals(0, Logger.getBufferSize()); - setUserLoggingLevel(LoggingLevel.DEBUG); - - Test.startTest(); - Logger.debug('test log entry'); Logger.warn('another test log entry'); - Test.stopTest(); - System.assertEquals(2, Logger.getBufferSize()); } @IsTest static void it_should_not_save_when_saving_is_disabled() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -529,7 +491,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getPublishImmediateDml()); - Test.startTest(); + System.Test.startTest(); Logger.saveLog(); System.assertEquals(0, Limits.getPublishImmediateDml()); @@ -537,7 +499,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -545,6 +507,7 @@ private class Logger_Tests { @IsTest static void it_should_save_via_event_bus_when_defaulted() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -559,7 +522,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getPublishImmediateDml()); - Test.startTest(); + System.Test.startTest(); Logger.saveLog(); System.assertEquals(1, Limits.getPublishImmediateDml()); @@ -567,7 +530,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(2, countOfLogEntries); @@ -575,6 +538,7 @@ private class Logger_Tests { @IsTest static void it_should_save_via_event_bus_when_specified_via_settings() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -585,7 +549,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getPublishImmediateDml()); - Test.startTest(); + System.Test.startTest(); Logger.saveLog(Logger.SaveMethod.EVENT_BUS); System.assertEquals(1, Limits.getPublishImmediateDml()); @@ -593,7 +557,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(2, countOfLogEntries); @@ -601,6 +565,7 @@ private class Logger_Tests { @IsTest static void it_should_save_via_event_bus_when_specified_via_setSaveMethod() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -611,7 +576,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getPublishImmediateDml()); - Test.startTest(); + System.Test.startTest(); Logger.SaveMethod expectedSaveMethod = Logger.SaveMethod.EVENT_BUS; Logger.setSaveMethod(expectedSaveMethod); @@ -622,7 +587,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(2, countOfLogEntries); @@ -630,6 +595,7 @@ private class Logger_Tests { @IsTest static void it_should_save_via_queueable_when_defaulted() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -637,7 +603,7 @@ private class Logger_Tests { Logger.getUserSettings().DefaultSaveMethod__c = 'QUEUEABLE'; upsert Logger.getUserSettings(); - Test.startTest(); + System.Test.startTest(); System.assertEquals(Logger.SaveMethod.QUEUEABLE, Logger.getSaveMethod()); @@ -654,7 +620,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(2, countOfLogEntries); @@ -662,6 +628,7 @@ private class Logger_Tests { @IsTest static void it_should_save_via_queueable_when_specified_via_settings() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -672,7 +639,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getQueueableJobs()); - Test.startTest(); + System.Test.startTest(); Logger.saveLog(Logger.SaveMethod.QUEUEABLE); System.assertEquals(0, Limits.getPublishImmediateDml()); @@ -682,7 +649,7 @@ private class Logger_Tests { System.Test.getEventBus().deliver(); - Test.stopTest(); + System.Test.stopTest(); countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(2, countOfLogEntries); @@ -690,6 +657,7 @@ private class Logger_Tests { @IsTest static void it_should_save_via_queueable_when_specified_via_setSaveMethod() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -700,7 +668,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getQueueableJobs()); - Test.startTest(); + System.Test.startTest(); Logger.SaveMethod expectedSaveMethod = Logger.SaveMethod.QUEUEABLE; Logger.setSaveMethod(expectedSaveMethod); @@ -713,7 +681,7 @@ private class Logger_Tests { System.Test.getEventBus().deliver(); - Test.stopTest(); + System.Test.stopTest(); countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(2, countOfLogEntries); @@ -721,7 +689,8 @@ private class Logger_Tests { @IsTest static void it_should_save_via_rest_api_when_defaulted() { - Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(200)); + // TODO eliminate references to Log__c, find alternative way to assert on expected data + System.Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(200)); Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -737,7 +706,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); - Test.startTest(); + System.Test.startTest(); Logger.saveLog(); System.assertEquals(0, Limits.getPublishImmediateDml()); @@ -745,12 +714,13 @@ private class Logger_Tests { System.assertEquals(1, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); } @IsTest static void it_should_save_via_rest_api_when_specified_via_settings() { - Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(200)); + // TODO eliminate references to Log__c, find alternative way to assert on expected data + System.Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(200)); Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -762,7 +732,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); - Test.startTest(); + System.Test.startTest(); Logger.saveLog(Logger.SaveMethod.REST); System.assertEquals(0, Limits.getPublishImmediateDml()); @@ -770,12 +740,13 @@ private class Logger_Tests { System.assertEquals(1, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); } @IsTest static void it_should_save_via_rest_api_when_specified_via_setSaveMethod() { - Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(200)); + // TODO eliminate references to Log__c, find alternative way to assert on expected data + System.Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(200)); Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -787,7 +758,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); - Test.startTest(); + System.Test.startTest(); Logger.SaveMethod expectedSaveMethod = Logger.SaveMethod.REST; Logger.setSaveMethod(expectedSaveMethod); @@ -798,12 +769,13 @@ private class Logger_Tests { System.assertEquals(1, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); } @IsTest static void it_should_throw_exception_when_save_via_rest_api_fails() { - Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(400)); + // TODO eliminate references to Log__c, find alternative way to assert on expected data + System.Test.setMock(HttpCalloutMock.class, LoggerMockDataCreator.createHttpCallout().setStatusCode(400)); Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -815,7 +787,7 @@ private class Logger_Tests { System.assertEquals(0, Limits.getCallouts()); - Test.startTest(); + System.Test.startTest(); try { Logger.saveLog(Logger.SaveMethod.REST); @@ -827,11 +799,12 @@ private class Logger_Tests { System.assertEquals(1, Limits.getCallouts()); System.assertEquals(0, Limits.getDmlStatements()); - Test.stopTest(); + System.Test.stopTest(); } @IsTest static void it_should_save_via_synchronous_dml_when_defaulted() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data LoggerSObjectHandler.setMock( new LoggerSObjectHandler__mdt( DeveloperName = 'Mock_Log_Entry_Event_Config', @@ -847,7 +820,7 @@ private class Logger_Tests { List logEntryEvents = new List(); logEntryEvents.add(Logger.debug('test log entry').getLogEntryEvent()); logEntryEvents.add(Logger.debug('another test log entry').getLogEntryEvent()); - Test.startTest(); + System.Test.startTest(); System.assertEquals(0, Limits.getPublishImmediateDml()); System.assertEquals(0, Limits.getQueueableJobs()); System.assertEquals(0, Limits.getCallouts()); @@ -880,11 +853,12 @@ private class Logger_Tests { System.assertEquals(logEntryEvents.size(), mockLogEntryEventAfterInsertHandler.executedTriggerNew.size()); System.assertEquals(logEntryEvents.get(0), mockLogEntryEventAfterInsertHandler.executedTriggerNew.get(0)); System.assertEquals(logEntryEvents.get(1), mockLogEntryEventAfterInsertHandler.executedTriggerNew.get(1)); - Test.stopTest(); + System.Test.stopTest(); } @IsTest static void it_should_save_via_synchronous_dml_when_specified_via_settings() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data LoggerSObjectHandler.setMock( new LoggerSObjectHandler__mdt( DeveloperName = 'Mock_Log_Entry_Event_Config', @@ -896,7 +870,7 @@ private class Logger_Tests { List logEntryEvents = new List(); logEntryEvents.add(Logger.debug('test log entry').getLogEntryEvent()); logEntryEvents.add(Logger.debug('another test log entry').getLogEntryEvent()); - Test.startTest(); + System.Test.startTest(); System.assertEquals(0, Limits.getPublishImmediateDml()); System.assertEquals(0, Limits.getQueueableJobs()); System.assertEquals(0, Limits.getCallouts()); @@ -931,11 +905,12 @@ private class Logger_Tests { System.assertEquals(logEntryEvents.size(), mockLogEntryEventAfterInsertHandler.executedTriggerNew.size()); System.assertEquals(logEntryEvents.get(0), mockLogEntryEventAfterInsertHandler.executedTriggerNew.get(0)); System.assertEquals(logEntryEvents.get(1), mockLogEntryEventAfterInsertHandler.executedTriggerNew.get(1)); - Test.stopTest(); + System.Test.stopTest(); } @IsTest static void it_should_save_via_synchronous_dml_when_specified_via_setSaveMethod() { + // TODO eliminate references to Log__c, find alternative way to assert on expected data LoggerSObjectHandler.setMock( new LoggerSObjectHandler__mdt( DeveloperName = 'Mock_Log_Entry_Event_Config', @@ -947,7 +922,7 @@ private class Logger_Tests { List logEntryEvents = new List(); logEntryEvents.add(Logger.debug('test log entry').getLogEntryEvent()); logEntryEvents.add(Logger.debug('another test log entry').getLogEntryEvent()); - Test.startTest(); + System.Test.startTest(); System.assertEquals(0, Limits.getPublishImmediateDml()); System.assertEquals(0, Limits.getQueueableJobs()); System.assertEquals(0, Limits.getCallouts()); @@ -982,121 +957,18 @@ private class Logger_Tests { System.assertEquals(logEntryEvents.size(), mockLogEntryEventAfterInsertHandler.executedTriggerNew.size()); System.assertEquals(logEntryEvents.get(0), mockLogEntryEventAfterInsertHandler.executedTriggerNew.get(0)); System.assertEquals(logEntryEvents.get(1), mockLogEntryEventAfterInsertHandler.executedTriggerNew.get(1)); - Test.stopTest(); - } - - @IsTest - static void it_should_not_set_user_fields_when_anonymous_mode_enabled() { - Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; - System.assertEquals(0, countOfLogEntries); - - Logger.getUserSettings().IsAnonymousModeEnabled__c = true; - Logger.debug('test log entry'); - Logger.debug('another test log entry'); - - Test.startTest(); - Logger.saveLog(); - Test.stopTest(); - - Log__c log = [ - SELECT - Id, - Locale__c, - LoggedBy__c, - LoggedByUsername__c, - LoggedByUsernameLink__c, - LoginApplication__c, - LoginBrowser__c, - LoginHistoryId__c, - LoginPlatform__c, - LoginType__c, - LogoutUrl__c, - NetworkId__c, - NetworkLoginUrl__c, - NetworkLogoutUrl__c, - NetworkName__c, - NetworkSelfRegistrationUrl__c, - NetworkUrlPathPrefix__c, - OrganizationDomainUrl__c, - OrganizationEnvironmentType__c, - OrganizationId__c, - OrganizationInstanceName__c, - OrganizationName__c, - OrganizationNamespacePrefix__c, - OrganizationType__c, - ProfileId__c, - ProfileName__c, - SessionId__c, - SessionSecurityLevel__c, - SessionType__c, - SourceIp__c, - ThemeDisplayed__c, - TimeZoneId__c, - TimeZoneName__c, - UserLicenseDefinitionKey__c, - UserLicenseId__c, - UserLicenseName__c, - UserLoggingLevel__c, - UserLoggingLevelOrdinal__c, - UserRoleId__c, - UserRoleName__c, - UserType__c - FROM Log__c - ]; - - System.assertEquals('Anonymous', log.LoggedByUsernameLink__c); - System.assertEquals(null, log.NetworkName__c); - System.assertEquals(null, log.NetworkLoginUrl__c); - System.assertEquals(null, log.NetworkLogoutUrl__c); - System.assertEquals(null, log.NetworkSelfRegistrationUrl__c); - System.assertEquals(null, log.NetworkUrlPathPrefix__c); - System.assertEquals(null, log.LoggedBy__c); - System.assertEquals(null, log.LoggedByUsername__c); - System.assertEquals(null, log.ProfileName__c); - System.assertEquals(null, log.UserLicenseDefinitionKey__c); - System.assertEquals(null, log.UserLicenseId__c); - System.assertEquals(null, log.UserLicenseName__c); - System.assertEquals(null, log.UserRoleName__c); - System.assertEquals(null, log.Locale__c); - System.assertEquals(null, log.NetworkId__c); - System.assertEquals(null, log.LoginHistoryId__c); - System.assertEquals(null, log.LoginApplication__c); - System.assertEquals(null, log.LoginBrowser__c); - System.assertEquals(null, log.LoginPlatform__c); - System.assertEquals(null, log.LoginType__c); - System.assertEquals(null, log.LogoutUrl__c); - System.assertEquals(null, log.ProfileId__c); - System.assertEquals(null, log.SessionId__c); - System.assertEquals(null, log.SessionSecurityLevel__c); - System.assertEquals(null, log.SessionType__c); - System.assertEquals(null, log.SourceIp__c); - System.assertEquals(null, log.TimeZoneId__c); - System.assertEquals(null, log.TimeZoneName__c); - System.assertEquals(null, log.UserLoggingLevel__c); - System.assertEquals(null, log.UserLoggingLevelOrdinal__c); - System.assertEquals(null, log.UserRoleId__c); - System.assertEquals(null, log.UserType__c); - System.assertEquals(null, log.ThemeDisplayed__c); + System.Test.stopTest(); } @IsTest static void it_should_flush_buffer() { - System.assertEquals(0, Logger.getBufferSize()); - - setUserLoggingLevel(LoggingLevel.DEBUG); - - Test.startTest(); - Logger.debug('test log entry'); Logger.debug('another test log entry'); System.assertEquals(2, Logger.getBufferSize()); Logger.flushBuffer(); - Logger.debug('the only log entry to save'); - System.assertEquals(1, Logger.getBufferSize()); - - Test.stopTest(); + System.assertEquals(0, Logger.getBufferSize()); } // Start ERROR methods for LogMessage @@ -1108,11 +980,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1132,11 +1004,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1156,11 +1028,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1180,11 +1052,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1204,11 +1076,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1228,11 +1100,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1252,11 +1124,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1276,11 +1148,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1300,11 +1172,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1324,11 +1196,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1348,11 +1220,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(false, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1372,11 +1244,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1396,11 +1268,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(false, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1420,11 +1292,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1442,11 +1314,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1464,11 +1336,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), getRecord().Id, getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1486,11 +1358,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1508,11 +1380,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), getRecord(), getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1530,11 +1402,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1552,12 +1424,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), users, getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1575,12 +1447,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1598,11 +1470,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1624,11 +1496,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1648,11 +1520,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1672,11 +1544,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1696,11 +1568,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1720,11 +1592,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1744,11 +1616,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1768,11 +1640,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1792,11 +1664,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(false, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1816,11 +1688,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1840,11 +1712,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(false, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1864,11 +1736,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1888,11 +1760,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1912,11 +1784,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1936,11 +1808,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1958,11 +1830,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -1980,11 +1852,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), getRecord().Id, getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2002,11 +1874,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2024,11 +1896,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), getRecord(), getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2046,11 +1918,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2068,12 +1940,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), users, getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2091,12 +1963,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2114,11 +1986,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2139,11 +2011,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2163,11 +2035,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2187,11 +2059,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2211,11 +2083,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2235,11 +2107,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2259,11 +2131,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2283,11 +2155,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2307,11 +2179,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(false, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2331,11 +2203,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2355,11 +2227,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(false, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2377,11 +2249,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2399,11 +2271,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), getRecord().Id, getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2421,11 +2293,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2443,11 +2315,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), getRecord(), getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2465,11 +2337,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2487,12 +2359,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), users, getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2510,12 +2382,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2533,11 +2405,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2559,11 +2431,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2583,11 +2455,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2607,11 +2479,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2631,11 +2503,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2655,11 +2527,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2679,11 +2551,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2703,11 +2575,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2727,11 +2599,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(false, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2751,11 +2623,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2775,11 +2647,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(false, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2797,11 +2669,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2819,11 +2691,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), getRecord().Id, getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2841,11 +2713,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2863,11 +2735,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), getRecord(), getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2885,11 +2757,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2907,12 +2779,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), users, getException()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2930,12 +2802,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2953,11 +2825,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -2979,11 +2851,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3003,11 +2875,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3027,11 +2899,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3051,11 +2923,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3075,11 +2947,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3099,11 +2971,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3123,11 +2995,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3147,11 +3019,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3171,11 +3043,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3193,11 +3065,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3215,11 +3087,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3237,12 +3109,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3260,11 +3132,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3286,11 +3158,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3310,11 +3182,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3334,11 +3206,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3358,11 +3230,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3382,11 +3254,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3406,11 +3278,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3430,11 +3302,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3454,11 +3326,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3478,11 +3350,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3500,11 +3372,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3522,11 +3394,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3544,12 +3416,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3567,11 +3439,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3593,11 +3465,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3617,11 +3489,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3641,11 +3513,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3665,11 +3537,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3689,11 +3561,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3713,11 +3585,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3737,11 +3609,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3761,11 +3633,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3785,11 +3657,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3807,11 +3679,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3829,11 +3701,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3851,12 +3723,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3874,11 +3746,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3900,11 +3772,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3924,11 +3796,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3948,11 +3820,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3972,11 +3844,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -3996,11 +3868,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4020,11 +3892,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4044,11 +3916,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4068,11 +3940,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4092,11 +3964,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4114,11 +3986,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4136,11 +4008,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4158,12 +4030,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4181,11 +4053,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4207,11 +4079,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4231,11 +4103,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4255,11 +4127,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4279,11 +4151,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4303,11 +4175,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4327,11 +4199,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4351,11 +4223,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4375,11 +4247,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4399,11 +4271,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4421,11 +4293,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4443,11 +4315,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4465,12 +4337,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4488,11 +4360,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4514,11 +4386,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4538,11 +4410,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4562,11 +4434,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4586,11 +4458,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4610,11 +4482,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4634,11 +4506,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4658,11 +4530,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4682,11 +4554,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4706,11 +4578,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4728,11 +4600,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4750,11 +4622,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4772,12 +4644,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4795,11 +4667,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4821,11 +4693,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4845,11 +4717,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4869,11 +4741,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4893,11 +4765,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4917,11 +4789,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4941,11 +4813,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4965,11 +4837,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -4989,11 +4861,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5013,11 +4885,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5035,11 +4907,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5057,11 +4929,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5079,12 +4951,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5102,11 +4974,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5128,11 +5000,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5152,11 +5024,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5176,11 +5048,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5200,11 +5072,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5224,11 +5096,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5248,11 +5120,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5272,11 +5144,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5296,11 +5168,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5320,11 +5192,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5342,11 +5214,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5364,11 +5236,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5386,12 +5258,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5409,11 +5281,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5435,11 +5307,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5459,11 +5331,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5483,11 +5355,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5507,11 +5379,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5531,11 +5403,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5555,11 +5427,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5579,11 +5451,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5603,11 +5475,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5627,11 +5499,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5649,11 +5521,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5671,11 +5543,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5693,12 +5565,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5716,11 +5588,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5742,11 +5614,11 @@ private class Logger_Tests { Database.DeleteResult deleteResult = LoggerMockDataCreator.createDatabaseDeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), deleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5766,11 +5638,11 @@ private class Logger_Tests { Database.SaveResult saveResult = LoggerMockDataCreator.createDatabaseSaveResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), saveResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5790,11 +5662,11 @@ private class Logger_Tests { Database.UndeleteResult undeleteResult = LoggerMockDataCreator.createDatabaseUndeleteResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), undeleteResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5814,11 +5686,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5838,11 +5710,11 @@ private class Logger_Tests { Database.UpsertResult upsertResult = LoggerMockDataCreator.createDatabaseUpsertResult(true, false); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), upsertResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5862,11 +5734,11 @@ private class Logger_Tests { List deleteResults = getDeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), deleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5886,11 +5758,11 @@ private class Logger_Tests { List saveResults = getSaveResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), saveResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5910,11 +5782,11 @@ private class Logger_Tests { List undeleteResults = getUndeleteResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), undeleteResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5934,11 +5806,11 @@ private class Logger_Tests { List upsertResults = getUpsertResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), upsertResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5956,11 +5828,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), getRecord().Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -5978,11 +5850,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), getRecord()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -6000,12 +5872,12 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); List users = [SELECT Id, Name, Username, IsActive FROM User LIMIT 5]; LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), users); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -6023,11 +5895,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c); @@ -6049,12 +5921,12 @@ private class Logger_Tests { System.assertEquals(false, Logger.meetsUserLoggingLevel(logEntryLoggingLevel)); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); Boolean shouldSave = true; LogEntryEventBuilder entryBuilder = Logger.newEntry(logEntryLoggingLevel, getLogMessage(), shouldSave); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(shouldSave, entryBuilder.shouldSave()); @@ -6075,12 +5947,12 @@ private class Logger_Tests { System.assertEquals(false, Logger.meetsUserLoggingLevel(logEntryLoggingLevel)); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); Boolean shouldSave = false; LogEntryEventBuilder entryBuilder = Logger.newEntry(logEntryLoggingLevel, getLogMessage(), shouldSave); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(0, Logger.getBufferSize()); System.assertEquals(shouldSave, entryBuilder.shouldSave()); @@ -6093,11 +5965,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.newEntry(loggingLevel, getLogMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(true, entryBuilder.shouldSave()); @@ -6120,12 +5992,12 @@ private class Logger_Tests { System.assertEquals(false, Logger.meetsUserLoggingLevel(logEntryLoggingLevel)); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); Boolean shouldSave = true; LogEntryEventBuilder entryBuilder = Logger.newEntry(logEntryLoggingLevel, getMessage(), shouldSave); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(shouldSave, entryBuilder.shouldSave()); @@ -6146,12 +6018,12 @@ private class Logger_Tests { System.assertEquals(false, Logger.meetsUserLoggingLevel(logEntryLoggingLevel)); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); Boolean shouldSave = false; LogEntryEventBuilder entryBuilder = Logger.newEntry(logEntryLoggingLevel, getMessage(), shouldSave); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(0, Logger.getBufferSize()); System.assertEquals(shouldSave, entryBuilder.shouldSave()); @@ -6164,11 +6036,11 @@ private class Logger_Tests { setUserLoggingLevel(loggingLevel); System.assertEquals(0, Logger.getBufferSize()); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.newEntry(loggingLevel, getMessage()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize()); System.assertEquals(true, entryBuilder.shouldSave()); @@ -6201,9 +6073,9 @@ private class Logger_Tests { Log__c log = new Log__c(TransactionId__c = '1234'); insert log; - Test.startTest(); + System.Test.startTest(); Log__c returnedLog = Logger.getLog(log.Id); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(log.Id, returnedLog.Id); } @@ -6213,9 +6085,9 @@ private class Logger_Tests { Log__c log = new Log__c(TransactionId__c = '1234'); insert log; - Test.startTest(); + System.Test.startTest(); Log__c returnedLog = Logger.getLog(log.TransactionId__c); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(log.Id, returnedLog.Id); } @@ -6255,9 +6127,6 @@ private class Logger_Tests { return deleteResults; } - // TODO only some standard objects can be merged - need to find a way to either mock or trigger a merge result that works in all orgs - // static Database.MergeResult getMergeResult(Boolean isSuccess) { } - static List getSaveResultList() { List saveResults = new List(); for (Integer i = 0; i < 3; i++) { @@ -6317,7 +6186,7 @@ private class Logger_Tests { this.sobjectType = Schema.LogEntryEvent__e.SObjectType; } - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return this.sobjectType; } diff --git a/nebula-logger/extra-tests/classes/ExampleInboundEmailHandler.cls b/nebula-logger/extra-tests/classes/ExampleInboundEmailHandler.cls index 9b33d35aa..5b72c34b3 100644 --- a/nebula-logger/extra-tests/classes/ExampleInboundEmailHandler.cls +++ b/nebula-logger/extra-tests/classes/ExampleInboundEmailHandler.cls @@ -1,3 +1,8 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// + /** * @description Example inbound email handler class */ @@ -13,7 +18,6 @@ global with sharing class ExampleInboundEmailHandler implements Messaging.Inboun * @param env The envelope of the incoming email * @return The result of the inbound email and email handling. */ - @SuppressWarnings('PMD.AvoidDebugStatements') global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope env) { Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); try { @@ -23,9 +27,9 @@ global with sharing class ExampleInboundEmailHandler implements Messaging.Inboun Logger.error(logEntryMessage, apexException); } finally { result.success = true; - System.debug(LoggingLevel.DEBUG, 'Logger buffer size before save: ' + Logger.getBufferSize()); + Logger.debug('Logger buffer size before save: ' + Logger.getBufferSize()); Logger.saveLog(); - System.debug(LoggingLevel.DEBUG, 'Logger buffer size after save: ' + Logger.getBufferSize()); + Logger.debug('Logger buffer size after save: ' + Logger.getBufferSize()); } return result; diff --git a/nebula-logger/extra-tests/classes/FieldSet.cls b/nebula-logger/extra-tests/classes/FieldSet.cls new file mode 100644 index 000000000..68a8f130c --- /dev/null +++ b/nebula-logger/extra-tests/classes/FieldSet.cls @@ -0,0 +1,10 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// + +// This class intentionally does nothing - it's here to ensure that any references +// in Nebula Logger's codebase use `Schema.FieldSet` instead of just `FieldSet` +@SuppressWarnings('PMD.ApexDoc, PMD.EmptyStatementBlock') +public without sharing class FieldSet { +} diff --git a/nebula-logger/extra-tests/classes/FieldSet.cls-meta.xml b/nebula-logger/extra-tests/classes/FieldSet.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/extra-tests/classes/FieldSet.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/extra-tests/classes/FieldSetMember.cls b/nebula-logger/extra-tests/classes/FieldSetMember.cls new file mode 100644 index 000000000..6df3c391b --- /dev/null +++ b/nebula-logger/extra-tests/classes/FieldSetMember.cls @@ -0,0 +1,10 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// + +// This class intentionally does nothing - it's here to ensure that any references +// in Nebula Logger's codebase use `Schema.FieldSetMember` instead of just `FieldSetMember` +@SuppressWarnings('PMD.ApexDoc, PMD.EmptyStatementBlock') +public without sharing class FieldSetMember { +} diff --git a/nebula-logger/extra-tests/classes/FieldSetMember.cls-meta.xml b/nebula-logger/extra-tests/classes/FieldSetMember.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/extra-tests/classes/FieldSetMember.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/extra-tests/classes/SObjectField.cls b/nebula-logger/extra-tests/classes/SObjectField.cls new file mode 100644 index 000000000..4a7a98f26 --- /dev/null +++ b/nebula-logger/extra-tests/classes/SObjectField.cls @@ -0,0 +1,10 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// + +// This class intentionally does nothing - it's here to ensure that any references +// in Nebula Logger's codebase use `Schema.SObjectField` instead of just `SObjectField` +@SuppressWarnings('PMD.ApexDoc, PMD.EmptyStatementBlock') +public without sharing class SObjectField { +} diff --git a/nebula-logger/extra-tests/classes/SObjectField.cls-meta.xml b/nebula-logger/extra-tests/classes/SObjectField.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/extra-tests/classes/SObjectField.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/extra-tests/classes/SObjectType.cls b/nebula-logger/extra-tests/classes/SObjectType.cls new file mode 100644 index 000000000..935acbd44 --- /dev/null +++ b/nebula-logger/extra-tests/classes/SObjectType.cls @@ -0,0 +1,10 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// + +// This class intentionally does nothing - it's here to ensure that any references +// in Nebula Logger's codebase use `Schema.SObjectType` instead of just `SObjectType` +@SuppressWarnings('PMD.ApexDoc, PMD.EmptyStatementBlock') +public without sharing class SObjectType { +} diff --git a/nebula-logger/extra-tests/classes/SObjectType.cls-meta.xml b/nebula-logger/extra-tests/classes/SObjectType.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/extra-tests/classes/SObjectType.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/extra-tests/classes/Test.cls b/nebula-logger/extra-tests/classes/Test.cls new file mode 100644 index 000000000..a46eb1bd2 --- /dev/null +++ b/nebula-logger/extra-tests/classes/Test.cls @@ -0,0 +1,10 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// + +// This class intentionally does nothing - it's here to ensure that any references +// in Nebula Logger's codebase use `System.Test` instead of just `Test` +@SuppressWarnings('PMD.ApexDoc, PMD.EmptyStatementBlock') +public without sharing class Test { +} diff --git a/nebula-logger/extra-tests/classes/Test.cls-meta.xml b/nebula-logger/extra-tests/classes/Test.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/extra-tests/classes/Test.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/extra-tests/tests/LogBatchPurger_Tests_Integration.cls b/nebula-logger/extra-tests/tests/LogBatchPurger_Tests_Integration.cls index e505762a9..1723d1a2d 100644 --- a/nebula-logger/extra-tests/tests/LogBatchPurger_Tests_Integration.cls +++ b/nebula-logger/extra-tests/tests/LogBatchPurger_Tests_Integration.cls @@ -48,9 +48,9 @@ private class LogBatchPurger_Tests_Integration { System.assertEquals(false, Schema.Log__c.SObjectType.getDescribe().isDeletable()); try { - Test.startTest(); + System.Test.startTest(); Database.executeBatch(new LogBatchPurger()); - Test.stopTest(); + System.Test.stopTest(); } catch (NoAccessException ex) { System.assertEquals(LogBatchPurger.NO_DELETE_ACCESS_EXCEPTION_MESSAGE, ex.getMessage()); } diff --git a/nebula-logger/extra-tests/tests/LogMassDeleteExtension_Tests_Integration.cls b/nebula-logger/extra-tests/tests/LogMassDeleteExtension_Tests_Integration.cls index 0087b86c7..deac95b57 100644 --- a/nebula-logger/extra-tests/tests/LogMassDeleteExtension_Tests_Integration.cls +++ b/nebula-logger/extra-tests/tests/LogMassDeleteExtension_Tests_Integration.cls @@ -36,7 +36,7 @@ private class LogMassDeleteExtension_Tests_Integration { ApexPages.StandardSetController controller = new ApexPages.StandardSetController(logs); controller.setSelected(logsToDelete); PageReference pageReference = Page.LogMassDelete; - Test.setCurrentPage(pageReference); + System.Test.setCurrentPage(pageReference); User standardUser = LoggerMockDataCreator.createUser(STANDARD_USER_PROFILE.Id); System.runAs(standardUser) { System.assertEquals(false, Schema.Log__c.SObjectType.getDescribe().isDeletable()); diff --git a/nebula-logger/extra-tests/tests/LoggerSObjectHandler_Tests_Flow.cls b/nebula-logger/extra-tests/tests/LoggerSObjectHandler_Tests_Flow.cls index 3855b4ada..e6cc3cc6e 100644 --- a/nebula-logger/extra-tests/tests/LoggerSObjectHandler_Tests_Flow.cls +++ b/nebula-logger/extra-tests/tests/LoggerSObjectHandler_Tests_Flow.cls @@ -36,7 +36,7 @@ private class LoggerSObjectHandler_Tests_Flow { } private class MockLogHandler extends LoggerSObjectHandler { - public override SObjectType getSObjectType() { + public override Schema.SObjectType getSObjectType() { return Schema.Log__c.SObjectType; } } diff --git a/nebula-logger/extra-tests/tests/Logger_Tests_ExperienceSite.cls b/nebula-logger/extra-tests/tests/Logger_Tests_ExperienceSite.cls index 70fde7ed5..9838876e2 100644 --- a/nebula-logger/extra-tests/tests/Logger_Tests_ExperienceSite.cls +++ b/nebula-logger/extra-tests/tests/Logger_Tests_ExperienceSite.cls @@ -49,7 +49,7 @@ private class Logger_Tests_ExperienceSite { Log__c log = new Log__c(TransactionId__c = '1234'); insert log; - Test.startTest(); + System.Test.startTest(); // Even if Experience Cloud is enabled, the expected test site might not exist, so exit early if the guest user cannot be found List guestUsers = [SELECT Id FROM USER WHERE Profile.NAME = :GUEST_USER_PROFILE_NAME]; @@ -66,7 +66,7 @@ private class Logger_Tests_ExperienceSite { String expectedExceptionMessage = 'FIELD_INTEGRITY_EXCEPTION, field integrity exception (Guest users cannot be record owners.)'; System.assert(ex.getMessage().contains(expectedExceptionMessage), 'Exception did not contain expected message.'); } - Test.stopTest(); + System.Test.stopTest(); } @IsTest diff --git a/nebula-logger/extra-tests/tests/Logger_Tests_InboundEmailHandler.cls b/nebula-logger/extra-tests/tests/Logger_Tests_InboundEmailHandler.cls index 5a7b8ba47..09e7c6547 100644 --- a/nebula-logger/extra-tests/tests/Logger_Tests_InboundEmailHandler.cls +++ b/nebula-logger/extra-tests/tests/Logger_Tests_InboundEmailHandler.cls @@ -18,7 +18,7 @@ private class Logger_Tests_InboundEmailHandler { email.subject = 'My example email'; Messaging.InboundEnvelope envelope = new Messaging.InboundEnvelope(); ExampleInboundEmailHandler emailHandler = new ExampleInboundEmailHandler(); - Test.startTest(); + System.Test.startTest(); LoggerTestConfigurator.setupMockSObjectHandlerConfigurations(); String transactionId = Logger.getTransactionId(); System.assertNotEquals(1, Logger.saveLogCallCount, 'No logging should have occurred yet'); @@ -26,13 +26,13 @@ private class Logger_Tests_InboundEmailHandler { Messaging.InboundEmailResult result = emailHandler.handleInboundEmail(email, envelope); System.assertNotEquals(0, Logger.saveLogCallCount, 'ExampleInboundEmailHandler class should have logged & saved some logging data'); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(true, result.success, 'InboundEmailResult returned a failure message'); List logs = [SELECT Id, TransactionId__c FROM Log__c]; System.assertEquals(1, logs.size(), 'Logs size did not match expected value of 1.'); - System.assertEquals(transactionId, logs.get(0).TransactionId__c, 'Transaction Id does match expected value.'); + System.assertEquals(transactionId, logs.get(0).TransactionId__c, 'Transaction Id does match expected value'); List logEntries = [SELECT Id, Message__c FROM LogEntry__c]; - System.assertEquals(1, logEntries.size(), 'Log entries size did not match expected value of 1.'); - System.assertEquals(ExampleInboundEmailHandler.logEntryMessage, logEntries.get(0).Message__c, 'Log entries message did not match expected value.'); + System.assertEquals(2, logEntries.size(), 'Log entries size did not match expected value of 2 ' + JSON.serializePretty(logEntries)); + System.assertEquals(ExampleInboundEmailHandler.logEntryMessage, logEntries.get(0).Message__c, 'Log entries message did not match expected value'); } } diff --git a/nebula-logger/extra-tests/tests/Logger_Tests_MergeResult.cls b/nebula-logger/extra-tests/tests/Logger_Tests_MergeResult.cls index 32240a0d5..2c634305b 100644 --- a/nebula-logger/extra-tests/tests/Logger_Tests_MergeResult.cls +++ b/nebula-logger/extra-tests/tests/Logger_Tests_MergeResult.cls @@ -34,11 +34,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Logging level name was incorrect.'); @@ -71,11 +71,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getLogMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Logging level was incorrect.'); @@ -103,11 +103,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Logging level was incorrect.'); @@ -140,11 +140,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.error(getMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -177,11 +177,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -214,11 +214,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getLogMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -246,11 +246,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -283,11 +283,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.warn(getMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -320,11 +320,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -357,11 +357,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getLogMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -389,11 +389,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -426,11 +426,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.info(getMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -463,11 +463,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -500,11 +500,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getLogMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -532,11 +532,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -569,11 +569,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.debug(getMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -606,11 +606,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -643,11 +643,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getLogMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -675,11 +675,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log event logging level was incorrect.'); @@ -712,11 +712,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.fine(getMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -749,11 +749,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -786,11 +786,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getLogMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -818,11 +818,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -855,11 +855,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finer(getMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -892,11 +892,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -929,11 +929,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getLogMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -961,11 +961,11 @@ private class Logger_Tests_MergeResult { Database.MergeResult mergeResult = LoggerMockDataCreator.createDatabaseMergeResult(true); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), mergeResult); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); @@ -998,11 +998,11 @@ private class Logger_Tests_MergeResult { List mergeResults = getMergeResultList(); - Test.startTest(); + System.Test.startTest(); LogEntryEventBuilder entryBuilder = Logger.finest(getMessage(), mergeResults); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(1, Logger.getBufferSize(), 'Logger buffer size was incorrect.'); System.assertEquals(loggingLevel.name(), entryBuilder.getLogEntryEvent().LoggingLevel__c, 'Log entry event logging level was incorrect.'); diff --git a/nebula-logger/managed-package/core/main/configuration/classes/LoggerInstallHandler_Tests.cls b/nebula-logger/managed-package/core/main/configuration/classes/LoggerInstallHandler_Tests.cls index 763aad77d..068437a38 100644 --- a/nebula-logger/managed-package/core/main/configuration/classes/LoggerInstallHandler_Tests.cls +++ b/nebula-logger/managed-package/core/main/configuration/classes/LoggerInstallHandler_Tests.cls @@ -18,10 +18,10 @@ private class LoggerInstallHandler_Tests { Version version = null; Boolean isUpgrade = false; - Test.startTest(); + System.Test.startTest(); LoggerInstallHandler installHandler = new LoggerInstallHandler(); - Test.testInstall(installHandler, version, isUpgrade); - Test.stopTest(); + System.Test.testInstall(installHandler, version, isUpgrade); + System.Test.stopTest(); // Verify that we now have 1 record... List loggerSettings = [SELECT Id FROM LoggerSettings__c]; @@ -56,14 +56,14 @@ private class LoggerInstallHandler_Tests { Version version = null; Boolean isUpgrade = false; - Test.startTest(); + System.Test.startTest(); LoggerInstallHandler installHandler = new LoggerInstallHandler(); installHandler.settingsWithouDefaultSaveMethod = mockSettings; - Test.testInstall(installHandler, version, isUpgrade); + System.Test.testInstall(installHandler, version, isUpgrade); - Test.stopTest(); + System.Test.stopTest(); for (LoggerSettings__c setting : mockSettings) { System.assertNotEquals(null, setting.DefaultSaveMethod__c); diff --git a/nebula-logger/plugins/.images/btn-install-unlocked-package-plugin-production.png b/nebula-logger/plugins/.images/btn-install-unlocked-package-plugin-production.png new file mode 100644 index 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U{c1x>Y+9LjXBfUzbE2jgbgXJ0zs^2=*2%!6_PX zIYjx~9P38hKlEAxy2_92Iy#mcd*`k9#Ip#g4}CSHgC_7Tgk0z*x2^}OZgNXExNEF7 zTL(leqyVfUA69e{RuJkyF)S74Z@CJYB|Ay8g+kKIncbw5OizyPNQ){(%CSm#AFkj| zaJ=XMAtKbBPH=RVkm>ALP3L9qINn`>=&kv5dPy1Vv^3I9dum7hh-ydUzA8vh(dn6` z84@;R3eewym)fg)93^?cuPKa0xO$30SRwR=BOl#+>lvQ%3;$+ zlhwcKHRa$f~bE+$ROdB*h&} z!SD2S55^a)=DH#E?>FhSj1pu=85<{C_|3kJaC*_zn|W0h=J4~eMRbr09mEh$?{(6t zav3}`dSE3YOKzb95@rv2}c@hctFDCR2Z2 zkMY^{%j$m{&bt7XQpCsf(5bT$o`*?Z?a688YV9H+OEq~z5hC^$A%XOlJ$Wn143Cq# zzBwQ~ya~~?0ejL$;>>BM! ztCqFZ92vRRN<<|VAcFEVC#Ta)JTTJ9H?pgs=;n`DMIzk?+@&fPk{H6JDNneeYq> zSKmv>aF%vz-PE5!$R|;zp8i8Yu$2TRKt%d3qiJ9)Twg0p^xI87HSt95lQ@JOVrdV;uor zxsCM^_?>fxir04I zf1vpu@(4VY2nYoN0oebp=M#?rj{uLrctC*ZGp5&s);2b1Y1aF@oAJ;)z7ISCJOWQG z0!*JVy(V;)x(M#vu0zw^ySxSW)J_M!<2(Xm9|2~uF+Ilg8PjV5U6-m=RXwfu?s5OS uUYEyTc?5U_cm&1@0?ZX<78_G+Oy=^h3tv1kWu_Cm4+>nlEJOarC;ty9&eNU% literal 0 HcmV?d00001 diff --git a/nebula-logger/plugins/.images/btn-install-unlocked-package-plugin-sandbox.png b/nebula-logger/plugins/.images/btn-install-unlocked-package-plugin-sandbox.png index 6b271f988bca0b4cf9af9dac9a2f9896c2e28510..a7c8cbf973203956c7926fb19caf91f9a9114c74 100644 GIT binary patch literal 39944 zcmeHQ3tW`dw*SvC42(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7 z+_^Snm|pqN(_zAwU4w>+>(z;z0#lewd>+>#gS@N=ruH)xh?~}d6qD|-yslY&XK@YU z$|OjClyZ}CGPHhHYtSF7+>Gy`g&7%NSM%2FowLCcNx9AFuWD!u$`O&>1*wAo8odw^ ztCdEtjAHnucE~tX0q_5k;^-T*=rphmF^9`Aj|44ulp^V2iuo_Gy<;3jOp9;(0Mav? z5d6Yrl#zm{>_v!rP)VmwL2Eaw(TcH=JzVMTuR5>nvI5fxH&-I$teC zE*a1WIz-5Pg6%>kMPP&4A?Q&jM84L9*b@>u)$vCDRXQzwrIMd^jqfBg)o{jI~R-CsH<4Aokq~B+)*ka3K9#DMRpa zv&K?e%+t{U-p(47^^hL=QnCRfi6g^qM0`bj?o zFg}%@ND3=QXl4z9wzJ5DBQU;?p4ZRhTzeN_u&bcreEER)tl5K4_$wZP$wr`|8Zl`- z*s_C;^4Y;iFXa|1>Jj&D9}-h%O~6B*1P0j&Ua}UdKg>29{PdF{*U;-P>Fo&KZa8tB zgi&}BKNAA<&jXC-eE(zgW4_g+h@n0$h!O z3MH)NlsA;nl8{(QUH)Qx@&k_~(u3F`R0%pwJW(hWyMD%X?-u@2Eb`-y4*@>R93NhMYaRg}fm;v(KFquY zg~GGMBfujtF$5-ZmN2oA_+C5$JOVrdHxU8enB7EhdD3?Z0%sRj(MnN%8ou6N8ne3fKVV1fc@L(eBlw`5#SNH9T8ymi`g-uoxMHUb?g;x zzVHa}2=EBpeh4u8#q5~SP3bOZZfZo^l`Fi5cKgYZ=a@&}SBn7i$e7(?_Dil%*j#%j zyIxZ_&~f!D_iv;BYSG~*&LhAhaN8ijLQCe6ks%X`#S)zQ>%9qobo1cOY{J7ec@Tbmk`% diff --git a/nebula-logger/plugins/.images/btn-install-unlocked-package-plugin.png b/nebula-logger/plugins/.images/btn-install-unlocked-package-plugin.png deleted file mode 100644 index 9c3bbf6a81f3b7c2ab37f73b0f6ed267dab57f44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001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la5I z9k2Y4#ymZoyaXPB)*-;%+sB~hM`P+L@;{$ehXnu5Bk=4IX!!GK-%fhP@{@(*mU3Fd N29F%Hf51B{{tr9mGx-1j diff --git a/nebula-logger/plugins/async-failure-additions/.images/opt-into-batch-logging-with-logger-parameter.png b/nebula-logger/plugins/async-failure-additions/.images/opt-into-batch-logging-with-logger-parameter.png new file mode 100644 index 0000000000000000000000000000000000000000..c0291d4b4e61be1de5feaa662fbae091df86f1b4 GIT binary patch literal 26889 zcmeFZc{tnY{y%J{XU6G1r#&dGnrVv;MN3f>(~a8I5=4noA_y%_)DoGFwni02N$n-p z5Gj(VHC?H_u|y@7wzd+XmIR3;&z;UW-_!Y?^DN)%cU{l({PDZ4()c8w`}4l<`@Ov0 zulM^-yuGdY&TR_Yq@<*FT3kHuASETOCnfbw{a?QYS9}sLJOTfG6XsxkR;sG!z%2OV zFYq%qXQZU6leceP`40TO_1Z82-V6#1aoH$scQ z@kx&05L2t>9AoL0_2}mW%ap$5vJ?A{si(YU}caXomH>>cA>-*u7^gjJVzaQFi@RGde_uB7wXubSVD^FY*$nEZ~g^&<;7u>p6 z7hPP47}GV(s8(-(n(rD#Zj@csIMrjk+vG1mOsQuDbqg*u{-C3sF*i_hL26e$YCY3$NgZ{@+MmOq>0Gd?5o`INE?>gMYRLQxBV?){+``nX~FbV6+&_!j1R8 zA5OX{WW&U>cG$?FDvybQmoHi{0?n57kBgYasEIEVeE-&=5OepnCAqu8lS`PqUz;yB z;Z-M3l`Owjgl&<`GA?5eN5?6i_sAznJ{rnvSIzHwdw1vlSfh<>J){Eseg;2T zyq>JzJZsZ#F>N%y(bJVxsRm?O?6cD9K4j5Z5)!kLt)m_WhPyLF6ANgxN5jZg(=*(Vi9QxJXy5f{U&N`1^BZjs zviWJI8)=hGA}*;nY~SuL8(>B4Qf9U(VK?V%d#movNt>=ex5?IP<`0s3Ug^^|x{bmY z4yX$GLy|@1bJ=M;MqLZHvbKkhH|68WFadK&r8eEacA(T$I7=NE-|QZ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-+^ :information_source: This plugin requires `v4.7.2` or newer of Nebula Logger's unlocked package + +[![Install Unlocked Package Plugin in a Sandbox](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lhiQAA) +[![Install Unlocked Package Plugin in Production](../.images/btn-install-unlocked-package-plugin-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lhiQAA) + +## What's Included + +### Unexpected Batch Error Logging + +By default, this plugin adds support for logging unexpected Batch class failures in Apex. All a batch class needs to do is implement the marker `Database.RaisesPlatformEvents` interface _and_ create a `LoggerParameter__mdt` record where the `Value` field matches the name of the batch class you are looking to add logging for, and the DeveloperName (the "Name" field) starts with `BatchError`: + +```java +// the class MUST implement Database.RaisesPlatformEvents for this to work correctly! +public class MyExampleBatchable implements Database.Batchable, Database.RaisesPlatformEvents { + // etc ... +} +``` + +And the CMDT record: + +![Setting up the Logger Parameter record to opt into unexpected Batch failures](./.images/opt-into-batch-logging-with-logger-parameter.png) + +Once you've correctly configured those two things (the marker interface `Database.RaisesPlatformEvents` on the Apex batchable class, and the Logger Parameter CMDT record), your class will now log any uncaught exceptions that cause that batch class to fail unexpectedly. + +--- + +If you want to customize additional behavior off of the trigger that subscribes to `BatchApexErrorEvent`, you can do so by creating a new Trigger SObject Handler CMDT record using the `TriggerSObjectHandler__mdt.SObjectTypeOverride__c` field (since `BatchApexErrorEvent` isn't one of the supported Entity Definition picklist results). The Logger SObject Handler Name should correspond to a valid instance of `LoggerSObjectHandler` - the instance of `LogBatchApexEventHandler` included in this plugin shows what an example logging implementation for unexpected failures would look like, if you want to go down that route. + +### Queueable Error Logging + +If you have Apex classes that implement `System.Queueable`, you can add error logging with some minimal code additions: + +```java +public class MyExampleQueueable implements System.Queueable { + public void execute (System.QueueableContext qc) { + System.attachFinalizer(new LogFinalizer()); + } +} +``` + +If you'd like to do _additional_ processing, you can alternatively choose to _extend_ `LogFinalizer`: + +```java +public class MyCustomFinalizer extends LogFinalizer { + protected override void innerExecute(System.FinalizerContext fc) { + // do whatever you'd like! + // errors will be logged automatically in addition to what you choose to do here + // no need to call Logger.saveLog() manually on this code path + } +} +``` diff --git a/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler.cls b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler.cls new file mode 100644 index 000000000..4fd27b73f --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler.cls @@ -0,0 +1,67 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// +/** + * @group Plugins + * @description `BatchApexErrorEvent` handler to log unexpected batch errors for classes that implement `Database.RaisesPlatformEvents` and opt into processing via `LoggerParameter__mdt` + * @see LoggerSObjectHandler + */ +public without sharing class LogBatchApexErrorEventHandler extends LoggerSObjectHandler { + public static final String BATCH_ERROR_LOGGER = 'BatchError'; + public static final String LOG_MESSAGE = 'An unexpected job error occurred: {0} with exception type: {1} and message: {2} during batch phase: {3}.\nStacktrace: {4}'; + private static Boolean shouldSaveLogs = false; + + private List batchApexErrorEvents; + + /** + * @description Opts into the default constructor + */ + public LogBatchApexErrorEventHandler() { + super(); + } + + public override Schema.SObjectType getSObjectType() { + return Schema.BatchApexErrorEvent.SObjectType; + } + + protected override void executeAfterInsert(List triggerNew) { + this.batchApexErrorEvents = (List) triggerNew; + this.handleJobErrors(); + } + + private void handleJobErrors() { + Set asyncApexJobIds = new Set(); + for (BatchApexErrorEvent evt : this.batchApexErrorEvents) { + asyncApexJobIds.add(evt.AsyncApexJobId); + } + + Map jobIdToClass = new Map([SELECT Id, ApexClass.Name FROM AsyncApexJob WHERE Id IN :asyncApexJobIds]); + Logger.error('Batch job terminated unexpectedly'); + for (BatchApexErrorEvent errorEvent : this.batchApexErrorEvents) { + shouldSaveLogs = this.getShouldSaveLogs(jobIdToClass, errorEvent); + LogMessage logMessage = new LogMessage( + LOG_MESSAGE, + new List{ errorEvent.AsyncApexJobId, errorEvent.ExceptionType, errorEvent.Message, errorEvent.Phase, errorEvent.StackTrace } + ); + Logger.error(logMessage); + } + if (shouldSaveLogs) { + Logger.saveLog(); + } + } + + private Boolean getShouldSaveLogs(Map jobIdToClass, BatchApexErrorEvent errorEvent) { + if (shouldSaveLogs == false) { + AsyncApexJob job = jobIdToClass.get(errorEvent.AsyncApexJobId); + List configurationList = LoggerParameter.matchOnPrefix(BATCH_ERROR_LOGGER); + for (LoggerParameter__mdt config : configurationList) { + if (config.Value__c == job?.ApexClass.Name) { + shouldSaveLogs = true; + break; + } + } + } + return shouldSaveLogs; + } +} diff --git a/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler.cls-meta.xml b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler_Tests.cls b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler_Tests.cls new file mode 100644 index 000000000..e327d41dd --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler_Tests.cls @@ -0,0 +1,100 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// +@SuppressWarnings('PMD.ApexDoc, PMD.ApexAssertionsShouldIncludeMessage, PMD.MethodNamingConventions, PMD.ApexUnitTestClassShouldHaveAsserts') +@IsTest(IsParallel=true) +private class LogBatchApexErrorEventHandler_Tests implements Database.Batchable, Database.RaisesPlatformEvents { + private enum Phase { + START, + EXECUTE, + FINISH + } + + private final Phase throwLocation; + + @IsTest + static void it_should_create_log_when_batch_job_throws_in_start_method() { + runTestForPhase(Phase.START); + } + + @IsTest + static void it_should_create_log_when_batch_job_throws_in_execute_method() { + runTestForPhase(Phase.EXECUTE); + } + + @IsTest + static void it_should_create_log_when_batch_job_throws_in_finish_method() { + runTestForPhase(Phase.FINISH); + } + + @SuppressWarnings('PMD.EmptyCatchBlock') + private static void runTestForPhase(Phase phase) { + Logger.getUserSettings().IsApexSystemDebugLoggingEnabled__c = false; + LoggerParameter__mdt mockParam = new LoggerParameter__mdt(); + mockParam.Value__c = LogBatchApexErrorEventHandler_Tests.class.getName(); + mockParam.DeveloperName = LogBatchApexErrorEventHandler.BATCH_ERROR_LOGGER + 'Test'; + LoggerParameter.setMock(mockParam); + try { + System.Test.startTest(); + Database.executeBatch(new LogBatchApexErrorEventHandler_Tests(phase)); + System.Test.stopTest(); + } catch (Exception ex) { + // via https://salesforce.stackexchange.com/questions/263419/testing-batchapexerrorevent-trigger + } + // at this point, we're still two async-levels deep into Platform Event-land; we need to call "deliver()" twice + System.Test.getEventBus().deliver(); // fires the platform event for Database.RaisesPlatformEvents + System.Test.getEventBus().deliver(); // fires the logger's platform event + + assertLogWasCreatedForPhase(phase); + } + + private static void assertLogWasCreatedForPhase(Phase phase) { + Log__c log = getLog(); + System.assertNotEquals(null, log, 'Log should have been created!'); + System.assertEquals(2, log.LogEntries__r.size(), 'Two log entries should have been created'); + System.assertEquals('Batch job terminated unexpectedly', log.LogEntries__r[0].Message__c); + System.assertEquals( + String.format( + LogBatchApexErrorEventHandler.LOG_MESSAGE, + new List{ 'someId', 'System.IllegalArgumentException', phase.name(), phase.name(), 'stacktrace' } + ) + .subStringAfter('with') + .substringBefore('Stacktrace:'), + log.LogEntries__r[1].Message__c.substringAfter('with').substringBefore('Stacktrace:') + ); + } + + /** + * the `BatchApexErrorEvent` type has a property, `Phase` with three possible values: + * - START + * - EXECUTE + * - FINISH + */ + public LogBatchApexErrorEventHandler_Tests(Phase throwLocation) { + this.throwLocation = throwLocation; + } + + public Database.QueryLocator start(Database.BatchableContext bc) { + throwOnLocationMatch(Phase.START); + return Database.getQueryLocator([SELECT Id FROM User LIMIT 1]); + } + + public void execute(Database.BatchableContext bc, List scope) { + throwOnLocationMatch(Phase.EXECUTE); + } + + public void finish(Database.BatchableContext bc) { + throwOnLocationMatch(Phase.FINISH); + } + + private void throwOnLocationMatch(Phase phase) { + if (this.throwLocation == phase) { + throw new IllegalArgumentException(this.throwLocation.name()); + } + } + + private static Log__c getLog() { + return [SELECT Id, (SELECT Message__c FROM LogEntries__r) FROM Log__c]; + } +} diff --git a/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler_Tests.cls-meta.xml b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler_Tests.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogBatchApexErrorEventHandler_Tests.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer.cls b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer.cls new file mode 100644 index 000000000..8e29533f7 --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer.cls @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// +/** + * @group Plugins + * @description `System.Finalizer` implementation that can be used by subscribers to log errors + */ +public without sharing virtual class LogFinalizer implements System.Finalizer { + /** + * @description Is called by any `System.Queueable` where the finalizer is attached after the Queueable's `execute` method finishes + * @param fc The `System.FinalizerContext` associated with the finalizer + */ + public void execute(System.FinalizerContext fc) { + switch on fc.getResult() { + when UNHANDLED_EXCEPTION { + Logger.error('There was an error during this queueable job'); + Logger.error('Error details', fc.getException()); + } + } + this.innerExecute(fc); + Logger.saveLog(); + } + + /** + * @description Subscribers can optionally override this method with their own implementation to do further processing/re-queueing + * @param fc The `System.FinalizerContext` associated with the finalizer + */ + @SuppressWarnings('PMD.EmptyStatementBlock') + protected virtual void innerExecute(System.FinalizerContext fc) { + // subscribers can override this to do their own post-processing if necessary, otherwise it's a no-op + } +} diff --git a/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer.cls-meta.xml b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer_Tests.cls b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer_Tests.cls new file mode 100644 index 000000000..fc4a56f8d --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer_Tests.cls @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// +@SuppressWarnings('PMD.ApexDoc, PMD.ApexAssertionsShouldIncludeMessage, PMD.MethodNamingConventions') +@IsTest(IsParallel=true) +private class LogFinalizer_Tests { + private static final String EXPECTED_ERROR_MESSAGE = 'Gack'; + @IsTest + static void it_should_not_log_on_queueable_success() { + System.Test.startTest(); + System.enqueueJob(new ExampleQueueable()); + System.Test.stopTest(); + System.Test.getEventBus().deliver(); + + System.assertEquals(0, [SELECT COUNT() FROM Log__c], 'Should not log if no errors'); + } + + @IsTest + static void it_should_log_on_queueable_error() { + try { + System.Test.startTest(); + System.enqueueJob(new ExampleFailedQueueable()); + System.Test.stopTest(); + } catch (Exception ex) { + System.assertEquals(EXPECTED_ERROR_MESSAGE, ex.getMessage()); + } + System.Test.getEventBus().deliver(); + + List logEntries = [SELECT Message__c, ExceptionMessage__c FROM LogEntry__c]; + System.assertEquals(2, logEntries.size(), 'Should log for errors'); + LogEntry__c firstEntry = logEntries.get(0); + System.assertEquals('There was an error during this queueable job', firstEntry.Message__c); + LogEntry__c secondEntry = logEntries.get(1); + System.assertEquals('Error details', secondEntry.Message__c); + System.assertEquals(EXPECTED_ERROR_MESSAGE, secondEntry.ExceptionMessage__c); + } + + private virtual class ExampleQueueable implements System.Queueable { + public void execute(System.QueueableContext qc) { + System.attachFinalizer(new LogFinalizer()); + this.innerExecute(); + } + + @SuppressWarnings('PMD.EmptyStatementBlock') + protected virtual void innerExecute() { + } + } + + private virtual class ExampleFailedQueueable extends ExampleQueueable { + protected override void innerExecute() { + throw new IllegalArgumentException(EXPECTED_ERROR_MESSAGE); + } + } +} diff --git a/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer_Tests.cls-meta.xml b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer_Tests.cls-meta.xml new file mode 100644 index 000000000..891916bb0 --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/classes/LogFinalizer_Tests.cls-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/plugins/async-failure-additions/plugin/triggers/LogBatchApexErrorEventTrigger.trigger b/nebula-logger/plugins/async-failure-additions/plugin/triggers/LogBatchApexErrorEventTrigger.trigger new file mode 100644 index 000000000..8c68f608e --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/triggers/LogBatchApexErrorEventTrigger.trigger @@ -0,0 +1,7 @@ +//------------------------------------------------------------------------------------------------// +// This file is part of the Nebula Logger project, released under the MIT License. // +// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. // +//------------------------------------------------------------------------------------------------// +trigger LogBatchApexErrorEventTrigger on BatchApexErrorEvent(after insert) { + LoggerSObjectHandler.getHandler(Schema.BatchApexErrorEvent.SObjectType, new LogBatchApexErrorEventHandler()).execute(); +} diff --git a/nebula-logger/plugins/async-failure-additions/plugin/triggers/LogBatchApexErrorEventTrigger.trigger-meta.xml b/nebula-logger/plugins/async-failure-additions/plugin/triggers/LogBatchApexErrorEventTrigger.trigger-meta.xml new file mode 100644 index 000000000..5e573d796 --- /dev/null +++ b/nebula-logger/plugins/async-failure-additions/plugin/triggers/LogBatchApexErrorEventTrigger.trigger-meta.xml @@ -0,0 +1,5 @@ + + + 54.0 + Active + diff --git a/nebula-logger/plugins/big-object-archiving/README.md b/nebula-logger/plugins/big-object-archiving/README.md index 403644da2..882f84944 100644 --- a/nebula-logger/plugins/big-object-archiving/README.md +++ b/nebula-logger/plugins/big-object-archiving/README.md @@ -2,16 +2,16 @@ > :information_source: This plugin requires `v4.7.1` or newer of Nebula Logger's unlocked package -[![Install Unlocked Package](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgLQAQ) -Adds a Big Object - `LogEntryArchive__b` - to Nebula Logger for archiving of logging data. +[![Install Unlocked Package Plugin in a Sandbox](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgLQAQ) +[![Install Unlocked Package Plugin in Production](../.images/btn-install-unlocked-package-plugin-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgLQAQ) -The `LogEntryArchive__b` object can be used to: +Adds a Big Object - `LogEntryArchive__b` - to Nebula Logger for archiving of logging data. The `LogEntryArchive__b` object can be used to: - **To immediately publish logging data, instead of using platform events**. Out of the box, Nebula Logger leverages platform events (`LogEntryEvent__e`) as the mechanism for saving logging data, even if an error occurs. It then transforms the platform event data in `LogEntryEvent__e` and stores it in `Log__c` and `LogEntry__c` for reporting & managing of logs. If you want to skip the platform events altogether, and don't need to report on the data via Log**c or LogEntry**c, then you can leverage the Big Object Archiving plugin to immediately write to `LogEntryArchive__b`, giving you a way to store logging data on platform, without consuming your data storage limits (although it's worth noting that Big Objects have their own storage limits as well). - **To later archive `Log__c` and `LogEntry__c` data**. If you want to leverage the benefits of having logging data in `Log__c` and `LogEntry__c`, but need to delete some records due to storage limits, the plugin also provides the ability to archive `Log__c` and `LogEntry__c` data into the big object `LogEntryArchive__b`. This is accomplished by setting a "Log Purge Action" to "Archive" on any `Log__c` records that you want to archive into the `LogEntryArchive__b` big object. - When the `LogBatchPurger` job runs, any `Log__c` (and related `LogEntry__c` records) with a "Log Purge Action" of "Archive" and a "Log Retention Date" <= TODAY will first be copied into the big object `LogEntryArchive__b`, before being deleted in `Log__c` and `LogEntry__c`. -![Big Object Archiving plugin: Log Entry Archives tab](./images/log-entry-archives-tab.png) +![Big Object Archiving plugin: Log Entry Archives tab](./.images/log-entry-archives-tab.png) --- @@ -19,7 +19,7 @@ The `LogEntryArchive__b` object can be used to: This plugin includes some add-on metadata for Nebula Logger to support storing logging data within a big object -1. BigObject `LogEntryArchive__b` +1. Big Object `LogEntryArchive__b` 2. Custom tab "Log Entry Archives" to display the included LWC `logEntryArchives` 3. Apex classes `LogEntryArchivePlugin`, `LogEntryArchiveBuilder` and corresponding test classes 4. Plugin configuration details stored in Logger's CMDT objects `LoggerPlugin__mdt` and `LoggerParameter__mdt` diff --git a/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchiveBuilder.cls b/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchiveBuilder.cls index 0c841fe60..b6fa08821 100644 --- a/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchiveBuilder.cls +++ b/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchiveBuilder.cls @@ -5,7 +5,7 @@ /** * @group Plugins - * @description Builder class to create an instance of `LogEntryArchive__b`, used by the BigObject plugin + * @description Builder class to create an instance of `LogEntryArchive__b`, used by the Big Object plugin * @see LogEntryArchivePlugin * @see LogEntryEventBuilder */ diff --git a/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchivePlugin.cls b/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchivePlugin.cls index 8e70b2f8b..6a62f86c1 100644 --- a/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchivePlugin.cls +++ b/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchivePlugin.cls @@ -5,7 +5,7 @@ /** * @group Plugins - * @description Optional plugin that provides a BigObject, `LogEntryArchive__b`, as an alternative option + * @description Optional plugin that provides a Big Object, `LogEntryArchive__b`, as an alternative option * to the platform event `LogEntryEvent__e` * @see LoggerPlugin */ diff --git a/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchivePlugin_Tests.cls b/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchivePlugin_Tests.cls index 9f939c478..0187fa995 100644 --- a/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchivePlugin_Tests.cls +++ b/nebula-logger/plugins/big-object-archiving/plugin/classes/LogEntryArchivePlugin_Tests.cls @@ -34,11 +34,11 @@ private class LogEntryArchivePlugin_Tests { createPluginConfiguration(); LogBatchPurger batchPurger = new LogBatchPurger(); Log__c log = [SELECT Id, (SELECT Id FROM LogEntries__r) FROM Log__c WHERE LogPurgeAction__c = :LogEntryArchivePlugin.BIG_OBJECT_LOG_PURGE_ACTION]; - Test.startTest(); + System.Test.startTest(); Database.executeBatch(batchPurger); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(log.LogEntries__r.size(), LogEntryArchivePlugin.LOG_ENTRY_ARCHIVES_TO_SAVE.size()); List existingLogs = [SELECT Id FROM Log__c WHERE LogPurgeAction__c = :LogEntryArchivePlugin.BIG_OBJECT_LOG_PURGE_ACTION]; System.assertEquals(0, existingLogs.size()); @@ -66,11 +66,11 @@ private class LogEntryArchivePlugin_Tests { logToSkip.LogEntries__r.isEmpty(), 'Test has started under the wrong condiations - log record should have some related log entries' ); - Test.startTest(); + System.Test.startTest(); Database.executeBatch(batchPurger); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals( logToArchive.LogEntries__r.size(), LogEntryArchivePlugin.LOG_ENTRY_ARCHIVES_TO_SAVE.size(), @@ -98,12 +98,12 @@ private class LogEntryArchivePlugin_Tests { logEntryTags.add(new LogEntryTag__c(LogEntry__c = logEntry.Id, Tag__c = tag.Id)); } insert logEntryTags; - Test.startTest(); + System.Test.startTest(); Database.executeBatch(batchPurger); System.assertEquals(0, Limits.getPublishImmediateDml()); - Test.stopTest(); + System.Test.stopTest(); System.assertEquals(0, Limits.getPublishImmediateDml()); System.assertEquals(logToArchive.LogEntries__r.size(), LogEntryArchivePlugin.LOG_ENTRY_ARCHIVES_TO_SAVE.size()); for (LogEntryArchive__b logEntryArchive : LogEntryArchivePlugin.LOG_ENTRY_ARCHIVES_TO_SAVE) { @@ -198,7 +198,7 @@ private class LogEntryArchivePlugin_Tests { Logger.getUserSettings().DefaultSaveMethod__c = LogEntryArchivePlugin.BIG_OBJECT_QUEUEABLE_LOGGER_SAVE_METHOD; createPluginConfiguration(); Logger.info('Testing big object creation').getLogEntryEvent(); - Test.startTest(); + System.Test.startTest(); System.assertEquals(0, Limits.getAsyncCalls(), 'Should not have executed any queueable jobs'); Logger.saveLog(); @@ -216,7 +216,7 @@ private class LogEntryArchivePlugin_Tests { LogEntryArchivePlugin.lastSaveMethodUsed, 'Last save method used should have been set to BIG_OBJECT_QUEUEABLE' ); - Test.stopTest(); + System.Test.stopTest(); } private static void createParameterConfigurations() { diff --git a/nebula-logger/plugins/big-object-archiving/plugin/customMetadata/LoggerPlugin.LogEntryArchive.md-meta.xml b/nebula-logger/plugins/big-object-archiving/plugin/customMetadata/LoggerPlugin.LogEntryArchive.md-meta.xml index c541e6dc4..b311f1326 100644 --- a/nebula-logger/plugins/big-object-archiving/plugin/customMetadata/LoggerPlugin.LogEntryArchive.md-meta.xml +++ b/nebula-logger/plugins/big-object-archiving/plugin/customMetadata/LoggerPlugin.LogEntryArchive.md-meta.xml @@ -20,7 +20,7 @@ Description__c - Adds the ability to log directly to the BigObject LogEntryArchive__b + Adds the ability to log directly to the Big Object LogEntryArchive__b IsEnabled__c diff --git a/nebula-logger/plugins/big-object-archiving/plugin/permissionsets/LoggerLogEntryArchiveAdmin.permissionset-meta.xml b/nebula-logger/plugins/big-object-archiving/plugin/permissionsets/LoggerLogEntryArchiveAdmin.permissionset-meta.xml index 1cc2bb531..b4d8482a1 100644 --- a/nebula-logger/plugins/big-object-archiving/plugin/permissionsets/LoggerLogEntryArchiveAdmin.permissionset-meta.xml +++ b/nebula-logger/plugins/big-object-archiving/plugin/permissionsets/LoggerLogEntryArchiveAdmin.permissionset-meta.xml @@ -1,6 +1,6 @@ - Provides admin access to the BigObject LogEntryEventArchive__b, included with the BigObject plugin for Nebula Logger + Provides admin access to the metadata included in the Big Object plugin for Nebula Logger true LogEntryArchive__b.ApiReleaseNumber__c diff --git a/nebula-logger/plugins/log-retention-rules/README.md b/nebula-logger/plugins/log-retention-rules/README.md index a7d0c0817..3e1dc95fe 100644 --- a/nebula-logger/plugins/log-retention-rules/README.md +++ b/nebula-logger/plugins/log-retention-rules/README.md @@ -2,7 +2,8 @@ > :information_source: This plugin requires `v4.7.1` or newer of Nebula Logger's unlocked package -[![Install Unlocked Package Plugin](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgGQAQ) +[![Install Unlocked Package Plugin in a Sandbox](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgGQAQ) +[![Install Unlocked Package Plugin in Production](../.images/btn-install-unlocked-package-plugin-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgGQAQ) Adds the ability to create & deploy advanced, configurable rules for setting the retention date of `Log__c` records, using custom metadata types `LogRetentionRule__mdt` and `LogRetentionRuleCondition__mdt`. @@ -30,7 +31,7 @@ This plugin is currently in beta and cannot be installed in production - however After installing the plugin, you can add rules using the custom metadata types `LogRetentionRule__mdt` and `LogRetentionRuleCondition__mdt`. Multiple rules can be configured in your orgs, as shown below: -![Log Retention Rules plugin: Example Rule](./content/example-log-retention-rules-list-view.png) +![Log Retention Rules plugin: Example Rule](./.images/example-log-retention-rules-list-view.png) In this example rule, for every inserted `LogEntry__c` record, 2 conditions are checked: @@ -39,4 +40,4 @@ In this example rule, for every inserted `LogEntry__c` record, 2 conditions are If any `LogEntry__c` record is inserted that meets these 2 conditions, then the parent `Log__c` record will have the field `LogRetentionDate__c` set to `System.today() + 30`. -![Log Retention Rules plugin: Example Rule](./content/example-log-retention-rule-with-conditions.png) +![Log Retention Rules plugin: Example Rule](./.images/example-log-retention-rule-with-conditions.png) diff --git a/nebula-logger/plugins/log-retention-rules/plugin/classes/LogRetentionRulesPlugin_Tests.cls b/nebula-logger/plugins/log-retention-rules/plugin/classes/LogRetentionRulesPlugin_Tests.cls index d40c190ad..f8c1fef0c 100644 --- a/nebula-logger/plugins/log-retention-rules/plugin/classes/LogRetentionRulesPlugin_Tests.cls +++ b/nebula-logger/plugins/log-retention-rules/plugin/classes/LogRetentionRulesPlugin_Tests.cls @@ -25,7 +25,7 @@ private class LogRetentionRulesPlugin_Tests { LogRetentionRulesPlugin.setMockRetentionRuleConditions(rule, conditions); Log__c log = new Log__c(TransactionId__c = '1234'); insert log; - Test.setCreatedDate(log.Id, now.addDays(-1)); + System.Test.setCreatedDate(log.Id, now.addDays(-1)); log = [SELECT Id, LogRetentionDate__c FROM Log__c WHERE Id = :log.Id]; System.assertEquals(originalLogRetentionDate, log.LogRetentionDate__c); @@ -54,7 +54,7 @@ private class LogRetentionRulesPlugin_Tests { Log__c log = new Log__c(TransactionId__c = '1234'); insert log; - Test.setCreatedDate(log.Id, now); + System.Test.setCreatedDate(log.Id, now); log = [SELECT Id, LogRetentionDate__c FROM Log__c WHERE Id = :log.Id]; System.assertEquals(originalLogRetentionDate, log.LogRetentionDate__c); diff --git a/nebula-logger/plugins/logger-admin-dashboard/README.md b/nebula-logger/plugins/logger-admin-dashboard/README.md index c463c7c88..92893dd77 100644 --- a/nebula-logger/plugins/logger-admin-dashboard/README.md +++ b/nebula-logger/plugins/logger-admin-dashboard/README.md @@ -2,7 +2,8 @@ > :information_source: This plugin requires `v4.6.12` or newer of Nebula Logger's unlocked package -[![Install Unlocked Package Plugin](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l3yQAA) +[![Install Unlocked Package Plugin in a Sandbox](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l3yQAA) +[![Install Unlocked Package Plugin in Production](../.images/btn-install-unlocked-package-plugin-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l3yQAA) To help monitor logs in your org, this plugin includes a new Logger Admin dynamic dashboard, as well as several new reports. The dashboard displays several report charts to quickly see summary info about your logs. It supports filtering on: @@ -10,4 +11,4 @@ To help monitor logs in your org, this plugin includes a new Logger Admin dynami - Logging Level: based on `LogEntry__c.LoggingLevel__c` - Origin Type: based on `LogEntry__c.OriginType__c` -![Logger Admin Dashboard](./images/logger-admin-dashboard.png) +![Logger Admin Dashboard](./.images/logger-admin-dashboard.png) diff --git a/nebula-logger/plugins/slack/README.md b/nebula-logger/plugins/slack/README.md index 07fdb637f..ea29601d7 100644 --- a/nebula-logger/plugins/slack/README.md +++ b/nebula-logger/plugins/slack/README.md @@ -2,11 +2,12 @@ > :information_source: This plugin requires `v4.7.1` or newer of Nebula Logger's unlocked package -[![Install Unlocked Package](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgQQAQ) +[![Install Unlocked Package Plugin in a Sandbox](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgQQAQ) +[![Install Unlocked Package Plugin in Production](../.images/btn-install-unlocked-package-plugin-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgQQAQ) Adds a Slack integration for the unlocked package edition of Nebula Logger. Any logs with log entries that meet a certain (configurable) logging level will automatically be posted to your Slack channel via an asynchronous `Queueable` job. -![Slack plugin: notification](./images/slack-plugin-notification.png) +![Slack plugin: notification](./.images/slack-plugin-notification.png) --- @@ -48,4 +49,4 @@ Check out [Slack's webhooks documentation](https://api.slack.com/messaging/webho The Slack integration should now be setup & working - any new logs that meet the specified notification logging level (step 6 above) will send a Slack notification. -![Slack plugin: parameters](./images/slack-plugin-parameters.png) +![Slack plugin: parameters](./.images/slack-plugin-parameters.png) diff --git a/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin.cls b/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin.cls index 5fc0dc945..64b7ca3ad 100644 --- a/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin.cls +++ b/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin.cls @@ -55,7 +55,6 @@ public without sharing class SlackLoggerPlugin implements LoggerPlugin.Triggerab * @description Handles the queuable execute logic. Required by the Queueable interface. * @param queueableContext Context of the current queuable instance. */ - @SuppressWarnings('PMD.AvoidDebugStatements') public void execute(System.QueueableContext queueableContext) { // Since this runs in an async context, requery the logs just in case any field values have changed this.requeryLogs(); diff --git a/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin_Tests.cls b/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin_Tests.cls index 555548494..9fa3e5cc1 100644 --- a/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin_Tests.cls +++ b/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin_Tests.cls @@ -28,9 +28,9 @@ private class SlackLoggerPlugin_Tests { System.assertEquals(1, log.LogEntries__r.size(), 'Log entries size was not equal to 1.'); System.assertEquals(false, log.SendSlackNotification__c, 'SendSlackNotification was incorrectly set to true.'); System.assertEquals(null, log.SlackNotificationDate__c, 'SlackNotificationDate was not null.'); - Test.startTest(); + System.Test.startTest(); LoggerMockDataCreator.MockHttpCallout calloutMock = LoggerMockDataCreator.createHttpCallout().setStatusCode(200); - Test.setMock(HttpCalloutMock.class, calloutMock); + System.Test.setMock(HttpCalloutMock.class, calloutMock); // Load the mock configurations - the plugin framework won't load actual CMDT records during tests LoggingLevel slackLoggingLevel = LoggingLevel.ERROR; System.assert(logEntryLoggingLevel.ordinal() < slackLoggingLevel.ordinal(), 'Slack logging level ordinal was incorrect.'); @@ -45,7 +45,7 @@ private class SlackLoggerPlugin_Tests { // Verify that the internal queueable job has been enqueued System.assertEquals(0, Limits.getAsyncCalls(), 'The queueable job should not have been enqueued'); // Stop the test so the internal queueable job runs - Test.stopTest(); + System.Test.stopTest(); log = queryLogs(logEntryLoggingLevel).get(0); System.assertEquals(1, log.LogEntries__r.size(), 'Log entries size was not equal to 1.'); System.assertEquals(false, log.SendSlackNotification__c, 'SendSlackNotification incorrectly set to true.'); @@ -75,9 +75,9 @@ private class SlackLoggerPlugin_Tests { System.assertEquals(1, log.LogEntries__r.size(), 'Log entries did not match the expected count of 1.'); System.assertEquals(false, log.SendSlackNotification__c, 'SendSlackNotification was incorrectly set to true.'); System.assertEquals(null, log.SlackNotificationDate__c, 'SlackNotificationDate was not null.'); - Test.startTest(); + System.Test.startTest(); LoggerMockDataCreator.MockHttpCallout calloutMock = LoggerMockDataCreator.createHttpCallout().setStatusCode(200); - Test.setMock(HttpCalloutMock.class, calloutMock); + System.Test.setMock(HttpCalloutMock.class, calloutMock); // Load the mock configurations - the plugin framework won't load actual CMDT records during tests mockConfigurations(logEntryLoggingLevel); System.assert( @@ -93,7 +93,7 @@ private class SlackLoggerPlugin_Tests { // Verify that the internal queueable job has been enqueued System.assertEquals(1, Limits.getAsyncCalls(), 'The queueable job should have been enqueued'); // Stop the test so the internal queueable job runs - Test.stopTest(); + System.Test.stopTest(); log = [SELECT Id, MaxLogEntryLoggingLevelOrdinal__c, SendSlackNotification__c, SlackNotificationDate__c FROM Log__c]; System.assertEquals(true, log.SendSlackNotification__c, 'SendSlackNotification was incorrectly set to false.'); System.assertNotEquals(null, log.SlackNotificationDate__c, 'SlackNotificationDate was null.'); @@ -123,9 +123,9 @@ private class SlackLoggerPlugin_Tests { System.assertEquals(1, log.LogEntries__r.size(), 'Log entries did not match the expected count of 1.'); System.assertEquals(false, log.SendSlackNotification__c, 'SendSlackNotification was incorrectly set to true.'); System.assertEquals(null, log.SlackNotificationDate__c, 'SlackNotificationDate was not null.'); - Test.startTest(); + System.Test.startTest(); LoggerMockDataCreator.MockHttpCallout calloutMock = LoggerMockDataCreator.createHttpCallout().setStatusCode(200); - Test.setMock(HttpCalloutMock.class, calloutMock); + System.Test.setMock(HttpCalloutMock.class, calloutMock); // Load the mock configurations - the plugin framework won't load actual CMDT records during tests mockConfigurations(logEntryLoggingLevel); System.assert( @@ -141,7 +141,7 @@ private class SlackLoggerPlugin_Tests { // Verify that the internal queueable job has been enqueued System.assertEquals(1, Limits.getAsyncCalls(), 'The queueable job should have been enqueued'); // Stop the test so the internal queueable job runs - Test.stopTest(); + System.Test.stopTest(); log = [SELECT Id, MaxLogEntryLoggingLevelOrdinal__c, SendSlackNotification__c, SlackNotificationDate__c FROM Log__c]; System.assertEquals(true, log.SendSlackNotification__c, 'SendSlackNotification was incorrectly set to false.'); System.assertNotEquals(null, log.SlackNotificationDate__c, 'SlackNotificationDate was null.'); @@ -171,9 +171,9 @@ private class SlackLoggerPlugin_Tests { System.assertEquals(1, log.LogEntries__r.size(), 'Log entries did not match the expected count of 1.'); System.assertEquals(false, log.SendSlackNotification__c, 'SendSlackNotification was incorrectly set to true.'); System.assertEquals(null, log.SlackNotificationDate__c, 'SlackNotificationDate was not null.'); - Test.startTest(); + System.Test.startTest(); LoggerMockDataCreator.MockHttpCallout calloutMock = LoggerMockDataCreator.createHttpCallout().setStatusCode(200); - Test.setMock(HttpCalloutMock.class, calloutMock); + System.Test.setMock(HttpCalloutMock.class, calloutMock); // Load the mock configurations - the plugin framework won't load actual CMDT records during tests mockConfigurations(logEntryLoggingLevel); System.assert( @@ -189,7 +189,7 @@ private class SlackLoggerPlugin_Tests { // Verify that the internal queueable job has been enqueued System.assertEquals(1, Limits.getAsyncCalls(), 'The queueable job should have been enqueued'); // Stop the test so the internal queueable job runs - Test.stopTest(); + System.Test.stopTest(); log = [SELECT Id, MaxLogEntryLoggingLevelOrdinal__c, SendSlackNotification__c, SlackNotificationDate__c FROM Log__c]; System.assertEquals(true, log.SendSlackNotification__c, 'SendSlackNotification was incorrectly set to false.'); System.assertNotEquals(null, log.SlackNotificationDate__c, 'SlackNotificationDate was null.'); diff --git a/package-lock.json b/package-lock.json index 048973be6..357f6351f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nebula-logger", - "version": "4.7.1", + "version": "4.7.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -7101,8 +7101,7 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "3.2.1", @@ -7359,8 +7358,7 @@ "async": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", - "dev": true + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" }, "async-hook-jl": { "version": "1.7.6", @@ -9389,12 +9387,11 @@ } }, "ejs": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.6.tgz", - "integrity": "sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw==", - "dev": true, + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.7.tgz", + "integrity": "sha512-BIar7R6abbUxDA3bfXrO4DSgwo8I+fB5/1zgujl3HLLjwd6+9iOnrT+t3grn2qbk9vOgBubXOFwX2m9axoFaGw==", "requires": { - "jake": "^10.6.1" + "jake": "^10.8.5" } }, "electron-to-chromium": { @@ -10624,12 +10621,29 @@ "dev": true }, "filelist": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz", - "integrity": "sha512-z7O0IS8Plc39rTCq6i6iHxk43duYOn8uFJiWSewIq0Bww1RNybVHSCjahmcC87ZqAm4OTvFzlzeGu3XAzG1ctQ==", - "dev": true, + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.3.tgz", + "integrity": "sha512-LwjCsruLWQULGYKy7TX0OPtrL9kLpojOFKc5VCTxdFTV7w5zbsgqVKfnkKG7Qgjtq50gKfO56hJv88OfcGb70Q==", "requires": { - "minimatch": "^3.0.4" + "minimatch": "^5.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "filesize": { @@ -11072,7 +11086,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -11993,8 +12006,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fullwidth-code-point": { "version": "3.0.0", @@ -12012,7 +12024,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -12337,12 +12348,11 @@ } }, "jake": { - "version": "10.8.4", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.4.tgz", - "integrity": "sha512-MtWeTkl1qGsWUtbl/Jsca/8xSoK3x0UmS82sNbjqxxG/de/M/3b1DntdjHgPMC50enlTNwXOCRqPXLLt5cCfZA==", - "dev": true, + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", "requires": { - "async": "0.9.x", + "async": "^3.2.3", "chalk": "^4.0.2", "filelist": "^1.0.1", "minimatch": "^3.0.4" @@ -12352,22 +12362,14 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } }, - "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", - "dev": true - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -12377,7 +12379,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -12385,20 +12386,17 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -13924,8 +13922,7 @@ "json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "json-schema-traverse": { "version": "0.4.1", diff --git a/package.json b/package.json index 662b8009d..1addae3f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nebula-logger", - "version": "4.7.1", + "version": "4.7.2", "description": "Designed for Salesforce admins, developers & architects. A robust logger for Apex, Flow, Process Builder & Integrations.", "author": "Jonathan Gillespie", "license": "MIT", @@ -58,10 +58,11 @@ "permset:assign:admin": "sfdx force:user:permset:assign --permsetname LoggerAdmin", "permset:assign:big-object-admin": "sfdx force:user:permset:assign --permsetname LoggerLogEntryArchiveAdmin", "permset:assign:slack-admin": "sfdx force:user:permset:assign --permsetname LoggerSlackPluginAdmin", - "plugin:version:create:big-object-archiving": "sfdx force:package:version:create --json --package \"Nebula Logger - Core Plugin - Big Object Archiving\" --codecoverage --installationkeybypass --wait 30", - "plugin:version:create:log-retention-rules": "sfdx force:package:version:create --json --package \"Nebula Logger - Core Plugin - Log Retention Rules\" --codecoverage --installationkeybypass --wait 30", - "plugin:version:create:logger-admin-dashboard": "sfdx force:package:version:create --json --package \"Nebula Logger - Core Plugin - Logger Admin Dashboard\" --codecoverage --installationkeybypass --wait 30", - "plugin:version:create:slack": "sfdx force:package:version:create --json --package \"Nebula Logger - Core Plugin - Slack\" --codecoverage --installationkeybypass --wait 30", + "plugin:version:create:async-failure-additions": "sfdx force:package:version:create --json --package \"Nebula Logger - Plugin - Async Failure Additions\" --codecoverage --installationkeybypass --wait 30", + "plugin:version:create:big-object": "sfdx force:package:version:create --json --package \"Nebula Logger - Plugin - Big Object Archiving\" --codecoverage --installationkeybypass --wait 30", + "plugin:version:create:log-retention-rules": "sfdx force:package:version:create --json --package \"Nebula Logger - Plugin - Log Retention Rules\" --codecoverage --installationkeybypass --wait 30", + "plugin:version:create:logger-admin-dashboard": "sfdx force:package:version:create --json --package \"Nebula Logger - Plugin - Logger Admin Dashboard\" --codecoverage --installationkeybypass --wait 30", + "plugin:version:create:slack": "sfdx force:package:version:create --json --package \"Nebula Logger - Plugin - Slack\" --codecoverage --installationkeybypass --wait 30", "prepare": "husky install && chmod +x ./.husky/pre-commit", "prettier:fix": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", "prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", @@ -79,7 +80,12 @@ "test:lwc": "sfdx-lwc-jest --coverage --skipApiVersionCheck --verbose" }, "dependencies": { + "ansi-regex": ">=5.0.1", + "async": ">=2.6.4", + "ejs": ">=3.1.7", "follow-redirects": ">=1.14.8", + "glob-parent": ">=5.1.2", + "json-schema": ">=0.4.0", "markdown-it": ">=12.3.2", "marked": ">=4.0.10", "nanoid": ">=3.1.31", diff --git a/sfdx-project.json b/sfdx-project.json index 1f150cf23..ee0878d52 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -7,12 +7,25 @@ "package": "Nebula Logger - Core", "path": "./nebula-logger/core", "definitionFile": "./config/scratch-orgs/base-scratch-def.json", - "versionNumber": "4.7.1.NEXT", - "versionName": "Plugin Framework Overhaul", - "versionDescription": "New approach implemented for plugins, providing more control within LoggerSObjectHandler, and the ability to create plugins for LogBatchPurger", + "versionNumber": "4.7.2.NEXT", + "versionName": "Parent Log Transaction ID Bugfix", + "versionDescription": "Fixes an issue that would prevent logs from saving if the specified parent log transaction ID could not be found", "releaseNotesUrl": "https://github.com/jongpie/NebulaLogger/releases", "default": true }, + { + "default": false, + "package": "Nebula Logger - Plugin - Async Failure Additions", + "path": "./nebula-logger/plugins/async-failure-additions/plugin", + "dependencies": [ + { + "package": "Nebula Logger - Core@4.7.2-1-parent-log-transaction-id-bugfix" + } + ], + "versionName": "Initial release with Finalizer and BatchApexErrorEvent functionality", + "versionNumber": "1.0.0.NEXT", + "versionDescription": "Adds the capability to get Logs created for unexpected Apex Batch class failures through LoggerParameter__mdt additions, and provides a Finalizer implementation for logging Queueable failures" + }, { "package": "Nebula Logger - Plugin - Big Object Archiving", "path": "./nebula-logger/plugins/big-object-archiving/plugin", @@ -62,7 +75,7 @@ ], "versionName": "Beta Release: Round 3", "versionNumber": "0.10.0.NEXT", - "versionDescription": "TODO", + "versionDescription": "Updated Slack plugin to work with Nebula Logger v4.7.1", "default": false }, { @@ -104,6 +117,9 @@ "Nebula Logger - Core@4.6.16-0-ui-cleanup": "04t5Y0000015lLzQAI", "Nebula Logger - Core@4.7.0-25-spring-'22-release": "04t5Y0000015lXSQAY", "Nebula Logger - Core@4.7.1-8-plugin-framework-overhaul": "04t5Y0000015lgBQAQ", + "Nebula Logger - Core@4.7.2-1-parent-log-transaction-id-bugfix": "04t5Y0000015lhdQAA", + "Nebula Logger - Plugin - Async Failure Additions": "0Ho5Y000000blO4SAI", + "Nebula Logger - Plugin - Async Failure Additions@1.0.0-3": "04t5Y0000015lhiQAA", "Nebula Logger - Plugin - Big Object Archiving": "0Ho5Y000000blMSSAY", "Nebula Logger - Plugin - Big Object Archiving@0.9.0-2": "04t5Y0000015lgLQAQ", "Nebula Logger - Plugin - Log Retention Rules": "0Ho5Y000000blNfSAI",