Skip to content

Commit

Permalink
release/6.9.1 (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevazhnovu authored Feb 28, 2023
1 parent 5bbeb51 commit 32389ad
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 7 deletions.
3 changes: 2 additions & 1 deletion SDK_V6_RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
```
Expand Down
2 changes: 1 addition & 1 deletion cmplibrary/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME = 6.9.0
VERSION_NAME = 6.9.1

POM_NAME = cmplibrary
POM_REPO = sourcepoint
Expand Down
3 changes: 1 addition & 2 deletions cmplibrary/release_note.txt
Original file line number Diff line number Diff line change
@@ -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)



Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -60,8 +59,9 @@ internal fun Map<String, Any?>.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") ?: ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ enum class CcpaStatus {
rejectedAll,
rejectedSome,
rejectedNone,
consentedAll
consentedAll,
linkedNoAction,
unknown
}

internal fun GDPRConsentInternal.toJsonObject(): JSONObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 32389ad

Please sign in to comment.