Skip to content

Commit

Permalink
Added an extra (nearly identical) test to validate that setRecord(Lis…
Browse files Browse the repository at this point in the history
…t<Id>) works as expected
  • Loading branch information
jongpie committed Nov 7, 2024
1 parent 7d87693 commit f36ccd2
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,26 @@ private class LogEntryEventBuilder_Tests {
System.Assert.areEqual(Schema.User.SObjectType.getDescribe().getName(), builder.getLogEntryEvent().RecordSObjectType__c);
}

@IsTest
static void it_should_set_record_fields_for_list_of_id_records_when_populated() {
LogEntryEventBuilder builder = new LogEntryEventBuilder(getUserSettings(), System.LoggingLevel.INFO, true);
System.Assert.isNull(builder.getLogEntryEvent().RecordId__c);
System.Assert.isNull(builder.getLogEntryEvent().RecordJson__c);
System.Assert.isNull(builder.getLogEntryEvent().RecordSObjectClassification__c);
System.Assert.isNull(builder.getLogEntryEvent().RecordSObjectType__c);
System.Assert.isNull(builder.getLogEntryEvent().RecordSObjectTypeNamespace__c);

List<Id> userIdList = new List<Id>(new Map<Id, Schema.User>([SELECT Id, Name, Username, IsActive FROM User LIMIT 5]).keySet());
builder.setRecord(userIdList);

System.Assert.areEqual(userIdList.size(), builder.getLogEntryEvent().RecordCollectionSize__c);
System.Assert.areEqual('List', builder.getLogEntryEvent().RecordCollectionType__c);
System.Assert.isNull(builder.getLogEntryEvent().RecordId__c);
System.Assert.isNotNull(builder.getLogEntryEvent().RecordJson__c);
System.Assert.areEqual('Unknown', builder.getLogEntryEvent().RecordSObjectClassification__c);
System.Assert.areEqual('Unknown', builder.getLogEntryEvent().RecordSObjectType__c);
}

@IsTest
static void it_should_set_record_fields_for_set_of_id_records_when_populated() {
LogEntryEventBuilder builder = new LogEntryEventBuilder(getUserSettings(), System.LoggingLevel.INFO, true);
Expand Down

0 comments on commit f36ccd2

Please sign in to comment.