From 32389adafec6fb01aab0304684b33df28aa14917 Mon Sep 17 00:00:00 2001 From: Dmytro Fedko Date: Tue, 28 Feb 2023 15:42:10 +0100 Subject: [PATCH] release/6.9.1 (#604) --- SDK_V6_RELEASE.md | 3 +- cmplibrary/gradle.properties | 2 +- cmplibrary/release_note.txt | 3 +- .../data/network/model/ConsentRespExt.kt | 4 +- .../cmplibrary/model/exposed/SPConsents.kt | 4 +- .../model/ext/ConsentRespExtKtTest.kt | 56 +++++++++++++++++++ 6 files changed, 65 insertions(+), 7 deletions(-) diff --git a/SDK_V6_RELEASE.md b/SDK_V6_RELEASE.md index 00236b047..78ef7d351 100644 --- a/SDK_V6_RELEASE.md +++ b/SDK_V6_RELEASE.md @@ -16,9 +16,10 @@ 4. Then go to `cmplibrary/release_note.txt`, clear it and fulfill with description of every single commit pushed to `v6/develop` branch since the last artifact release. Please, stick to style of description which appears in that file! This part will appear in changelog after artifact release will be accomplished. - ``` + ``` git log --oneline ``` + To exit the --oneline command press `q` in the terminal. 5. Commit and push these two files **ONLY**. The commit message **MUST** be “release/x.y.z”. The reason of such strict rules relates to our automated release process; ``` diff --git a/cmplibrary/gradle.properties b/cmplibrary/gradle.properties index 121a73f0c..889445a80 100644 --- a/cmplibrary/gradle.properties +++ b/cmplibrary/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME = 6.9.0 +VERSION_NAME = 6.9.1 POM_NAME = cmplibrary POM_REPO = sourcepoint diff --git a/cmplibrary/release_note.txt b/cmplibrary/release_note.txt index 8f7d24173..02c6b40a7 100644 --- a/cmplibrary/release_note.txt +++ b/cmplibrary/release_note.txt @@ -1,5 +1,4 @@ -* [DIA-1708](https://sourcepoint.atlassian.net/browse/DIA-1708) Create a new ott enum type to be used in the loadPrivacyManager api (#567) - +* [DIA-1813](https://sourcepoint.atlassian.net/browse/DIA-1813) Added new enum values for ccpaStatus and tests for them (#591) diff --git a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/data/network/model/ConsentRespExt.kt b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/data/network/model/ConsentRespExt.kt index 1d5aa27c4..b7b6e9179 100644 --- a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/data/network/model/ConsentRespExt.kt +++ b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/data/network/model/ConsentRespExt.kt @@ -1,7 +1,6 @@ package com.sourcepoint.cmplibrary.data.network.model import com.sourcepoint.cmplibrary.core.getOrNull -import com.sourcepoint.cmplibrary.data.network.converter.fail import com.sourcepoint.cmplibrary.data.network.converter.failParam import com.sourcepoint.cmplibrary.exception.CampaignType import com.sourcepoint.cmplibrary.model.* //ktlint-disable @@ -60,8 +59,9 @@ internal fun Map.toCCPAUserConsent(uuid: String?, applies: Boolean CcpaStatus.values().find { it.name == s } + ?: CcpaStatus.unknown } - ?: fail("CCPAStatus cannot be null!!!") + ?: CcpaStatus.unknown val uspString: String = getFieldValue("uspstring") ?: "" diff --git a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/model/exposed/SPConsents.kt b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/model/exposed/SPConsents.kt index d21f88b84..c7401a64a 100644 --- a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/model/exposed/SPConsents.kt +++ b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/model/exposed/SPConsents.kt @@ -72,7 +72,9 @@ enum class CcpaStatus { rejectedAll, rejectedSome, rejectedNone, - consentedAll + consentedAll, + linkedNoAction, + unknown } internal fun GDPRConsentInternal.toJsonObject(): JSONObject { diff --git a/cmplibrary/src/test/java/com/sourcepoint/cmplibrary/model/ext/ConsentRespExtKtTest.kt b/cmplibrary/src/test/java/com/sourcepoint/cmplibrary/model/ext/ConsentRespExtKtTest.kt index a7bb1d855..6a5e05b23 100644 --- a/cmplibrary/src/test/java/com/sourcepoint/cmplibrary/model/ext/ConsentRespExtKtTest.kt +++ b/cmplibrary/src/test/java/com/sourcepoint/cmplibrary/model/ext/ConsentRespExtKtTest.kt @@ -127,6 +127,62 @@ class ConsentRespExtKtTest { } } + @Test + fun `GIVEN a CCPA consent with status=linkedNoAction RETURN a consent object`() { + + val ccpaConsent = JSONObject( + """ + { + "dateCreated": "2021-10-11T14:34:08.288Z", + "newUser": false, + "rejectedAll": false, + "rejectedCategories": [], + "rejectedVendors": [], + "signedLspa": false, + "status": "linkedNoAction", + "uspstring": "1---" + } + """.trimIndent() + ).toTreeMap() + val test = ccpaConsent.toCCPAUserConsent("1234", true) + test.run { + uspstring.assertEquals("1---") + status!!.name.assertEquals("linkedNoAction") + rejectedCategories.size.assertEquals(0) + rejectedVendors.size.assertEquals(0) + uuid.assertEquals("1234") + applies.assertTrue() + } + } + + @Test + fun `GIVEN a CCPA consent with status=unknown RETURN a consent object`() { + + val ccpaConsent = JSONObject( + """ + { + "dateCreated": "2021-10-11T14:34:08.288Z", + "newUser": false, + "rejectedAll": false, + "rejectedCategories": [], + "rejectedVendors": [], + "signedLspa": false, + "status": "adsasdasdasd", + "uspstring": "1---" + } + """.trimIndent() + ).toTreeMap() + val test = ccpaConsent.toCCPAUserConsent("1234", true) + test.run { + uspstring.assertEquals("1---") + status!!.name.assertEquals("unknown") + rejectedCategories.size.assertEquals(0) + rejectedVendors.size.assertEquals(0) + uuid.assertEquals("1234") + applies.assertTrue() + } + } + @Test fun `GIVEN a CCPA consent with not empty rejectedCategories and rejectedVendors RETURN a consent object`() { val ccpaConsent = JSONObject(