From f45c7e61b2757d8e4cb1e8292782b6152bdfe34b Mon Sep 17 00:00:00 2001 From: Jeronimo Date: Mon, 18 Dec 2023 19:04:03 +0100 Subject: [PATCH 1/3] Update CollectionProcessorsUtils.cls TestVisible for method --- .../main/default/classes/CollectionProcessorsUtils.cls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls b/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls index 8010d2040..f413a0746 100644 --- a/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls +++ b/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls @@ -68,6 +68,7 @@ public with sharing class CollectionProcessorsUtils { } //Workaround to get local month name to month number map + @TestVisible private static Map getLocalMonthNumbers() { Datetime dt = Datetime.newInstance(2020, 1, 1); @@ -79,4 +80,4 @@ public with sharing class CollectionProcessorsUtils { return resultMap; } -} \ No newline at end of file +} From da40ae4321c89ee001e6065b87f52ec1f5dc6be4 Mon Sep 17 00:00:00 2001 From: Jeronimo Date: Mon, 18 Dec 2023 19:34:11 +0100 Subject: [PATCH 2/3] Update CollectionProcessorsUtils.cls Fixed getLocalMonthNumbers. It's was not WAD after adding unit tests. --- .../main/default/classes/CollectionProcessorsUtils.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls b/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls index f413a0746..0ae3540b1 100644 --- a/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls +++ b/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls @@ -70,10 +70,10 @@ public with sharing class CollectionProcessorsUtils { //Workaround to get local month name to month number map @TestVisible private static Map getLocalMonthNumbers() { - Datetime dt = Datetime.newInstance(2020, 1, 1); + Datetime dt = Datetime.newInstance(2020, 1, 15); Map resultMap = new Map(); - for (Integer i = 1; i < 12; i++) { + for (Integer i = 1; i < 13; i++) { resultMap.put(dt.format('MMMM').toLowerCase(), String.valueOf(i)); dt = dt.addMonths(1); } From f1f6f6cff5bdfaebd7ed3fb2a318632f5372dad8 Mon Sep 17 00:00:00 2001 From: Jeronimo Date: Mon, 18 Dec 2023 20:34:12 +0100 Subject: [PATCH 3/3] Update CollectionProcessorsUtils.cls Fixed logic --- .../main/default/classes/CollectionProcessorsUtils.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls b/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls index 0ae3540b1..a9920d0bc 100644 --- a/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls +++ b/flow_action_components/CollectionProcessors/force-app/main/default/classes/CollectionProcessorsUtils.cls @@ -38,7 +38,7 @@ public with sharing class CollectionProcessorsUtils { if (fieldType == 'datetime' || fieldType == 'date') { //Datetime is already formatted - if (fieldValue.contains('t') && fieldValue.contains('z') && fieldValue.indexOf('t') == 11) { + if (fieldValue.containsIgnoreCase('t') && fieldValue.containsIgnoreCase('z') && fieldValue.indexOfIgnoreCase('t') == 10) { return fieldValue; } Map localMonthNumbers = getLocalMonthNumbers();