Skip to content

Commit cedc939

Browse files
authored
Tests: Support GPP USNat v2 (#3766)
1 parent aa654a3 commit cedc939

File tree

50 files changed

+2574
-1984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2574
-1984
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum GpcSubsectionType {
6+
7+
CORE(0),
8+
GPC(1)
9+
10+
@JsonValue
11+
final int value
12+
13+
GpcSubsectionType(int value) {
14+
this.value = value
15+
}
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum GppDataActivity {
6+
7+
NOT_APPLICABLE(0),
8+
NO_CONSENT(1),
9+
CONSENT(2)
10+
11+
@JsonValue
12+
final int value
13+
14+
GppDataActivity(int value) {
15+
this.value = value
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum MspaMode {
6+
7+
NOT_APPLICABLE(0),
8+
YES(1),
9+
NO(2)
10+
11+
@JsonValue
12+
final int value
13+
14+
MspaMode(int value) {
15+
this.value = value
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum Notice {
6+
7+
NOT_APPLICABLE(0),
8+
PROVIDED(1),
9+
NOT_PROVIDED(2)
10+
11+
@JsonValue
12+
final int value
13+
14+
Notice(int value) {
15+
this.value = value
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import com.fasterxml.jackson.annotation.JsonValue
4+
5+
enum OptOut {
6+
7+
NOT_APPLICABLE(0),
8+
OPTED_OUT(1),
9+
DID_NOT_OPT_OUT(2)
10+
11+
@JsonValue
12+
final int value
13+
14+
OptOut(int value) {
15+
this.value = value
16+
}
17+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import org.prebid.server.functional.util.PBSUtils
4+
5+
class UsCaliforniaV1ChildSensitiveData {
6+
7+
GppDataActivity childUnder13
8+
GppDataActivity childFrom13to16
9+
10+
static UsCaliforniaV1ChildSensitiveData getDefault(GppDataActivity childUnder13 = GppDataActivity.NOT_APPLICABLE,
11+
GppDataActivity childFrom13to16 = GppDataActivity.NOT_APPLICABLE) {
12+
13+
new UsCaliforniaV1ChildSensitiveData().tap {
14+
it.childUnder13 = childUnder13
15+
it.childFrom13to16 = childFrom13to16
16+
}
17+
}
18+
19+
static UsCaliforniaV1ChildSensitiveData getRandom(List<GppDataActivity> excludedActivities) {
20+
new UsCaliforniaV1ChildSensitiveData().tap {
21+
it.childUnder13 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities)
22+
it.childFrom13to16 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities)
23+
}
24+
}
25+
26+
List<Integer> getContentList() {
27+
[childFrom13to16, childUnder13]*.value.collect { it ?: 0 }
28+
}
29+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
class UsCaliforniaV1SensitiveData {
4+
5+
GppDataActivity idNumbers
6+
GppDataActivity accountInfo
7+
GppDataActivity geolocation
8+
GppDataActivity racialEthnicOrigin
9+
GppDataActivity communicationContents
10+
GppDataActivity geneticId
11+
GppDataActivity biometricId
12+
GppDataActivity healthInfo
13+
GppDataActivity orientation
14+
15+
List<Integer> getContentList() {
16+
[idNumbers, accountInfo, geolocation, racialEthnicOrigin,
17+
communicationContents, geneticId, biometricId, healthInfo, orientation]*.value.collect { it ?: 0 }
18+
}
19+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import org.prebid.server.functional.util.PBSUtils
4+
5+
class UsColoradoV1ChildSensitiveData {
6+
7+
GppDataActivity childSensitive
8+
9+
static UsColoradoV1ChildSensitiveData getDefault(GppDataActivity childSensitive = GppDataActivity.NOT_APPLICABLE) {
10+
new UsColoradoV1ChildSensitiveData().tap {
11+
it.childSensitive = childSensitive
12+
}
13+
}
14+
15+
static UsColoradoV1ChildSensitiveData getRandom(List<GppDataActivity> excludedActivities) {
16+
new UsColoradoV1ChildSensitiveData().tap {
17+
it.childSensitive = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities)
18+
}
19+
}
20+
21+
Integer getContentList() {
22+
this.childSensitive.value
23+
}
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
class UsColoradoV1SensitiveData {
4+
5+
GppDataActivity racialEthnicOrigin
6+
GppDataActivity religiousBeliefs
7+
GppDataActivity healthInfo
8+
GppDataActivity orientation
9+
GppDataActivity citizenshipStatus
10+
GppDataActivity geneticId
11+
GppDataActivity biometricId
12+
13+
List<Integer> getContentList() {
14+
[racialEthnicOrigin, religiousBeliefs, healthInfo, orientation,
15+
citizenshipStatus, geneticId, biometricId]*.value.collect { it ?: 0 }
16+
}
17+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package org.prebid.server.functional.model.privacy.gpp
2+
3+
import org.prebid.server.functional.util.PBSUtils
4+
5+
class UsConnecticutV1ChildSensitiveData {
6+
7+
GppDataActivity childUnder13
8+
GppDataActivity childFrom13to16
9+
GppDataActivity childFrom16to18
10+
11+
static UsConnecticutV1ChildSensitiveData getDefault(GppDataActivity childUnder13 = GppDataActivity.NOT_APPLICABLE,
12+
GppDataActivity childFrom13to16 = GppDataActivity.NOT_APPLICABLE,
13+
GppDataActivity childFrom16to18 = GppDataActivity.NOT_APPLICABLE) {
14+
15+
new UsConnecticutV1ChildSensitiveData().tap {
16+
it.childUnder13 = childUnder13
17+
it.childFrom13to16 = childFrom13to16
18+
it.childFrom16to18 = childFrom16to18
19+
}
20+
}
21+
22+
static UsConnecticutV1ChildSensitiveData getRandom(List<GppDataActivity> excludedActivities = []) {
23+
new UsConnecticutV1ChildSensitiveData().tap {
24+
it.childUnder13 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities)
25+
it.childFrom13to16 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities)
26+
it.childFrom16to18 = PBSUtils.getRandomEnum(GppDataActivity, excludedActivities)
27+
}
28+
}
29+
30+
List<Integer> getContentList() {
31+
[childFrom13to16, childUnder13, childFrom16to18]*.value.collect { it ?: 0 }
32+
}
33+
}

0 commit comments

Comments
 (0)