@@ -3,7 +3,6 @@ package org.prebid.server.functional.tests
33import org.prebid.server.functional.model.config.AccountAuctionConfig
44import org.prebid.server.functional.model.config.AccountConfig
55import org.prebid.server.functional.model.config.AccountEventsConfig
6- import org.prebid.server.functional.model.config.AuctionCacheConfig
76import org.prebid.server.functional.model.db.Account
87import org.prebid.server.functional.model.request.auction.Asset
98import org.prebid.server.functional.model.request.auction.BidRequest
@@ -15,7 +14,6 @@ import org.prebid.server.functional.model.response.auction.Adm
1514import org.prebid.server.functional.model.response.auction.BidResponse
1615import org.prebid.server.functional.util.PBSUtils
1716
18- import static org.prebid.server.functional.model.AccountStatus.ACTIVE
1917import static org.prebid.server.functional.model.response.auction.MediaType.BANNER
2018import static org.prebid.server.functional.model.response.auction.MediaType.VIDEO
2119
@@ -494,59 +492,4 @@ class CacheSpec extends BaseSpec {
494492 PBSUtils . getRandomCase(" inline " ) | " ${ PBSUtils.getRandomCase(" impression ")} $PBSUtils . randomNumber "
495493 " inline ${ PBSUtils.getRandomString()} " | " ImpreSSion "
496494 }
497-
498- def " PBS should cache bids from auction when account config for auction.cache disabled" () {
499- given : " Default BidRequest with cache, targeting"
500- def bidRequest = BidRequest . defaultBidRequest. tap {
501- it. enableCache()
502- it. ext. prebid. targeting = Targeting . createWithAllValuesSetTo(true )
503- }
504-
505- and : " Account in the DB"
506- def accountAuctionConfig = new AccountAuctionConfig (cache : new AuctionCacheConfig (enabled : false ))
507- def accountConfig = new AccountConfig (status : ACTIVE , auction : accountAuctionConfig)
508- def account = new Account (uuid : bidRequest. accountId, config : accountConfig)
509- accountDao. save(account)
510-
511- when : " PBS processes auction request"
512- defaultPbsService. sendAuctionRequest(bidRequest)
513-
514- then : " PBS should call PBC"
515- assert prebidCache. getRequestCount(bidRequest. imp[0 ]. id) == 1
516-
517- and : " PBS call shouldn't include api-key"
518- assert ! prebidCache. getRequestHeaders(bidRequest. imp[0 ]. id)[PBS_API_HEADER ]
519- }
520-
521- def " PBS should call still call vtrack endpoint when cache is disabled in account config" () {
522- given : " Current value of metric prebid_cache.requests.ok"
523- def initialValue = getCurrentMetricValue(defaultPbsService, CACHE_REQUEST_OK_GLOBAL_METRIC )
524-
525- and : " Account in the DB"
526- def accountId = PBSUtils . randomNumber. toString()
527- def accountAuctionConfig = new AccountAuctionConfig (cache : new AuctionCacheConfig (enabled : false ))
528- def accountConfig = new AccountConfig (status : ACTIVE , auction : accountAuctionConfig)
529- def account = new Account (uuid : accountId, config : accountConfig)
530- accountDao. save(account)
531-
532- and : " Default VtrackRequest"
533- def creative = encodeXml(Vast . getDefaultVastModel(PBSUtils . randomString))
534- def request = VtrackRequest . getDefaultVtrackRequest(creative)
535-
536- when : " PBS processes vtrack request"
537- def cacheResponse = defaultPbsService. sendVtrackRequest(request, accountId)
538-
539- then : " vtrack request should be called"
540- assert cacheResponse
541-
542- and : " prebid_cache.creative_size.xml metric should be updated"
543- def metrics = defaultPbsService. sendCollectedMetricsRequest()
544- def creativeSize = creative. bytes. length
545- assert metrics[CACHE_REQUEST_OK_GLOBAL_METRIC ] == initialValue + 1
546- assert metrics[XML_CREATIVE_SIZE_GLOBAL_METRIC ] == creativeSize
547-
548- and : " account.<account-id>.prebid_cache.creative_size.xml should be updated"
549- assert metrics[CACHE_REQUEST_OK_ACCOUNT_METRIC . formatted(accountId)] == 1
550- assert metrics[XML_CREATIVE_SIZE_ACCOUNT_METRIC . formatted(accountId)] == creativeSize
551- }
552495}
0 commit comments