Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ abstract class BaseSpec extends Specification implements ObjectMapperWrapper {
private static final int MIN_TIMEOUT = DEFAULT_TIMEOUT
private static final int DEFAULT_TARGETING_PRECISION = 1
private static final String DEFAULT_CACHE_DIRECTORY = "/app/prebid-server/data"
protected static final String ALERT_GENERAL = "alerts.general"
protected static final Map<String, String> GENERIC_ALIAS_CONFIG = ["adapters.generic.aliases.alias.enabled" : "true",
"adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class BidValidationSpec extends BaseSpec {

and: "Bid validation metric value is incremented"
def metrics = strictPrebidService.sendCollectedMetricsRequest()
assert metrics["alerts.general"] == 1
assert metrics[ALERT_GENERAL] == 1

where:
bidRequest << [BidRequest.getDefaultBidRequest(DistributionChannel.APP).tap {
Expand Down Expand Up @@ -105,7 +105,7 @@ class BidValidationSpec extends BaseSpec {

and: "Bid validation metric value is incremented"
def metrics = softPrebidService.sendCollectedMetricsRequest()
assert metrics["alerts.general"] == 1
assert metrics[ALERT_GENERAL] == 1

and: "PBS log should contain message"
def logs = softPrebidService.getLogsByTime(startTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class MetricsSpec extends BaseSpec {
assert metrics["adapter.generic.requests.type.openrtb2-dooh" as String] == 1

and: "alert.general metric should be updated"
assert metrics["alerts.general" as String] == 1
assert metrics[ALERT_GENERAL] == 1

and: "Other channel types should not be populated"
assert !metrics["account.${accountId}.requests.type.openrtb2-web" as String]
Expand Down Expand Up @@ -175,7 +175,7 @@ class MetricsSpec extends BaseSpec {
assert metrics["adapter.generic.requests.type.openrtb2-app" as String] == 1

and: "alert.general metric should be updated"
assert metrics["alerts.general" as String] == 1
assert metrics[ALERT_GENERAL] == 1

and: "Other channel types should not be populated"
assert !metrics["account.${accountId}.requests.type.openrtb2-dooh" as String]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class OpenxSpec extends BaseSpec {

and: "Alert.general metric should be updated"
def metrics = pbsService.sendCollectedMetricsRequest()
assert metrics["alerts.general" as String] == 1
assert metrics[ALERT_GENERAL] == 1
}

def "PBS shouldn't populate fledge or igi config when bidder respond with igb"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.prebid.server.functional.model.request.auction.BidRequest
import org.prebid.server.functional.model.request.auction.BidRequestExt
import org.prebid.server.functional.model.request.auction.DistributionChannel
import org.prebid.server.functional.model.request.auction.ExtPrebidFloors
import org.prebid.server.functional.model.request.auction.FetchStatus
import org.prebid.server.functional.model.request.auction.Prebid
import org.prebid.server.functional.model.request.auction.Video
import org.prebid.server.functional.model.response.currencyrates.CurrencyRatesResponse
Expand All @@ -34,8 +35,7 @@ abstract class PriceFloorsBaseSpec extends BaseSpec {

public static final BigDecimal FLOOR_MIN = 0.5
public static final BigDecimal FLOOR_MAX = 2
public static final Map<String, String> FLOORS_CONFIG = ["price-floors.enabled" : "true",
"settings.default-account-config": encode(defaultAccountConfigSettings)]
public static final Map<String, String> FLOORS_CONFIG = ["price-floors.enabled": "true"]

protected static final String BASIC_FETCH_URL = networkServiceContainer.rootUri + FloorsProvider.FLOORS_ENDPOINT
protected static final int MAX_MODEL_WEIGHT = 100
Expand Down Expand Up @@ -121,8 +121,9 @@ abstract class PriceFloorsBaseSpec extends BaseSpec {

protected void cacheFloorsProviderRules(BidRequest bidRequest,
PrebidServerService pbsService = floorsPbsService,
BidderName bidderName = BidderName.GENERIC) {
PBSUtils.waitUntil({ getRequests(pbsService.sendAuctionRequest(bidRequest))[bidderName.value]?.first?.ext?.prebid?.floors?.fetchStatus != INPROGRESS },
BidderName bidderName = BidderName.GENERIC,
FetchStatus fetchStatus = INPROGRESS) {
PBSUtils.waitUntil({ getRequests(pbsService.sendAuctionRequest(bidRequest))[bidderName.value]?.first?.ext?.prebid?.floors?.fetchStatus != fetchStatus },
5000,
1000)
}
Expand Down
Loading