Skip to main content
edited tags
Link
Will
  • 173
  • 1
  • 6
Source Link
Will
  • 173
  • 1
  • 6

System.debug() not appearing in batch test

I am running a test on a batchable class.

@isTest

public class BatchSkillExcalationUpdaterTest {
    static testMethod void ValidateUpdates() {
        
        ...
        EscalationSkillUpdater SkillBatch = new EscalationSkillUpdater();    
        system.debug(logginglevel.FINEST, 'BATCHING...');
        Database.executeBatch(SkillBatch);
        system.debug(logginglevel.FINEST, 'FINISHED BATCHING.');
        ...
    }
}

The class I am testing:

global class EscalationSkillUpdater implements Database.Batchable <sObject> {
    global Database.QueryLocator start (Database.BatchableContext BC) {
        ...        
        return Database.getQueryLocator(query);
    }
    
    global void execute (Database.BatchableContext BC, list<SkillEscalationChangeRecord__c> Data) {
        ...
        System.debug(logginglevel.FINEST, 'FLAG');
        update Data;
    }
    
    global void finish (Database.BatchableContext BC) {}
}

However, the Debug message in the execute() method is not showing up:

enter image description here

The 'FLAG' from the batchable class is not showing up. Why is this? Is there another way to "print" values to examine?