-
Notifications
You must be signed in to change notification settings - Fork 221
Tests: Support GPP USNat v2 #3766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: Support GPP USNat v2 #3766
Conversation
…support-gpp-usnat-v2 # Conflicts: # src/test/groovy/org/prebid/server/functional/tests/privacy/GppCookieSyncSpec.groovy # src/test/groovy/org/prebid/server/functional/tests/privacy/GppSyncUserActivitiesSpec.groovy # src/test/groovy/org/prebid/server/functional/tests/privacy/GppTransmitUfpdActivitiesSpec.groovy # src/test/groovy/org/prebid/server/functional/util/privacy/gpp/GppConsent.groovy # src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsUtV1Consent.groovy # src/test/groovy/org/prebid/server/functional/util/privacy/gpp/UsVaV1Consent.groovy # src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCaV1Consent.groovy # src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCoV1Consent.groovy # src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsCtV1Consent.groovy # src/test/groovy/org/prebid/server/functional/util/privacy/gpp/v1/UsNatV1Consent.groovy
623fee2 to
c4a5902
Compare
| .setMspaServiceProviderMode(MspaMode.YES) | ||
| .setMspaServiceProviderMode(MspaMode.NO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dublication
| def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest.tap { | ||
| it.gppSid = US_NAT_V1.value | ||
| it.account = accountId | ||
| it.gpp = 'DBABLA~CAAAAAAAAASA.QA' // new UsNatV2Consent.Builder().setKnownChildSensitiveDataConsents(new UsNationalV2ChildSensitiveData(childFrom16to17: DataActivity.NO_CONSENT)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use UsNatV2Consent instead of string
| ] | ||
| } | ||
|
|
||
| def "PBS cookie sync call when privacy module contain some part of of disallow logic US nat v2 validation should exclude bidders URLs"() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird naming
| ] | ||
| } | ||
|
|
||
| def "PBS cookie sync call when privacy module contain some part of of disallow logic US nat v2 validation should exclude bidders URLs"() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add negative scenario
| .setMspaServiceProviderMode(MspaMode.YES) | ||
| .setMspaServiceProviderMode(MspaMode.NO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
| and: "Generic bidder request should have data in EIDS fields" | ||
| assert bidderRequest.user.eids == bidRequest.user.eids | ||
| where: | ||
| disallowGppLogic << [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add empty line
| ] | ||
| } | ||
|
|
||
| def "PBS auction call when privacy module contain some part of disallow raw logic US nat v2 validation should remove UFPD fields in request"() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same weird naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What mean "some part"?
| 'DBABLA~CAAAqqiqqgCA.QA', //SensitiveDataProcessing[1-7,9-16]=2 | ||
| 'DBABLA~CAAAVUAERACA.QA', //SensitiveDataProcessing[1-5,11,13,15]=1 | ||
| 'DBABLA~CAAAABRREQCA.QA', //SensitiveDataProcessing[6,7,9,10,12,14,16]=1 | ||
| 'DBABLA~CAAAACiiIgCA.QA' //SensitiveDataProcessing[6,7,9,10,12,14,16]=2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not obj?
|
|
||
| import com.fasterxml.jackson.annotation.JsonValue | ||
|
|
||
| enum DataActivity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't see zero value in define doc
KnownChildSensitiveDataConsents, PersonalDataConsents, SensitiveDataProcessing:
1 - No Consent
2 - Consent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marki1an https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Sections/US-National/IAB%20Privacy%E2%80%99s%20Multi-State%20Privacy%20Agreement%20(MSPA)%20US%20National%20Technical%20Specification.md#:~:text=0%20Not%20Applicable.%20The%20Business%20does%20not%20have%20actual%20knowledge%20that%20it%20Processes%20Personal%20Data%20or%20Sensitive%20Data%20of%20a%20Consumer%20who%20is%20a%20known%20child.
| YES(1), | ||
| NO(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raname to PROVIDED(1), NOT_PROVIDED(2) correspoding to doc.
SaleOptOutNotice, SharingNotice, TargetedAdvertisingOptOutNotice, SensitiveDataProcessingOptOutNotice, SensitiveDataLimitUseNotice:
0 - Not Applicable
1 - Notice was provided
2 - Notice was not provided
|
|
||
| class UsCaliforniaV1ChildSensitiveData { | ||
|
|
||
| DataActivity childBlow13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: renama please to childUnder13
| static UsColoradoV1SensitiveData generateRandomSensitiveData() { | ||
| new UsColoradoV1SensitiveData().tap { | ||
| racialEthnicOrigin = PBSUtils.getRandomEnum(DataActivity) | ||
| religiousBeliefs = PBSUtils.getRandomEnum(DataActivity) | ||
| healthInfo = PBSUtils.getRandomEnum(DataActivity) | ||
| orientation = PBSUtils.getRandomEnum(DataActivity) | ||
| citizenshipStatus = PBSUtils.getRandomEnum(DataActivity) | ||
| geneticId = PBSUtils.getRandomEnum(DataActivity) | ||
| biometricId = PBSUtils.getRandomEnum(DataActivity) | ||
| } | ||
| } | ||
|
|
||
| static UsColoradoV1SensitiveData fromList(List<DataActivity> data) { | ||
| if (data.size() != 7) { | ||
| throw new IllegalArgumentException("Invalid data size. Expected 7 values.") | ||
| } | ||
| new UsColoradoV1SensitiveData().tap { | ||
| racialEthnicOrigin = data[0] | ||
| religiousBeliefs = data[1] | ||
| healthInfo = data[2] | ||
| orientation = data[3] | ||
| citizenshipStatus = data[4] | ||
| geneticId = data[5] | ||
| biometricId = data[6] | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each class contains code that isn’t used, so the question is: do we need it?
| new UsCtV1Consent.Builder().build() | US_CT_V1 | ||
| } | ||
|
|
||
| def "PBS auction call when request have disallow logic US nat v2 validation should call bid adapter"() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird naming — I literally can’t understand what this test is doing.
| GppDataActivity childSensitive | ||
|
|
||
| static UsColoradoV1ChildSensitiveData getDefault(GppDataActivity childSensitive = GppDataActivity.NOT_APPLICABLE) { | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line
| new UsNatV2Consent.Builder() | ||
| .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) | ||
| .build(), | ||
| new UsNatV2Consent.Builder() | ||
| .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) | ||
| .build(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplication logic
| new UsNatV2Consent.Builder() | ||
| .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) | ||
| .build(), | ||
| new UsNatV2Consent.Builder() | ||
| .setSharingOptOut(OptOut.DID_NOT_OPT_OUT) | ||
| .build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here also
| assert bidderRequest.user.eids == bidRequest.user.eids | ||
|
|
||
| where: | ||
| usNationalV2SensitiveData << [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check on unique values)
| new UsNatV2Consent.Builder() | ||
| .setSaleOptOut(OptOut.DID_NOT_OPT_OUT) | ||
| .build(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here also duplication :)
🔧 Type of changes
✨ What's the context?
What's the context for the changes?
🧠 Rationale behind the change
Why did you choose to make these changes? Were there any trade-offs you had to consider?
🔎 New Bid Adapter Checklist
🧪 Test plan
How do you know the changes are safe to ship to production?
🏎 Quality check