Skip to content

Commit

Permalink
Test: response correction module (#3432)
Browse files Browse the repository at this point in the history
  • Loading branch information
marki1an authored Sep 17, 2024
1 parent 7e961f9 commit d4f86cb
Show file tree
Hide file tree
Showing 9 changed files with 549 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue

enum ModuleName {

PB_RICHMEDIA_FILTER('pb-richmedia-filter'),
ORTB2_BLOCKING('ortb2-blocking')
PB_RICHMEDIA_FILTER("pb-richmedia-filter"),
PB_RESPONSE_CORRECTION ("pb-response-correction"),
ORTB2_BLOCKING("ortb2-blocking")

@JsonValue
final String code
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.prebid.server.functional.model.config

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.databind.annotation.JsonNaming
import groovy.transform.ToString
import org.prebid.server.functional.model.bidder.BidderName

@ToString(includeNames = true, ignoreNulls = true)
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy)
class AppVideoHtml {

Boolean enabled
List<BidderName> excludedBidders
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.prebid.server.functional.model.ModuleName
enum ModuleHookImplementation {

PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES("pb-richmedia-filter-all-processed-bid-responses-hook"),
RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES("pb-response-correction-all-processed-bid-responses-hook"),
ORTB2_BLOCKING_BIDDER_REQUEST("ortb2-blocking-bidder-request"),
ORTB2_BLOCKING_RAW_BIDDER_RESPONSE("ortb2-blocking-raw-bidder-response")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.prebid.server.functional.model.config

import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.databind.annotation.JsonNaming
import groovy.transform.ToString

@ToString(includeNames = true, ignoreNulls = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.prebid.server.functional.model.config

import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.databind.annotation.JsonNaming
import groovy.transform.ToString

@ToString(includeNames = true, ignoreNulls = true)
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy)
class PbResponseCorrection {

Boolean enabled
AppVideoHtml appVideoHtml
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ class PbsModulesConfig {

RichmediaFilter pbRichmediaFilter
Ortb2BlockingConfig ortb2Blocking
PbResponseCorrection pbResponseCorrection
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.prebid.server.functional.model.config.ExecutionPlan
import org.prebid.server.functional.tests.BaseSpec

import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
import static org.prebid.server.functional.model.ModuleName.PB_RESPONSE_CORRECTION
import static org.prebid.server.functional.model.ModuleName.PB_RICHMEDIA_FILTER
import static org.prebid.server.functional.model.config.Endpoint.OPENRTB2_AUCTION
import static org.prebid.server.functional.model.config.Stage.ALL_PROCESSED_BID_RESPONSES
Expand All @@ -22,6 +23,12 @@ class ModuleBaseSpec extends BaseSpec {
repository.removeAllDatabaseData()
}

protected static Map<String, String> getResponseCorrectionConfig(Endpoint endpoint = OPENRTB2_AUCTION) {
["hooks.${PB_RESPONSE_CORRECTION.code}.enabled" : true,
"hooks.host-execution-plan" : encode(ExecutionPlan.getSingleEndpointExecutionPlan(endpoint, PB_RESPONSE_CORRECTION, [ALL_PROCESSED_BID_RESPONSES]))]
.collectEntries { key, value -> [(key.toString()): value.toString()] }
}

protected static Map<String, String> getRichMediaFilterSettings(String scriptPattern,
boolean filterMraidEnabled = true,
Endpoint endpoint = OPENRTB2_AUCTION) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.prebid.server.functional.tests.module
package org.prebid.server.functional.tests.module.analyticstag

import org.prebid.server.functional.model.config.AccountAnalyticsConfig
import org.prebid.server.functional.model.config.AccountConfig
Expand All @@ -16,6 +16,7 @@ import org.prebid.server.functional.model.request.auction.StoredBidResponse
import org.prebid.server.functional.model.response.auction.BidResponse
import org.prebid.server.functional.model.response.auction.ModuleActivityName
import org.prebid.server.functional.service.PrebidServerService
import org.prebid.server.functional.tests.module.ModuleBaseSpec
import org.prebid.server.functional.util.PBSUtils

import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
Expand Down
Loading

0 comments on commit d4f86cb

Please sign in to comment.