Skip to content

Commit effec49

Browse files
authored
Test: Add a warning for when targeting attributes are truncated (#4192)
1 parent 3913931 commit effec49

File tree

4 files changed

+130
-149
lines changed

4 files changed

+130
-149
lines changed

src/test/groovy/org/prebid/server/functional/testcontainers/PbsConfig.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,9 @@ LIMIT 1
145145
"currency-converter.external-rates.refresh-period-ms" : "900000"]
146146
}
147147

148+
static Map<String,String> getTargetingConfig() {
149+
["settings.targeting.truncate-attr-chars": '255']
150+
}
151+
148152
private PbsConfig() {}
149153
}

src/test/groovy/org/prebid/server/functional/testcontainers/container/PrebidServerContainer.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class PrebidServerContainer extends GenericContainer<PrebidServerContainer> {
4242
<< PbsConfig.bidderAliasConfig
4343
<< PbsConfig.prebidCacheConfig
4444
<< PbsConfig.mySqlConfig
45+
<< PbsConfig.targetingConfig
4546
withConfig(commonConfig)
4647
withConfig(customConfig)
4748
}

src/test/groovy/org/prebid/server/functional/tests/CacheSpec.groovy

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class CacheSpec extends BaseSpec {
2727
private static final String PBS_API_HEADER = 'x-pbc-api-key'
2828
private static final Integer MAX_DATACENTER_REGION_LENGTH = 4
2929
private static final Integer DEFAULT_UUID_LENGTH = 36
30-
private static final Integer TARGETING_PARAM_NAME_MAX_LENGTH = 20
3130

3231
private static final String XML_CREATIVE_SIZE_ACCOUNT_METRIC = "account.%s.prebid_cache.creative_size.xml"
3332
private static final String JSON_CREATIVE_SIZE_ACCOUNT_METRIC = "account.%s.prebid_cache.creative_size.json"
@@ -612,8 +611,8 @@ class CacheSpec extends BaseSpec {
612611
it.get("hb_cache_id_generic")
613612
it.get("hb_cache_path") == CACHE_PATH
614613
it.get("hb_cache_host") == CACHE_HOST
615-
it.get("hb_cache_path_generic".substring(0, TARGETING_PARAM_NAME_MAX_LENGTH)) == CACHE_PATH
616-
it.get("hb_cache_host_generic".substring(0, TARGETING_PARAM_NAME_MAX_LENGTH)) == CACHE_HOST
614+
it.get("hb_cache_path_generic") == CACHE_PATH
615+
it.get("hb_cache_host_generic") == CACHE_HOST
617616
}
618617

619618
and: "Debug should contain http call"
@@ -648,8 +647,8 @@ class CacheSpec extends BaseSpec {
648647
it.get("hb_cache_id_generic")
649648
it.get("hb_cache_path") == INTERNAL_CACHE_PATH
650649
it.get("hb_cache_host") == networkServiceContainer.hostAndPort.toString()
651-
it.get("hb_cache_path_generic".substring(0, TARGETING_PARAM_NAME_MAX_LENGTH)) == INTERNAL_CACHE_PATH
652-
it.get("hb_cache_host_generic".substring(0, TARGETING_PARAM_NAME_MAX_LENGTH)) == networkServiceContainer.hostAndPort.toString()
650+
it.get("hb_cache_path_generic") == INTERNAL_CACHE_PATH
651+
it.get("hb_cache_host_generic") == networkServiceContainer.hostAndPort.toString()
653652
}
654653

655654
and: "Debug should contain http call"

0 commit comments

Comments
 (0)