@@ -21,6 +21,11 @@ @interface BranchEventTest : BNCTestCase
2121
2222@implementation BranchEventTest
2323
24+ - (void ) setUp {
25+ [BNCPreferenceHelper preferenceHelper ].identityID = @" 575759106028389737" ;
26+ [[BNCPreferenceHelper preferenceHelper ] clearInstrumentationDictionary ];
27+ }
28+
2429- (void ) testDescription {
2530 BranchEvent *event = [BranchEvent standardEvent: BranchStandardEventPurchase];
2631 event.transactionID = @" 1234" ;
@@ -112,6 +117,7 @@ - (void) testEvent {
112117
113118 NSMutableDictionary *expectedRequest =
114119 [self mutableDictionaryFromBundleJSONWithKey: @" V2EventJSON" ];
120+ expectedRequest[@" branch_key" ] = Branch.branchKey ;
115121 expectedRequest[@" user_data" ] = [[BNCDeviceInfo getInstance ] v2dictionary ];
116122
117123 Branch *branch = [Branch getInstance: @" key_live_foo" ];
@@ -131,8 +137,9 @@ - (void) testEvent {
131137 NSError *error = nil ;
132138 NSString *url = request.URL .absoluteString ;
133139 NSData *bodyData = request.HTTPBody ;
134- NSDictionary *parameters =
135- [NSJSONSerialization JSONObjectWithData: bodyData options: 0 error: &error];
140+ NSMutableDictionary *parameters =
141+ [NSJSONSerialization JSONObjectWithData: bodyData
142+ options: NSJSONReadingMutableContainers error: &error];
136143 XCTAssertNil (error);
137144
138145 NSLog (@" testEvent 1" );
@@ -157,6 +164,7 @@ - (void) testUserCompletedAction {
157164
158165 NSMutableDictionary *expectedRequest =
159166 [self mutableDictionaryFromBundleJSONWithKey: @" V2EventJSON" ];
167+ expectedRequest[@" branch_key" ] = Branch.branchKey ;
160168 expectedRequest[@" user_data" ] = [[BNCDeviceInfo getInstance ] v2dictionary ];
161169 expectedRequest[@" event_data" ] = nil ;
162170 expectedRequest[@" custom_data" ] = nil ;
0 commit comments