File tree Expand file tree Collapse file tree
src/test/groovy/org/prebid/server/functional/tests/module/optabletargeting Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,7 +110,10 @@ class CacheStorageSpec extends ModuleBaseSpec {
110110 }
111111
112112 def " PBS should update metrics for new saved text storage cache when no cached requests" () {
113- given : " Default BidRequest with cache and device info"
113+ given : " Current value of metric prebid cache"
114+ def okInitialValue = getCurrentMetricValue(prebidServerStoredCacheService, METRIC_CREATIVE_WRITE_OK )
115+
116+ and : " Default BidRequest with cache and device info"
114117 def randomIfa = PBSUtils . randomString
115118 def system = PBSUtils . getRandomEnum(OperatingSystem )
116119 def bidRequest = getBidRequestForModuleCacheStorage(randomIfa, system)
@@ -133,8 +136,10 @@ class CacheStorageSpec extends ModuleBaseSpec {
133136 then : " PBS should update metrics for new saved text storage cache"
134137 def metrics = prebidServerStoredCacheService. sendCollectedMetricsRequest()
135138 assert metrics[METRIC_CREATIVE_SIZE_TEXT ] == new String (encodeBase64(encode(targetingResult). bytes)). size()
136- assert metrics[METRIC_CREATIVE_WRITE_OK ] == 1
137- assert metrics[METRIC_CREATIVE_TTL_TEXT ] == targetingConfig. cache. ttlSeconds
139+ assert metrics[METRIC_CREATIVE_WRITE_OK ] == okInitialValue + 1
140+
141+ and : " PBS should include histogram metric"
142+ assert metrics[METRIC_CREATIVE_TTL_TEXT ]
138143 }
139144
140145 def " PBS should update metrics for stored cached requests cache when proper record present" () {
You can’t perform that action at this time.
0 commit comments