OrgReady

Salesforce Skills & Readiness

Back to Practice
Testing & DevOpsDebuggingHard

Interview Challenge

Repair a Brittle Apex Unit Test

Review an Apex unit test that depends on organization data and makes no meaningful assertion.

You can explore this challenge without signing in.

Read the problem, review the starter code and try your solution. Sign in when you're ready to submit and save your progress.

Challenge

Version 1

Inspect the evidence

Artifact / implementation

Review the supplied code, configuration or trace before proposing a fix.

@IsTest(SeeAllData=true)
private class AccountServiceTest {
    @IsTest
    static void testUpdateAccounts() {
        Account acc = [SELECT Id, Description FROM Account LIMIT 1];

        AccountService.process(acc.Id);

        System.assert(true);
    }
}

Response workspace

Identify the issue, explain why it is a problem, and describe the fix. Include both your analysis and corrected solution below.

0 analysis characters

0 solution characters