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

Resolve #124 - Improve testmethod finalizerThatInvokesDmlShouldCauseException #125

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@IsTest(isParallel=true)
@SuppressWarnings('PMD.ApexDoc, PMD.ApexUnitTestClassShouldHaveRunAs')
private with sharing class FinalizerHandlerTest {
private static final String ACCOUNT = 'Account';
private static final String BAR = 'bar';
private static final String BOGUS_CLASS_NAME = 'Bogus';
private static final String BYPASS_PERMISSION = 'Bogus_Bypass_Permission';
Expand All @@ -30,9 +29,6 @@ private with sharing class FinalizerHandlerTest {
private static final String TEST_FINALIZER_WITH_DML = 'FinalizerHandlerTest.FinalizerWithDml';
private static final String TEST_FOO_FINALIZER = 'FinalizerHandlerTest.FooFinalizer';

private static final Schema.SObjectType SOBJECT_TYPE = Schema.Account.SObjectType;
private static final System.TriggerOperation OPERATION = System.TriggerOperation.BEFORE_INSERT;

private static List<String> finalizerLedger = new List<String>();

private static FinalizerHandler handler = new FinalizerHandler();
Expand Down Expand Up @@ -304,9 +300,7 @@ private with sharing class FinalizerHandlerTest {

public class FinalizerWithDml implements TriggerAction.DmlFinalizer {
public void execute(FinalizerHandler.Context context) {
TriggerBase.bypass(Account.class.getName());
insert new Account(Name = 'Acme');
TriggerBase.clearBypass(Account.class.getName());
EventBus.publish(new ProcessExceptionEvent());
}
}
}
Loading