@@ -14,7 +14,7 @@ public class ConvNoteCacheFilterHelperTest {
14
14
);
15
15
16
16
List <Conversation_Note__c > convNotes = [
17
- SELECT Id , LastModifiedById
17
+ SELECT Id , LastModifiedById , STO_Sensitive_Information__c
18
18
FROM Conversation_Note__c
19
19
WHERE CRM_Henvendelse_BehandlingskjedeId__c = ' 123'
20
20
];
@@ -62,7 +62,7 @@ public class ConvNoteCacheFilterHelperTest {
62
62
}
63
63
64
64
List <Conversation_Note__c > convNotes = [
65
- SELECT Id , LastModifiedById
65
+ SELECT Id , LastModifiedById , STO_Sensitive_Information__c
66
66
FROM Conversation_Note__c
67
67
WHERE CRM_Henvendelse_BehandlingskjedeId__c = ' 789'
68
68
];
@@ -78,7 +78,7 @@ public class ConvNoteCacheFilterHelperTest {
78
78
}
79
79
80
80
@IsTest
81
- static void shouldReturnOneRecordIdForConvNoteUpdatedByModiaIntegrationUser () {
81
+ static void shoulNotForConvNoteUpdatedByModiaIntegrationUserAndSensitiveInformationIsFalse () {
82
82
myTriggers .disable (ConvNoteCacheHandler .class );
83
83
84
84
Id profileId = [
@@ -108,7 +108,54 @@ public class ConvNoteCacheFilterHelperTest {
108
108
}
109
109
110
110
List <Conversation_Note__c > convNotes = [
111
- SELECT Id , LastModifiedById
111
+ SELECT Id , LastModifiedById , STO_Sensitive_Information__c
112
+ FROM Conversation_Note__c
113
+ WHERE CRM_Henvendelse_BehandlingskjedeId__c = ' 789'
114
+ ];
115
+
116
+ Test .startTest ();
117
+ Set <Id > result = ConvNoteCacheFilterHelper .getRecordIdsRequiringCacheClear (
118
+ convNotes ,
119
+ true // record is updated
120
+ );
121
+ Test .stopTest ();
122
+
123
+ Assert .areEqual (0 , result .size ());
124
+ }
125
+
126
+ @IsTest
127
+ static void shouldReturnOneRecordIdForConvNoteUpdatedByModiaIntegrationUserAndSensitiveInformationIsTrue () {
128
+ myTriggers .disable (ConvNoteCacheHandler .class );
129
+
130
+ Id profileId = [
131
+ SELECT Id
132
+ FROM Profile
133
+ WHERE Name = ' System Administrator'
134
+ LIMIT 1
135
+ ]
136
+ .Id ;
137
+ User modiaIntegrationUser = (User ) SharedTestDataFactory .createRecord (
138
+ new User (
139
+
140
+ ProfileId = profileId
141
+ )
142
+ );
143
+
144
+ Account personAccount = SharedTestDataFactory .createPersonAccount ();
145
+
146
+ System .runAs (modiaIntegrationUser ) {
147
+ SharedTestDataFactory .createRecord (
148
+ new Conversation_Note__c (
149
+ CRM_Account__c = personAccount .Id ,
150
+ CRM_Conversation_Note__c = ' DUMMY TEXT' ,
151
+ CRM_Henvendelse_BehandlingskjedeId__c = ' 789' ,
152
+ STO_Sensitive_Information__c = true
153
+ )
154
+ );
155
+ }
156
+
157
+ List <Conversation_Note__c > convNotes = [
158
+ SELECT Id , LastModifiedById , STO_Sensitive_Information__c
112
159
FROM Conversation_Note__c
113
160
WHERE CRM_Henvendelse_BehandlingskjedeId__c = ' 789'
114
161
];
0 commit comments