diff --git a/force-app/main/default/classes/DataBuilder.cls b/force-app/main/default/classes/DataBuilder.cls index eaee3c9..9605b63 100644 --- a/force-app/main/default/classes/DataBuilder.cls +++ b/force-app/main/default/classes/DataBuilder.cls @@ -81,7 +81,10 @@ public with sharing class DataBuilder { structure.put('environment', environment); structure.put('framework', 'apex'); structure.put('body', body); - structure.put('custom', custom); + + if (custom != null) { + structure.put('custom', custom); + } return structure; } diff --git a/force-app/main/default/tests/DataBuilderTest.cls b/force-app/main/default/tests/DataBuilderTest.cls index cdd94eb..f071b54 100644 --- a/force-app/main/default/tests/DataBuilderTest.cls +++ b/force-app/main/default/tests/DataBuilderTest.cls @@ -11,6 +11,8 @@ public class DataBuilderTest Map data = (Map)result.get('data'); + System.assertEquals(data.containsKey('custom'), false); + Map notifierMap = (Map)data.get('notifier'); System.assertEquals(Notifier.NAME, (String)notifierMap.get('name')); @@ -87,6 +89,8 @@ public class DataBuilderTest Map data = (Map)result.get('data'); + System.assertEquals(data.containsKey('custom'), false); + Map notifierMap = (Map)data.get('notifier'); System.assertEquals(Notifier.NAME, (String)notifierMap.get('name')); System.assertEquals(Notifier.VERSION, (String)notifierMap.get('version'));