13
13
#import " NRMAAgentConfiguration.h"
14
14
15
15
#import " NewRelicInternalUtils.h"
16
+ #import " NRMAAttributeValidator.h"
16
17
17
18
#import < Hex/HexContext.hpp>
18
19
#import " NRAgentTestBase.h"
@@ -63,14 +64,16 @@ - (void) testBadParams {
63
64
sessionStartTime: 0
64
65
agentConfiguration: nil
65
66
platform: nil
66
- sessionId: nil ]);
67
+ sessionId: nil
68
+ attributeValidator: nil ]);
67
69
68
70
NRMAAnalytics* analytics = [[NRMAAnalytics alloc ] initWithSessionStartTimeMS: 0 ];
69
71
NRMAHandledExceptions* exceptions = [[NRMAHandledExceptions alloc ] initWithAnalyticsController: nil
70
72
sessionStartTime: 0
71
73
agentConfiguration: nil
72
74
platform: nil
73
- sessionId: nil ];
75
+ sessionId: nil
76
+ attributeValidator: nil ];
74
77
75
78
76
79
XCTAssertTrue (exceptions == nil );
@@ -81,7 +84,8 @@ - (void) testBadParams {
81
84
sessionStartTime: 0
82
85
agentConfiguration: nil
83
86
platform: nil
84
- sessionId: nil ];
87
+ sessionId: nil
88
+ attributeValidator: nil ];
85
89
86
90
XCTAssertTrue (exceptions == nil );
87
91
@@ -94,7 +98,8 @@ - (void) testBadParams {
94
98
sessionStartTime: 0
95
99
agentConfiguration: agentConfig
96
100
platform: nil
97
- sessionId: nil ];
101
+ sessionId: nil
102
+ attributeValidator: nil ];
98
103
99
104
XCTAssertTrue (exceptions == nil );
100
105
@@ -104,7 +109,8 @@ - (void) testBadParams {
104
109
sessionStartTime: 0
105
110
agentConfiguration: agentConfig
106
111
platform: @" iOS"
107
- sessionId: nil ];
112
+ sessionId: nil
113
+ attributeValidator: nil ];
108
114
109
115
XCTAssertTrue (exceptions == nil );
110
116
@@ -119,14 +125,16 @@ - (void) testBadParamsNewEventSystem {
119
125
sessionStartTime: 0
120
126
agentConfiguration: nil
121
127
platform: nil
122
- sessionId: nil ]);
128
+ sessionId: nil
129
+ attributeValidator: nil ]);
123
130
124
131
NRMAAnalytics* analytics = [[NRMAAnalytics alloc ] initWithSessionStartTimeMS: 0 ];
125
132
NRMAHandledExceptions* exceptions = [[NRMAHandledExceptions alloc ] initWithAnalyticsController: nil
126
133
sessionStartTime: 0
127
134
agentConfiguration: nil
128
135
platform: nil
129
- sessionId: nil ];
136
+ sessionId: nil
137
+ attributeValidator: nil ];
130
138
131
139
132
140
XCTAssertTrue (exceptions == nil );
@@ -137,7 +145,8 @@ - (void) testBadParamsNewEventSystem {
137
145
sessionStartTime: 0
138
146
agentConfiguration: nil
139
147
platform: nil
140
- sessionId: nil ];
148
+ sessionId: nil
149
+ attributeValidator: nil ];
141
150
142
151
XCTAssertTrue (exceptions == nil );
143
152
@@ -150,7 +159,8 @@ - (void) testBadParamsNewEventSystem {
150
159
sessionStartTime: 0
151
160
agentConfiguration: agentConfig
152
161
platform: nil
153
- sessionId: nil ];
162
+ sessionId: nil
163
+ attributeValidator: nil ];
154
164
155
165
XCTAssertTrue (exceptions == nil );
156
166
@@ -160,7 +170,8 @@ - (void) testBadParamsNewEventSystem {
160
170
sessionStartTime: 0
161
171
agentConfiguration: agentConfig
162
172
platform: @" iOS"
163
- sessionId: nil ];
173
+ sessionId: nil
174
+ attributeValidator: nil ];
164
175
165
176
XCTAssertTrue (exceptions == nil );
166
177
@@ -180,7 +191,8 @@ - (void) testHandleException {
180
191
sessionStartTime: [NSDate new ]
181
192
agentConfiguration: agentConfig
182
193
platform: [NewRelicInternalUtils osName ]
183
- sessionId: @" sessionId" ];
194
+ sessionId: @" sessionId"
195
+ attributeValidator: [[NRMAAttributeValidator alloc ] init ]];
184
196
185
197
XCTAssertNoThrow ([hexController recordHandledException: [NSException exceptionWithName: @" Hot Tea Exception"
186
198
reason: @" the Tea is too hot"
@@ -211,7 +223,8 @@ - (void) testHandleExceptionWithStackTrace {
211
223
sessionStartTime: [NSDate new ]
212
224
agentConfiguration: agentConfig
213
225
platform: [NewRelicInternalUtils osName ]
214
- sessionId: @" sessionId" ];
226
+ sessionId: @" sessionId"
227
+ attributeValidator: [[NRMAAttributeValidator alloc ] init ]];
215
228
216
229
id dict = @{@" name" : @" Exception name not found" ,
217
230
@" reason" : @" Reason not found" ,
@@ -238,7 +251,8 @@ - (void) testHandleExceptionWithStackTraceNewEventSystem {
238
251
sessionStartTime: [NSDate new ]
239
252
agentConfiguration: agentConfig
240
253
platform: [NewRelicInternalUtils osName ]
241
- sessionId: @" sessionId" ];
254
+ sessionId: @" sessionId"
255
+ attributeValidator: [[NRMAAttributeValidator alloc ] init ]];
242
256
243
257
id dict = @{@" name" : @" Exception name not found" ,
244
258
@" reason" : @" Reason not found" ,
@@ -266,7 +280,8 @@ - (void) testPlatform {
266
280
sessionStartTime: [NSDate new ]
267
281
agentConfiguration: agentConfig
268
282
platform: [NewRelicInternalUtils osName ]
269
- sessionId: @" sessionId" ];
283
+ sessionId: @" sessionId"
284
+ attributeValidator: [[NRMAAttributeValidator alloc ] init ]];
270
285
XCTAssertTrue ([hexController fbsPlatformFromString: @" iOS" ] == com::newrelic::mobile::fbs::Platform_iOS, @" Method returned %d , but should be %d " , [hexController fbsPlatformFromString: @" iOS" ],com::newrelic::mobile::fbs::Platform_iOS );
271
286
XCTAssertTrue ([hexController fbsPlatformFromString: @" tvOS" ] == com::newrelic::mobile::fbs::Platform_tvOS,@" Method returned %d , but should be %d " , [hexController fbsPlatformFromString: @" tvOS" ],com::newrelic::mobile::fbs::Platform_tvOS);
272
287
@@ -284,7 +299,8 @@ - (void) testDontRecordUnThrownExceptions {
284
299
sessionStartTime: [NSDate new ]
285
300
agentConfiguration: agentConfig
286
301
platform: [NewRelicInternalUtils osName ]
287
- sessionId: @" sessionId" ];
302
+ sessionId: @" sessionId"
303
+ attributeValidator: [[NRMAAttributeValidator alloc ] init ]];
288
304
289
305
id mockLogger = [OCMockObject mockForClass: [NRLogger class ]];
290
306
@@ -319,7 +335,8 @@ - (void) testRecordError {
319
335
sessionStartTime: [NSDate new ]
320
336
agentConfiguration: agentConfig
321
337
platform: [NewRelicInternalUtils osName ]
322
- sessionId: @" sessionId" ];
338
+ sessionId: @" sessionId"
339
+ attributeValidator: [[NRMAAttributeValidator alloc ] init ]];
323
340
324
341
325
342
NSError * error = [NSError errorWithDomain: @" " code: NSURLErrorUnknown userInfo: @{}];
@@ -351,7 +368,8 @@ - (void) testRecordErrorNewEventSystem {
351
368
sessionStartTime: [NSDate new ]
352
369
agentConfiguration: agentConfig
353
370
platform: [NewRelicInternalUtils osName ]
354
- sessionId: @" sessionId" ];
371
+ sessionId: @" sessionId"
372
+ attributeValidator: [[NRMAAttributeValidator alloc ] init ]];
355
373
356
374
357
375
NSError * error = [NSError errorWithDomain: @" " code: NSURLErrorUnknown userInfo: @{}];
0 commit comments