Skip to content

Commit 2f649b4

Browse files
committed
Clean groovy tests
1 parent 7162ee8 commit 2f649b4

10 files changed

Lines changed: 16 additions & 56 deletions

File tree

src/test/groovy/org/prebid/server/functional/model/response/cookiesync/UserSyncInfo.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class UserSyncInfo {
88

99
String url
1010
Type type
11-
Boolean supportCORS
1211

1312
enum Type {
1413

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ import static org.prebid.server.functional.util.SystemProperties.PBS_VERSION
4343
class AuctionSpec extends BaseSpec {
4444

4545
private static final String USER_SYNC_URL = "$networkServiceContainer.rootUri/generic-usersync"
46-
private static final Boolean CORS_SUPPORT = false
4746
private static final UserSyncInfo.Type USER_SYNC_TYPE = REDIRECT
4847
private static final Integer DEFAULT_TIMEOUT = getRandomTimeout()
4948
private static final Integer MIN_BID_ID_LENGTH = 17
5049
private static final Integer DEFAULT_UUID_LENGTH = 36
5150
private static final Map<String, String> GENERIC_CONFIG = [
52-
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.url" : USER_SYNC_URL,
53-
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.support-cors": CORS_SUPPORT.toString()]
51+
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.url" : USER_SYNC_URL]
5452
@Shared
5553
PrebidServerService prebidServerService = pbsServiceFactory.getService(PBS_CONFIG)
5654

@@ -189,8 +187,7 @@ class AuctionSpec extends BaseSpec {
189187
def "PBS should populate buyeruid from uids cookie when buyeruids with appropriate bidder but without value present in request"() {
190188
given: "PBS config"
191189
def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG
192-
+ ["adapters.${GENERIC.value}.usersync.${REDIRECT.value}.url" : USER_SYNC_URL,
193-
"adapters.${GENERIC.value}.usersync.${REDIRECT.value}.support-cors": "false"])
190+
+ ["adapters.${GENERIC.value}.usersync.${REDIRECT.value}.url" : USER_SYNC_URL])
194191

195192
and: "Bid request with buyeruids"
196193
def bidRequest = BidRequest.defaultBidRequest.tap {
@@ -212,8 +209,7 @@ class AuctionSpec extends BaseSpec {
212209
def "PBS shouldn't populate buyeruid from uids cookie when buyeruids with appropriate bidder but without value present in request"() {
213210
given: "PBS config"
214211
def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG
215-
+ ["adapters.${GENERIC.value}.usersync.${REDIRECT.value}.url" : USER_SYNC_URL,
216-
"adapters.${GENERIC.value}.usersync.${REDIRECT.value}.support-cors": "false"])
212+
+ ["adapters.${GENERIC.value}.usersync.${REDIRECT.value}.url" : USER_SYNC_URL])
217213

218214
and: "Bid request with buyeruids"
219215
def bidRequest = BidRequest.defaultBidRequest.tap {

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,40 +55,32 @@ import static org.prebid.server.functional.util.privacy.TcfConsent.RUBICON_VENDO
5555
class CookieSyncSpec extends BaseSpec {
5656

5757
private static final UserSyncInfo.Type USER_SYNC_TYPE = REDIRECT
58-
private static final boolean CORS_SUPPORT = false
5958
private static final String USER_SYNC_URL = "$networkServiceContainer.rootUri/generic-usersync"
6059
private static final String ALL_BIDDERS = "*"
6160
private static final Integer DEFAULT_PBS_BIDDERS_SIZE = 8
6261

6362
private static final Map<String, String> GENERIC_CONFIG = [
6463
"adapters.${GENERIC.value}.usersync.redirect.url" : USER_SYNC_URL,
65-
"adapters.${GENERIC.value}.usersync.redirect.support-cors": CORS_SUPPORT as String,
6664
"adapters.${GENERIC.value}.meta-info.vendor-id" : GENERIC_VENDOR_ID as String]
6765
private static final Map<String, String> ACEEX_CONFIG = [
6866
"adapters.${ACEEX.value}.enabled" : "true",
6967
"adapters.${ACEEX.value}.usersync.cookie-family-name" : ACEEX.value,
70-
"adapters.${ACEEX.value}.usersync.redirect.url" : "https://test.redirect.endpoint.com={{redirect_url}}",
71-
"adapters.${ACEEX.value}.usersync.redirect.support-cors": CORS_SUPPORT as String]
68+
"adapters.${ACEEX.value}.usersync.redirect.url" : "https://test.redirect.endpoint.com={{redirect_url}}"]
7269
private static final Map<String, String> RUBICON_CONFIG = [
7370
"adapters.${RUBICON.value}.enabled" : "true",
7471
"adapters.${RUBICON.value}.meta-info.vendor-id" : RUBICON_VENDOR_ID as String,
7572
"adapters.${RUBICON.value}.usersync.cookie-family-name" : RUBICON.value,
7673
"adapters.${RUBICON.value}.usersync.redirect.url" : "https://test.redirect.endpoint.com",
77-
"adapters.${RUBICON.value}.usersync.redirect.support-cors": CORS_SUPPORT as String,
78-
"adapters.${RUBICON.value}.usersync.iframe.url" : "https://test.iframe.endpoint.com&redir={{redirect_url}}",
79-
"adapters.${RUBICON.value}.usersync.iframe.support-cors" : CORS_SUPPORT as String]
74+
"adapters.${RUBICON.value}.usersync.iframe.url" : "https://test.iframe.endpoint.com&redir={{redirect_url}}"]
8075
private static final Map<String, String> OPENX_CONFIG = [
8176
"adapters.${OPENX.value}.enabled" : "true",
8277
"adapters.${OPENX.value}.usersync.cookie-family-name" : OPENX.value,
8378
"adapters.${OPENX.value}.usersync.redirect.url" : USER_SYNC_URL,
84-
"adapters.${OPENX.value}.usersync.redirect.support-cors": CORS_SUPPORT as String,
85-
"adapters.${OPENX.value}.usersync.iframe.url" : USER_SYNC_URL,
86-
"adapters.${OPENX.value}.usersync.iframe.support-cors" : CORS_SUPPORT as String]
79+
"adapters.${OPENX.value}.usersync.iframe.url" : USER_SYNC_URL]
8780
private static final Map<String, String> APPNEXUS_CONFIG = [
8881
"adapters.${APPNEXUS.value}.enabled" : "true",
8982
"adapters.${APPNEXUS.value}.usersync.cookie-family-name" : APPNEXUS.value,
90-
"adapters.${APPNEXUS.value}.usersync.redirect.url" : "https://test.appnexus.redirect.com/getuid?{{redirect_url}}",
91-
"adapters.${APPNEXUS.value}.usersync.redirect.support-cors": CORS_SUPPORT as String]
83+
"adapters.${APPNEXUS.value}.usersync.redirect.url" : "https://test.appnexus.redirect.com/getuid?{{redirect_url}}"]
9284
private static final Map<String, String> AAX_CONFIG = ["adapters.${AAX.value}.enabled": "true"]
9385
private static final Map<String, String> ACUITYADS_CONFIG = ["adapters.${ACUITYADS.value}.enabled": "true"]
9486
private static final Map<String, String> ADKERNEL_CONFIG = ["adapters.${ADKERNEL.value}.enabled": "true"]
@@ -501,7 +493,6 @@ class CookieSyncSpec extends BaseSpec {
501493
def bidderStatus = response.getBidderUserSync(GENERIC)
502494
assert bidderStatus?.userSync?.url?.startsWith(USER_SYNC_URL)
503495
assert bidderStatus?.userSync?.type == USER_SYNC_TYPE
504-
assert bidderStatus?.userSync?.supportCORS == CORS_SUPPORT
505496
assert bidderStatus?.noCookie == true
506497
}
507498

@@ -542,7 +533,6 @@ class CookieSyncSpec extends BaseSpec {
542533
def bidderStatus = response.getBidderUserSync(bidder)
543534
assert bidderStatus?.userSync?.url?.startsWith(USER_SYNC_URL)
544535
assert bidderStatus?.userSync?.type == USER_SYNC_TYPE
545-
assert bidderStatus?.userSync?.supportCORS == CORS_SUPPORT
546536
assert bidderStatus?.noCookie == true
547537
}
548538

@@ -593,7 +583,6 @@ class CookieSyncSpec extends BaseSpec {
593583
def configuredBidderStatus = response.getBidderUserSync(GENERIC)
594584
assert configuredBidderStatus?.userSync?.url?.startsWith(USER_SYNC_URL)
595585
assert configuredBidderStatus?.userSync?.type == USER_SYNC_TYPE
596-
assert configuredBidderStatus?.userSync?.supportCORS == CORS_SUPPORT
597586
assert configuredBidderStatus?.noCookie == true
598587
}
599588

@@ -675,7 +664,6 @@ class CookieSyncSpec extends BaseSpec {
675664
def mainBidderStatus = response.getBidderUserSync(GENERIC)
676665
assert mainBidderStatus?.userSync?.url?.startsWith(USER_SYNC_URL)
677666
assert mainBidderStatus?.userSync?.type == USER_SYNC_TYPE
678-
assert mainBidderStatus?.userSync?.supportCORS == CORS_SUPPORT
679667
assert mainBidderStatus?.noCookie == true
680668
}
681669

@@ -699,7 +687,6 @@ class CookieSyncSpec extends BaseSpec {
699687
response.bidderStatus.each {
700688
assert it.userSync?.url?.startsWith(USER_SYNC_URL)
701689
assert it.userSync?.type == USER_SYNC_TYPE
702-
assert it.userSync?.supportCORS == CORS_SUPPORT
703690
assert it.noCookie == true
704691
}
705692
}
@@ -1626,7 +1613,6 @@ class CookieSyncSpec extends BaseSpec {
16261613
def bidderStatus = response?.bidderStatus?.userSync
16271614
assert bidderStatus?.url
16281615
assert bidderStatus?.type
1629-
assert bidderStatus?.supportCORS?.every(it -> it == CORS_SUPPORT)
16301616
}
16311617

16321618
def "PBS cookie sync request shouldn't return sync url when active uids cookie is present for bidder"() {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ class HttpSettingsSpec extends BaseSpec {
194194
given: "Pbs config with adapters.generic.usersync.redirect.*"
195195
def pbsConfig = PbsConfig.httpSettingsConfig +
196196
["adapters.generic.usersync.redirect.url" : "$networkServiceContainer.rootUri/generic-usersync&redir={{redirect_url}}".toString(),
197-
"adapters.generic.usersync.redirect.support-cors" : "false",
198197
"adapters.generic.usersync.redirect.format-override": "blank"]
199198
def prebidServerService = pbsServiceFactory.getService(pbsConfig)
200199

@@ -230,7 +229,6 @@ class HttpSettingsSpec extends BaseSpec {
230229
['settings.http.endpoint': "${networkServiceContainer.rootUri}${HttpSettings.rfcEndpoint}".toString(),
231230
'settings.http.rfc3986-compatible': 'true',
232231
'adapters.generic.usersync.redirect.url' : "$networkServiceContainer.rootUri/generic-usersync&redir={{redirect_url}}".toString(),
233-
'adapters.generic.usersync.redirect.support-cors' : 'false',
234232
'adapters.generic.usersync.redirect.format-override': 'blank']
235233
def prebidServerService = pbsServiceFactory.getService(pbsConfig)
236234

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class SetUidSpec extends BaseSpec {
3535
private static final Integer MAX_NUMBER_OF_UID_COOKIES = 30
3636
private static final Integer UPDATED_EXPIRE_DAYS = 14
3737
private static final UserSyncInfo.Type USER_SYNC_TYPE = REDIRECT
38-
private static final boolean CORS_SUPPORT = false
3938
private static final Integer RANDOM_EXPIRE_DAY = PBSUtils.getRandomNumber(1, 10)
4039
private static final String USER_SYNC_URL = "$networkServiceContainer.rootUri/generic-usersync"
4140
private static final Map<String, String> PBS_CONFIG =
@@ -46,8 +45,7 @@ class SetUidSpec extends BaseSpec {
4645
"adapters.${OPENX.value}.usersync.cookie-family-name" : OPENX.value,
4746
"adapters.${APPNEXUS.value}.enabled" : "true",
4847
"adapters.${APPNEXUS.value}.usersync.cookie-family-name" : APPNEXUS.value,
49-
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.url" : USER_SYNC_URL,
50-
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.support-cors": CORS_SUPPORT.toString()]
48+
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.url" : USER_SYNC_URL]
5149
private static final Map<String, String> UID_COOKIES_CONFIG = ['setuid.number-of-uid-cookies': MAX_NUMBER_OF_UID_COOKIES.toString()]
5250
private static final Map<String, String> GENERIC_ALIAS_CONFIG = ["adapters.generic.aliases.alias.enabled" : "true",
5351
"adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()]

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ import static org.prebid.server.functional.testcontainers.Dependencies.networkSe
1212

1313
class UserSyncSpec extends BaseSpec {
1414

15-
private static final Map<String, String> GENERIC_USERSYNC_CONFIG = ["adapters.${GENERIC.value}.usersync.${IFRAME.value}.url" : "$networkServiceContainer.rootUri/generic-usersync&redir={{redirect_url}}".toString(),
16-
"adapters.${GENERIC.value}.usersync.${IFRAME.value}.support-cors": "false"]
15+
private static final Map<String, String> GENERIC_USERSYNC_CONFIG = ["adapters.${GENERIC.value}.usersync.${IFRAME.value}.url" : "$networkServiceContainer.rootUri/generic-usersync&redir={{redirect_url}}".toString()]
1716

1817
def "PBS should return usersync url with '#formatParam' format parameter for #userSyncFormat when format-override absent"() {
1918
given: "Pbs config with usersync.#userSyncFormat"
2019
def prebidServerService = pbsServiceFactory.getService(
21-
["adapters.generic.usersync.${userSyncFormat.value}.url" : "$networkServiceContainer.rootUri/generic-usersync&redir={{redirect_url}}".toString(),
22-
"adapters.generic.usersync.${userSyncFormat.value}.support-cors": "false"])
20+
["adapters.generic.usersync.${userSyncFormat.value}.url" : "$networkServiceContainer.rootUri/generic-usersync&redir={{redirect_url}}".toString()])
2321

2422
and: "Default CookieSyncRequest"
2523
def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest
@@ -42,7 +40,6 @@ class UserSyncSpec extends BaseSpec {
4240
given: "Pbs config with usersync.#userSyncFormat and iframe.format-override: #formatOverride"
4341
def prebidServerService = pbsServiceFactory.getService(
4442
["adapters.generic.usersync.${userSyncFormat.value}.url" : "$networkServiceContainer.rootUri/generic-usersync&redir={{redirect_url}}".toString(),
45-
"adapters.generic.usersync.${userSyncFormat.value}.support-cors" : "false",
4643
"adapters.generic.usersync.${userSyncFormat.value}.format-override": formatOverride.value])
4744

4845
and: "Default CookieSyncRequest"
@@ -68,7 +65,6 @@ class UserSyncSpec extends BaseSpec {
6865
given: "Pbs config with usersync.#userSyncFormat.url"
6966
def prebidServerService = pbsServiceFactory.getService(
7067
["adapters.generic.usersync.${userSyncFormat.value}.url" : "$networkServiceContainer.rootUri/generic-usersync&redir={{redirect_url}}".toString(),
71-
"adapters.generic.usersync.${userSyncFormat.value}.support-cors": "false",
7268
"adapters.generic.usersync.${userSyncFormat.value}.uid-macro" : null])
7369

7470
and: "Default CookieSyncRequest"

src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineBaseSpec.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ abstract class RuleEngineBaseSpec extends ModuleBaseSpec {
8585
private static final String USER_SYNC_URL = "$networkServiceContainer.rootUri/generic-usersync"
8686
private static final Map<String, String> GENERIC_CONFIG = [
8787
"adapters.${GENERIC.value}.usersync.redirect.url" : USER_SYNC_URL,
88-
"adapters.${GENERIC.value}.usersync.redirect.support-cors": false as String,
8988
"adapters.${GENERIC.value}.meta-info.vendor-id" : GENERIC_VENDOR_ID as String]
9089
protected static final PrebidServerService pbsServiceWithRulesEngineModule = pbsServiceFactory.getService(GENERIC_CONFIG +
9190
getRulesEngineSettings() + AMX_CONFIG + OPENX_CONFIG + OPENX_ALIAS_CONFIG + ['datacenter-region': CONFIG_DATA_CENTER] +

src/test/groovy/org/prebid/server/functional/tests/privacy/GdprSetUidSpec.groovy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ import static org.prebid.server.functional.util.privacy.TcfConsent.PurposeId.DEV
2929

3030
class GdprSetUidSpec extends PrivacyBaseSpec {
3131

32-
private static final boolean CORS_SUPPORT = false
3332
private static final String USER_SYNC_URL = "$networkServiceContainer.rootUri/generic-usersync"
3433
private static final UserSyncInfo.Type USER_SYNC_TYPE = REDIRECT
3534
private static final Map<String, String> VENDOR_GENERIC_PBS_CONFIG = GENERIC_VENDOR_CONFIG +
3635
["gdpr.purposes.p1.enforce-purpose" : NO.value,
37-
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.url" : USER_SYNC_URL,
38-
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.support-cors": CORS_SUPPORT.toString()]
36+
"adapters.${GENERIC.value}.usersync.${USER_SYNC_TYPE.value}.url" : USER_SYNC_URL]
3937
private static final String TCF_ERROR_MESSAGE = "The gdpr_consent param prevents cookies from being saved"
4038
private static final int UNAVAILABLE_FOR_LEGAL_REASONS_CODE = 451
4139

0 commit comments

Comments
 (0)