-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1834327
commit 0942e4f
Showing
36 changed files
with
697 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION_NAME = 7.4.4 | ||
VERSION_NAME = 7.4.5 | ||
|
||
POM_NAME = cmplibrary | ||
POM_REPO = sourcepoint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
* [DIA-2896](https://sourcepoint.atlassian.net/browse/DIA-2896) Implement consent expiration (#731) | ||
* [DIA-2654](https://sourcepoint.atlassian.net/browse/DIA-2654) Flush data if authId or propertyId changes (#711) | ||
* [DIA-2940](https://sourcepoint.atlassian.net/browse/DIA-2940) Fix for the applies parameter after saving partial GDPR consent (#734) | ||
* [DIA-2786](https://sourcepoint.atlassian.net/browse/DIA-2786) Added support fo the new CCPA OTT PM (#735) | ||
* [HCD-452](https://sourcepoint.atlassian.net/browse/DIA-452) Add full structure to SpConsent (#733) | ||
|
48 changes: 48 additions & 0 deletions
48
...ibrary/src/androidTest/java/com/sourcepoint/cmplibrary/util/UserConsentsRegressionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.sourcepoint.cmplibrary.util | ||
|
||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import com.example.uitestutil.assertEquals | ||
import com.example.uitestutil.toList | ||
import com.sourcepoint.cmplibrary.Utils.Companion.storeTestDataObj | ||
import org.json.JSONObject | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
class UserConsentsRegressionTest { | ||
|
||
private val appContext by lazy { InstrumentationRegistry.getInstrumentation().targetContext } | ||
|
||
/** | ||
* Test case that tests when the user has both campaigns applies value as TRUE then should return | ||
* sane from the userConsents() method | ||
*/ | ||
@Test | ||
fun given_stored_consent_with_save_and_exit_choices_and_applies_true_then_user_consents_should_return_true_for_both_applies() { | ||
|
||
val v7Consent = JSONObject("v7/stored_consent_with_save_and_exit_choices_and_applies_true.json".file2String()) | ||
appContext.storeTestDataObj(v7Consent.toList()) | ||
|
||
val gdprAppliesFromUserConsents = userConsents(appContext).gdpr?.consent?.applies | ||
gdprAppliesFromUserConsents.assertEquals(true) | ||
val ccpaAppliesFromUserConsents = userConsents(appContext).ccpa?.consent?.applies | ||
ccpaAppliesFromUserConsents.assertEquals(true) | ||
} | ||
|
||
/** | ||
* Test case that tests when the user has both campaigns applies value as FALSE then should return | ||
* sane from the userConsents() method | ||
*/ | ||
@Test | ||
fun given_stored_consent_with_save_and_exit_choices_and_applies_false_then_user_consents_should_return_false_for_both_applies() { | ||
|
||
val v7Consent = JSONObject("v7/stored_consent_with_save_and_exit_choices_and_applies_false.json".file2String()) | ||
appContext.storeTestDataObj(v7Consent.toList()) | ||
|
||
val gdprAppliesFromUserConsents = userConsents(appContext).gdpr?.consent?.applies | ||
gdprAppliesFromUserConsents.assertEquals(false) | ||
val ccpaAppliesFromUserConsents = userConsents(appContext).ccpa?.consent?.applies | ||
ccpaAppliesFromUserConsents.assertEquals(false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.