Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Bid implements ObjectMapperWrapper {
new Bid().tap {
id = UUID.randomUUID()
impid = imp.id
price = PBSUtils.getRandomPrice()
price = imp.bidFloor != null ? imp.bidFloor : PBSUtils.getRandomPrice()
crid = 1
height = imp.banner && imp.banner.format ? imp.banner.format.first().height : null
weight = imp.banner && imp.banner.format ? imp.banner.format.first().weight : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ abstract class PriceFloorsBaseSpec extends BaseSpec {
protected static final FloorsProvider floorsProvider = new FloorsProvider(networkServiceContainer)
protected final PrebidServerService floorsPbsService = pbsServiceFactory.getService(FLOORS_CONFIG + GENERIC_ALIAS_CONFIG)

protected static final Closure<String> INVALID_CONFIG_METRIC = { account -> "alerts.account_config.${account}.price-floors" }

protected static final Closure<String> URL_EMPTY_ERROR = { url -> "Failed to fetch price floor from provider for fetch.url '${url}'" }
protected static final Closure<String> URL_EMPTY_WARNING_MESSAGE = { url, message ->
"${URL_EMPTY_ERROR(url)}, with a reason: $message"
}
protected static final Closure<String> URL_EMPTY_ERROR_LOG = { bidRequest, message ->
"No price floor data for account ${bidRequest.accountId} and " +
"request ${bidRequest.id}, reason: ${URL_EMPTY_WARNING_MESSAGE("$BASIC_FETCH_URL$bidRequest.accountId", message)}"
}
protected static final String FETCHING_DISABLED_ERROR = "Fetching is disabled"
protected static final Closure<String> FETCHING_DISABLED_WARNING_MESSAGE = { message ->
"$FETCHING_DISABLED_ERROR. Following parsing of request price floors is failed: $message"
}
protected static final Closure<String> FETCHING_DISABLED_ERROR_LOG = { bidRequest, message ->
"No price floor data for account ${bidRequest.accountId} and " +
"request ${bidRequest.id}, reason: ${FETCHING_DISABLED_WARNING_MESSAGE(message)}"
}

def setupSpec() {
floorsProvider.setResponse()
}
Expand Down
Loading
Loading