@@ -13,22 +13,25 @@ public class ConvNoteCacheFilterHelperTest {
13
13
)
14
14
);
15
15
16
- List < Conversation_Note__c > convNotes = [
16
+ Conversation_Note__c convNote = [
17
17
SELECT Id , LastModifiedById , STO_Sensitive_Information__c
18
18
FROM Conversation_Note__c
19
19
WHERE CRM_Henvendelse_BehandlingskjedeId__c = ' 123'
20
+ LIMIT 1
20
21
];
21
22
23
+ HenvendelseUpdateWrapper wrapper = new HenvendelseUpdateWrapper ();
24
+ wrapper .convNote = convNote ;
25
+
22
26
Test .startTest ();
23
27
Set <Id > result = ConvNoteCacheFilterHelper .getRecordIdsRequiringCacheClear (
24
- convNotes ,
25
- false // record is created
28
+ new List <HenvendelseUpdateWrapper >{ wrapper }
26
29
);
27
30
Test .stopTest ();
28
31
29
32
Assert .areEqual (1 , result .size ());
30
33
Id actualRecordId = new List <Id >(result )[0 ];
31
- Assert .areEqual (convNotes [ 0 ] .Id , actualRecordId );
34
+ Assert .areEqual (convNote .Id , actualRecordId );
32
35
}
33
36
34
37
@IsTest
@@ -61,16 +64,19 @@ public class ConvNoteCacheFilterHelperTest {
61
64
);
62
65
}
63
66
64
- List < Conversation_Note__c > convNotes = [
67
+ Conversation_Note__c convNote = [
65
68
SELECT Id , LastModifiedById , STO_Sensitive_Information__c
66
69
FROM Conversation_Note__c
67
70
WHERE CRM_Henvendelse_BehandlingskjedeId__c = ' 789'
71
+ LIMIT 1
68
72
];
69
73
74
+ HenvendelseUpdateWrapper wrapper = new HenvendelseUpdateWrapper ();
75
+ wrapper .convNote = convNote ;
76
+
70
77
Test .startTest ();
71
78
Set <Id > result = ConvNoteCacheFilterHelper .getRecordIdsRequiringCacheClear (
72
- convNotes ,
73
- false // record is created
79
+ new List <HenvendelseUpdateWrapper >{ wrapper }
74
80
);
75
81
Test .stopTest ();
76
82
@@ -107,24 +113,27 @@ public class ConvNoteCacheFilterHelperTest {
107
113
);
108
114
}
109
115
110
- List < Conversation_Note__c > convNotes = [
116
+ Conversation_Note__c convNote = [
111
117
SELECT Id , LastModifiedById , STO_Sensitive_Information__c
112
118
FROM Conversation_Note__c
113
119
WHERE CRM_Henvendelse_BehandlingskjedeId__c = ' 789'
120
+ LIMIT 1
114
121
];
115
122
123
+ HenvendelseUpdateWrapper wrapper = new HenvendelseUpdateWrapper ();
124
+ wrapper .convNote = convNote ;
125
+
116
126
Test .startTest ();
117
127
Set <Id > result = ConvNoteCacheFilterHelper .getRecordIdsRequiringCacheClear (
118
- convNotes ,
119
- true // record is updated
128
+ new List <HenvendelseUpdateWrapper >{ wrapper }
120
129
);
121
130
Test .stopTest ();
122
131
123
132
Assert .areEqual (0 , result .size ());
124
133
}
125
134
126
135
@IsTest
127
- static void shouldReturnOneRecordIdForConvNoteUpdatedByModiaIntegrationUserAndSensitiveInformationIsTrue () {
136
+ static void shouldReturnOneRecordIdForRedactionReuestdByModiaIntegrationUser () {
128
137
myTriggers .disable (ConvNoteCacheHandler .class );
129
138
130
139
Id profileId = [
@@ -154,16 +163,20 @@ public class ConvNoteCacheFilterHelperTest {
154
163
);
155
164
}
156
165
157
- List < Conversation_Note__c > convNotes = [
166
+ Conversation_Note__c convNote = [
158
167
SELECT Id , LastModifiedById , STO_Sensitive_Information__c
159
168
FROM Conversation_Note__c
160
169
WHERE CRM_Henvendelse_BehandlingskjedeId__c = ' 789'
170
+ LIMIT 1
161
171
];
162
172
173
+ HenvendelseUpdateWrapper wrapper = new HenvendelseUpdateWrapper ();
174
+ wrapper .convNote = convNote ;
175
+ wrapper .isRedactionChange = true ;
176
+
163
177
Test .startTest ();
164
178
Set <Id > result = ConvNoteCacheFilterHelper .getRecordIdsRequiringCacheClear (
165
- convNotes ,
166
- true // record is updated
179
+ new List <HenvendelseUpdateWrapper >{ wrapper }
167
180
);
168
181
Test .stopTest ();
169
182
0 commit comments