Skip to content

Commit bafc3e9

Browse files
committed
test(appsflyer): align onConsentStateUpdated calls with UserAttributeListener API
Remove third argument and unused FilteredMParticleUser mock setup from unit tests. Made-with: Cursor
1 parent f049c57 commit bafc3e9

1 file changed

Lines changed: 9 additions & 30 deletions

File tree

kits/appsflyer/appsflyer-6/src/test/kotlin/com/mparticle/kits/AppsflyerKitTests.kt

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ class AppsflyerKitTests {
3434
private var kit = AppsFlyerKit()
3535
private var appsflyer = AppsFlyerLib()
3636

37-
@Mock
38-
lateinit var filteredMParticleUser: FilteredMParticleUser
39-
4037
@Mock
4138
lateinit var user: MParticleUser
4239

@@ -226,9 +223,7 @@ class AppsflyerKitTests {
226223
.builder()
227224
.addGDPRConsentState("Marketing", marketingConsent)
228225
.build()
229-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
230-
231-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
226+
kit.onConsentStateUpdated(state, state)
232227

233228
val afConsentResults = appsflyer.getConsentState()
234229
val expectedConsentValue =
@@ -275,9 +270,7 @@ class AppsflyerKitTests {
275270
.builder()
276271
.addGDPRConsentState("test1", marketingConsent)
277272
.build()
278-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
279-
280-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
273+
kit.onConsentStateUpdated(state, state)
281274

282275
val afConsentResults = appsflyer.getConsentState()
283276
val expectedConsentValue =
@@ -324,9 +317,7 @@ class AppsflyerKitTests {
324317
.builder()
325318
.addGDPRConsentState("test1", marketingConsent)
326319
.build()
327-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
328-
329-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
320+
kit.onConsentStateUpdated(state, state)
330321

331322
val afConsentResults = appsflyer.getConsentState()
332323
val expectedConsentValue =
@@ -392,9 +383,7 @@ class AppsflyerKitTests {
392383
.addGDPRConsentState("Marketing", marketingConsent)
393384
.addGDPRConsentState("testconsent", testConsent)
394385
.build()
395-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
396-
397-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
386+
kit.onConsentStateUpdated(state, state)
398387

399388
val afConsentResults = appsflyer.getConsentState()
400389
val expectedConsentValue =
@@ -453,9 +442,7 @@ class AppsflyerKitTests {
453442
.addGDPRConsentState("Performance", performanceConsent)
454443
.addGDPRConsentState("Marketing", marketingConsent)
455444
.build()
456-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
457-
458-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
445+
kit.onConsentStateUpdated(state, state)
459446

460447
val afConsentResults = appsflyer.getConsentState()
461448
val expectedConsentValue =
@@ -511,9 +498,7 @@ class AppsflyerKitTests {
511498
.addGDPRConsentState("Marketing", marketingConsent)
512499
.addGDPRConsentState("Performance", performanceConsent)
513500
.build()
514-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
515-
516-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
501+
kit.onConsentStateUpdated(state, state)
517502
val afConsentResults = appsflyer.getConsentState()
518503
val expectedConsentValue =
519504
afConsentResults
@@ -559,9 +544,7 @@ class AppsflyerKitTests {
559544
.addGDPRConsentState("Marketing", marketingConsent)
560545
.addGDPRConsentState("Performance", performanceConsent)
561546
.build()
562-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
563-
564-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
547+
kit.onConsentStateUpdated(state, state)
565548

566549
TestCase.assertEquals(0, appsflyer.getConsentState().size)
567550
}
@@ -599,9 +582,7 @@ class AppsflyerKitTests {
599582
.addGDPRConsentState("Marketing", marketingConsent)
600583
.addGDPRConsentState("Performance", performanceConsent)
601584
.build()
602-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
603-
604-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
585+
kit.onConsentStateUpdated(state, state)
605586

606587
val afConsentResults = appsflyer.getConsentState()
607588
val expectedConsentValue =
@@ -657,9 +638,7 @@ class AppsflyerKitTests {
657638
.addGDPRConsentState("Marketing", marketingConsent)
658639
.addGDPRConsentState("Performance", performanceConsent)
659640
.build()
660-
filteredMParticleUser = FilteredMParticleUser.getInstance(user, kit)
661-
662-
kit.onConsentStateUpdated(state, state, filteredMParticleUser)
641+
kit.onConsentStateUpdated(state, state)
663642

664643
TestCase.assertEquals(1, appsflyer.getConsentState().size)
665644
val afConsentResults = appsflyer.getConsentState()

0 commit comments

Comments
 (0)