@@ -13,8 +13,6 @@ import org.prebid.server.functional.model.request.auction.BidRequest
13
13
import org.prebid.server.functional.model.request.auction.DistributionChannel
14
14
import org.prebid.server.functional.model.request.auction.Regs
15
15
import org.prebid.server.functional.model.request.auction.RegsExt
16
- import org.prebid.server.functional.service.PrebidServerService
17
- import org.prebid.server.functional.testcontainers.container.PrebidServerContainer
18
16
import org.prebid.server.functional.util.PBSUtils
19
17
import org.prebid.server.functional.util.privacy.BogusConsent
20
18
import org.prebid.server.functional.util.privacy.CcpaConsent
@@ -320,10 +318,8 @@ class GdprAmpSpec extends PrivacyBaseSpec {
320
318
def startTime = Instant . now()
321
319
322
320
and : " Create new container"
323
- def serverContainer = new PrebidServerContainer (GDPR_VENDOR_LIST_CONFIG +
324
- [" adapters.generic.meta-info.vendor-id" : GENERIC_VENDOR_ID as String ])
325
- serverContainer. start()
326
- def privacyPbsService = new PrebidServerService (serverContainer)
321
+ def config = GDPR_VENDOR_LIST_CONFIG + [" adapters.generic.meta-info.vendor-id" : GENERIC_VENDOR_ID as String ]
322
+ def defaultPrivacyPbsService = pbsServiceFactory. getService(config)
327
323
328
324
and : " Prepare tcf consent string"
329
325
def tcfConsent = new TcfConsent.Builder ()
@@ -347,21 +343,21 @@ class GdprAmpSpec extends PrivacyBaseSpec {
347
343
vendorListResponse. setResponse(tcfPolicyVersion)
348
344
349
345
when : " PBS processes amp request"
350
- privacyPbsService . sendAmpRequest(ampRequest)
346
+ defaultPrivacyPbsService . sendAmpRequest(ampRequest)
351
347
352
348
then : " Used vendor list have proper specification version of GVL"
353
349
def properVendorListPath = VENDOR_LIST_PATH . replace(" {VendorVersion}" , tcfPolicyVersion. vendorListVersion. toString())
354
- PBSUtils . waitUntil { privacyPbsService . isFileExist(properVendorListPath) }
355
- def vendorList = privacyPbsService . getValueFromContainer(properVendorListPath, VendorListConsent . class)
350
+ PBSUtils . waitUntil { defaultPrivacyPbsService . isFileExist(properVendorListPath) }
351
+ def vendorList = defaultPrivacyPbsService . getValueFromContainer(properVendorListPath, VendorListConsent . class)
356
352
assert vendorList. tcfPolicyVersion == tcfPolicyVersion. vendorListVersion
357
353
358
354
and : " Logs should contain proper vendor list version"
359
- def logs = privacyPbsService . getLogsByTime(startTime)
355
+ def logs = defaultPrivacyPbsService . getLogsByTime(startTime)
360
356
assert getLogsByText(logs, " Created new TCF 2 vendor list for version " +
361
357
" v${ tcfPolicyVersion.vendorListVersion} .${ tcfPolicyVersion.vendorListVersion} " )
362
358
363
- cleanup : " Stop container with default request "
364
- serverContainer . stop( )
359
+ cleanup : " Stop and remove pbs container "
360
+ pbsServiceFactory . removeContainer(config )
365
361
366
362
where :
367
363
tcfPolicyVersion << [TCF_POLICY_V2 , TCF_POLICY_V4 , TCF_POLICY_V5 ]
@@ -410,7 +406,10 @@ class GdprAmpSpec extends PrivacyBaseSpec {
410
406
}
411
407
412
408
def " PBS amp should emit the same error without a second GVL list request if a retry is too soon for the exponential-backoff" () {
413
- given : " Test start time"
409
+ given : " Prebid server with privacy settings"
410
+ def defaultPrivacyPbsService = pbsServiceFactory. getService(GENERAL_PRIVACY_CONFIG )
411
+
412
+ and : " Test start time"
414
413
def startTime = Instant . now()
415
414
416
415
and : " Prepare tcf consent string"
@@ -438,33 +437,36 @@ class GdprAmpSpec extends PrivacyBaseSpec {
438
437
vendorListResponse. setResponse(tcfPolicyVersion, Delay . seconds(EXPONENTIAL_BACKOFF_MAX_DELAY + 3 ))
439
438
440
439
when : " PBS processes amp request"
441
- privacyPbsService . sendAmpRequest(ampRequest)
440
+ defaultPrivacyPbsService . sendAmpRequest(ampRequest)
442
441
443
442
then : " PBS shouldn't fetch vendor list"
444
443
def vendorListPath = VENDOR_LIST_PATH . replace(" {VendorVersion}" , tcfPolicyVersion. vendorListVersion. toString())
445
- assert ! privacyPbsService . isFileExist(vendorListPath)
444
+ assert ! defaultPrivacyPbsService . isFileExist(vendorListPath)
446
445
447
446
and : " Logs should contain proper vendor list version"
448
- def logs = privacyPbsService . getLogsByTime(startTime)
447
+ def logs = defaultPrivacyPbsService . getLogsByTime(startTime)
449
448
def tcfError = " TCF 2 vendor list for version v${ tcfPolicyVersion.vendorListVersion} .${ tcfPolicyVersion.vendorListVersion} not found, started downloading."
450
449
assert getLogsByText(logs, tcfError)
451
450
452
451
and : " Second start for fetch second round of logs"
453
452
def secondStartTime = Instant . now()
454
453
455
454
when : " PBS processes amp request"
456
- privacyPbsService . sendAmpRequest(ampRequest)
455
+ defaultPrivacyPbsService . sendAmpRequest(ampRequest)
457
456
458
457
then : " PBS shouldn't fetch vendor list"
459
- assert ! privacyPbsService . isFileExist(vendorListPath)
458
+ assert ! defaultPrivacyPbsService . isFileExist(vendorListPath)
460
459
461
460
and : " Logs should contain proper vendor list version"
462
- def logsSecond = privacyPbsService . getLogsByTime(secondStartTime)
461
+ def logsSecond = defaultPrivacyPbsService . getLogsByTime(secondStartTime)
463
462
assert getLogsByText(logsSecond, tcfError)
464
463
465
464
and : " Reset vendor list response"
466
465
vendorListResponse. reset()
467
466
467
+ cleanup : " Stop and remove pbs container"
468
+ pbsServiceFactory. removeContainer(GENERAL_PRIVACY_CONFIG )
469
+
468
470
where :
469
471
tcfPolicyVersion << [TCF_POLICY_V2 , TCF_POLICY_V4 , TCF_POLICY_V5 ]
470
472
}
@@ -659,7 +661,10 @@ class GdprAmpSpec extends PrivacyBaseSpec {
659
661
}
660
662
661
663
def " PBS amp should set 3 for tcfPolicyVersion when tcfPolicyVersion is #tcfPolicyVersion" () {
662
- given : " Tcf consent setup"
664
+ given : " Prebid server with privacy settings"
665
+ def defaultPrivacyPbsService = pbsServiceFactory. getService(GENERAL_PRIVACY_CONFIG )
666
+
667
+ and : " Tcf consent setup"
663
668
def tcfConsent = new TcfConsent.Builder ()
664
669
.setPurposesLITransparency(BASIC_ADS )
665
670
.setTcfPolicyVersion(tcfPolicyVersion. value)
@@ -681,14 +686,17 @@ class GdprAmpSpec extends PrivacyBaseSpec {
681
686
vendorListResponse. setResponse(tcfPolicyVersion)
682
687
683
688
when : " PBS processes amp request"
684
- privacyPbsService . sendAmpRequest(ampRequest)
689
+ defaultPrivacyPbsService . sendAmpRequest(ampRequest)
685
690
686
691
then : " Used vendor list have proper specification version of GVL"
687
692
def properVendorListPath = VENDOR_LIST_PATH . replace(" {VendorVersion}" , tcfPolicyVersion. vendorListVersion. toString())
688
- PBSUtils . waitUntil { privacyPbsService . isFileExist(properVendorListPath) }
689
- def vendorList = privacyPbsService . getValueFromContainer(properVendorListPath, VendorListConsent . class)
693
+ PBSUtils . waitUntil { defaultPrivacyPbsService . isFileExist(properVendorListPath) }
694
+ def vendorList = defaultPrivacyPbsService . getValueFromContainer(properVendorListPath, VendorListConsent . class)
690
695
assert vendorList. gvlSpecificationVersion == V3
691
696
697
+ cleanup : " Stop and remove pbs container"
698
+ pbsServiceFactory. removeContainer(GENERAL_PRIVACY_CONFIG )
699
+
692
700
where :
693
701
tcfPolicyVersion << [TCF_POLICY_V4 , TCF_POLICY_V5 ]
694
702
}
0 commit comments