Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYNCHRONOUS_DML in a test context - Integration test #457

Open
jongpie opened this issue Feb 23, 2023 Discussed in #454 · 0 comments
Open

SYNCHRONOUS_DML in a test context - Integration test #457

jongpie opened this issue Feb 23, 2023 Discussed in #454 · 0 comments
Assignees
Labels
apex Items related to using Logger within Apex bug Something isn't working configurations Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type log management Items related to the custom objects & Logger Console app tests Relates to Apex or LWC jest tests

Comments

@jongpie
Copy link
Owner

jongpie commented Feb 23, 2023

Discussed in #454

Originally posted by JeroenSfdc February 22, 2023
If I'd like to do an integration test with SYNCHRONOUS_DML it fails (where it succeeds with EVENT_BUS).
I tried to get my head around this... This is using the managed package v4.8 v4.9. @jongpie

    @IsTest
    static void testNebula_SyncDML() {
        Nebula.Logger.error('Some random error');

        Test.startTest();
        Nebula.Logger.saveLog(Nebula.Logger.SaveMethod.SYNCHRONOUS_DML);
        Test.stopTest();

        Assert.areEqual(1, [SELECT Id FROM Nebula__Log__c].size());
        Assert.areEqual(1, [SELECT Id FROM Nebula__LogEntry__c].size());
    }
@jongpie jongpie added bug Something isn't working apex Items related to using Logger within Apex configurations Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type log management Items related to the custom objects & Logger Console app tests Relates to Apex or LWC jest tests labels Feb 23, 2023
@jongpie jongpie self-assigned this Feb 23, 2023
@jongpie jongpie removed this from the Version 4.12.0: Winter '24 Release milestone Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apex Items related to using Logger within Apex bug Something isn't working configurations Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type log management Items related to the custom objects & Logger Console app tests Relates to Apex or LWC jest tests
Projects
None yet
Development

No branches or pull requests

1 participant