Skip to content

Commit 1bde116

Browse files
committed
update after review
1 parent a91973e commit 1bde116

7 files changed

Lines changed: 218 additions & 218 deletions

File tree

src/test/groovy/org/prebid/server/functional/model/ModuleName.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ enum ModuleName {
66

77
PB_RICHMEDIA_FILTER("pb-richmedia-filter"),
88
PB_RESPONSE_CORRECTION ("pb-response-correction"),
9-
ORTB2_BLOCKING("pb-ortb2-blocking"),
9+
PB_ORTB2_BLOCKING("pb-ortb2-blocking"),
1010
PB_REQUEST_CORRECTION('pb-request-correction'),
11-
OPTABLE_TARGETING('pb-optable-targeting'),
11+
PB_OPTABLE_TARGETING('pb-optable-targeting'),
1212
PB_RULE_ENGINE('pb-rule-engine')
1313

1414
@JsonValue

src/test/groovy/org/prebid/server/functional/tests/module/AbTestingModuleSpec.groovy

Lines changed: 118 additions & 118 deletions
Large diffs are not rendered by default.

src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy

Lines changed: 66 additions & 66 deletions
Large diffs are not rendered by default.

src/test/groovy/org/prebid/server/functional/tests/module/ModuleBaseSpec.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import org.prebid.server.functional.model.response.auction.BidResponse
99
import org.prebid.server.functional.tests.BaseSpec
1010
import org.prebid.server.functional.util.PBSUtils
1111

12-
import static org.prebid.server.functional.model.ModuleName.OPTABLE_TARGETING
13-
import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
12+
import static org.prebid.server.functional.model.ModuleName.PB_OPTABLE_TARGETING
13+
import static org.prebid.server.functional.model.ModuleName.PB_ORTB2_BLOCKING
1414
import static org.prebid.server.functional.model.ModuleName.PB_REQUEST_CORRECTION
1515
import static org.prebid.server.functional.model.ModuleName.PB_RESPONSE_CORRECTION
1616
import static org.prebid.server.functional.model.ModuleName.PB_RICHMEDIA_FILTER
@@ -76,16 +76,16 @@ class ModuleBaseSpec extends BaseSpec {
7676
}
7777

7878
protected static Map<String, String> getOptableTargetingSettings(boolean isEnabled = true, Endpoint endpoint = OPENRTB2_AUCTION) {
79-
["hooks.${OPTABLE_TARGETING.code}.enabled": isEnabled as String,
80-
"hooks.modules.${OPTABLE_TARGETING.code}.api-endpoint" : "$networkServiceContainer.rootUri/stored-cache".toString(),
81-
"hooks.modules.${OPTABLE_TARGETING.code}.tenant" : PBSUtils.randomString,
82-
"hooks.modules.${OPTABLE_TARGETING.code}.origin" : PBSUtils.randomString,
83-
"hooks.host-execution-plan" : encode(ExecutionPlan.getSingleEndpointExecutionPlan(endpoint, [(PROCESSED_AUCTION_REQUEST): [OPTABLE_TARGETING]]))]
79+
["hooks.${PB_OPTABLE_TARGETING.code}.enabled" : isEnabled as String,
80+
"hooks.modules.${PB_OPTABLE_TARGETING.code}.api-endpoint": "$networkServiceContainer.rootUri/stored-cache".toString(),
81+
"hooks.modules.${PB_OPTABLE_TARGETING.code}.tenant" : PBSUtils.randomString,
82+
"hooks.modules.${PB_OPTABLE_TARGETING.code}.origin" : PBSUtils.randomString,
83+
"hooks.host-execution-plan" : encode(ExecutionPlan.getSingleEndpointExecutionPlan(endpoint, [(PROCESSED_AUCTION_REQUEST): [PB_OPTABLE_TARGETING]]))]
8484
.collectEntries { key, value -> [(key.toString()): value.toString()] }
8585
}
8686

8787
protected static Map<String, String> getOrtb2BlockingSettings(boolean isEnabled = true) {
88-
["hooks.${ORTB2_BLOCKING.code}.enabled": isEnabled as String]
88+
["hooks.${PB_ORTB2_BLOCKING.code}.enabled": isEnabled as String]
8989
}
9090

9191
protected static Map<String, String> getRequestCorrectionSettings(Endpoint endpoint = OPENRTB2_AUCTION, Stage stage = PROCESSED_AUCTION_REQUEST) {

src/test/groovy/org/prebid/server/functional/tests/module/analyticstag/AnalyticsTagsModuleSpec.groovy

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import org.prebid.server.functional.service.PrebidServerService
1919
import org.prebid.server.functional.tests.module.ModuleBaseSpec
2020
import org.prebid.server.functional.util.PBSUtils
2121

22-
import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
22+
import static org.prebid.server.functional.model.ModuleName.PB_ORTB2_BLOCKING
2323
import static org.prebid.server.functional.model.ModuleName.PB_RICHMEDIA_FILTER
2424
import static org.prebid.server.functional.model.bidder.BidderName.GENERIC
2525
import static org.prebid.server.functional.model.config.Endpoint.OPENRTB2_AUCTION
@@ -43,7 +43,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
4343
}
4444

4545
and: "Account in the DB"
46-
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
46+
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
4747
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
4848
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
4949
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -55,7 +55,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
5555
then: "Bid response should contain ext.prebid.analyticsTags with module record"
5656
def analyticsTagPrebid = bidResponse.ext.prebid.analytics.tags.first
5757
assert analyticsTagPrebid.stage == RAW_BIDDER_RESPONSE.value
58-
assert analyticsTagPrebid.module == ORTB2_BLOCKING.code
58+
assert analyticsTagPrebid.module == PB_ORTB2_BLOCKING.code
5959

6060
and: "Analytics tag should contain results with name and success status"
6161
def analyticResult = analyticsTagPrebid.analyticsTags.activities.first
@@ -122,7 +122,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
122122

123123
def "PBS should include analytics tag in response when request and default account allow client details"() {
124124
given: "Default account with module config"
125-
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
125+
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
126126
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
127127
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
128128

@@ -141,7 +141,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
141141
then: "Bid response should contain ext.prebid.analyticsTags with module record"
142142
def analyticsTagPrebid = bidResponse.ext.prebid.analytics.tags.first
143143
assert analyticsTagPrebid.stage == RAW_BIDDER_RESPONSE.value
144-
assert analyticsTagPrebid.module == ORTB2_BLOCKING.code
144+
assert analyticsTagPrebid.module == PB_ORTB2_BLOCKING.code
145145

146146
and: "Analytics tag should contain results with name and success status"
147147
def analyticResult = analyticsTagPrebid.analyticsTags.activities.first
@@ -161,7 +161,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
161161

162162
def "PBS should include analytics tag in response when request and account allow client details but default doesn't"() {
163163
given: "Default account with module config"
164-
def defaultExecutionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
164+
def defaultExecutionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
165165
def defaultHooksConfiguration = new AccountHooksConfiguration(executionPlan: defaultExecutionPlan)
166166
def defaultAccountConfig = new AccountConfig(hooks: defaultHooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: false))
167167

@@ -175,7 +175,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
175175
}
176176

177177
and: "Account in the DB"
178-
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
178+
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
179179
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
180180
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
181181
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -187,7 +187,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
187187
then: "Bid response should contain ext.prebid.analyticsTags with module record"
188188
def analyticsTagPrebid = bidResponse.ext.prebid.analytics.tags.first
189189
assert analyticsTagPrebid.stage == RAW_BIDDER_RESPONSE.value
190-
assert analyticsTagPrebid.module == ORTB2_BLOCKING.code
190+
assert analyticsTagPrebid.module == PB_ORTB2_BLOCKING.code
191191

192192
and: "Analytics tag should contain results with name and success status"
193193
def analyticResult = analyticsTagPrebid.analyticsTags.activities.first
@@ -212,7 +212,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
212212
}
213213

214214
and: "Account in the DB"
215-
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
215+
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
216216
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
217217
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
218218
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -235,7 +235,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
235235
}
236236

237237
and: "Account in the DB"
238-
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
238+
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
239239
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
240240
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
241241
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -258,7 +258,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
258258
}
259259

260260
and: "Account in the DB"
261-
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
261+
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
262262
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
263263
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: false))
264264
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -282,7 +282,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
282282
}
283283

284284
and: "Account in the DB"
285-
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
285+
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
286286
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
287287
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: false))
288288
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)

src/test/groovy/org/prebid/server/functional/tests/module/pboptabletargeting/CacheStorageSpec.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ import org.prebid.server.functional.util.PBSUtils
2121

2222
import static org.apache.commons.codec.binary.Base64.encodeBase64
2323
import static org.mockserver.model.HttpStatusCode.NOT_FOUND_404
24-
import static org.prebid.server.functional.model.ModuleName.OPTABLE_TARGETING
24+
import static org.prebid.server.functional.model.ModuleName.PB_OPTABLE_TARGETING
2525
import static org.prebid.server.functional.testcontainers.Dependencies.getNetworkServiceContainer
2626

2727
class CacheStorageSpec extends ModuleBaseSpec {
2828

29-
private static final String METRIC_CREATIVE_SIZE_TEXT = "prebid_cache.module_storage.${OPTABLE_TARGETING.code}.entry_size.text"
30-
private static final String METRIC_CREATIVE_TTL_TEXT = "prebid_cache.module_storage.${OPTABLE_TARGETING.code}.entry_ttl.text"
29+
private static final String METRIC_CREATIVE_SIZE_TEXT = "prebid_cache.module_storage.${PB_OPTABLE_TARGETING.code}.entry_size.text"
30+
private static final String METRIC_CREATIVE_TTL_TEXT = "prebid_cache.module_storage.${PB_OPTABLE_TARGETING.code}.entry_ttl.text"
3131

32-
private static final String METRIC_CREATIVE_READ_OK = "prebid_cache.module_storage.${OPTABLE_TARGETING.code}.read.ok"
33-
private static final String METRIC_CREATIVE_READ_ERR = "prebid_cache.module_storage.${OPTABLE_TARGETING.code}.read.err"
34-
private static final String METRIC_CREATIVE_WRITE_OK = "prebid_cache.module_storage.${OPTABLE_TARGETING.code}.write.ok"
35-
private static final String METRIC_CREATIVE_WRITE_ERR = "prebid_cache.module_storage.${OPTABLE_TARGETING.code}.write.err"
32+
private static final String METRIC_CREATIVE_READ_OK = "prebid_cache.module_storage.${PB_OPTABLE_TARGETING.code}.read.ok"
33+
private static final String METRIC_CREATIVE_READ_ERR = "prebid_cache.module_storage.${PB_OPTABLE_TARGETING.code}.read.err"
34+
private static final String METRIC_CREATIVE_WRITE_OK = "prebid_cache.module_storage.${PB_OPTABLE_TARGETING.code}.write.ok"
35+
private static final String METRIC_CREATIVE_WRITE_ERR = "prebid_cache.module_storage.${PB_OPTABLE_TARGETING.code}.write.err"
3636

3737
private static final StoredCache storedCache = new StoredCache(networkServiceContainer)
3838

src/test/groovy/org/prebid/server/functional/tests/module/pbortb2blocking/PbOrtb2BlockingSpec.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import org.prebid.server.functional.service.PrebidServerService
3333
import org.prebid.server.functional.tests.module.ModuleBaseSpec
3434
import org.prebid.server.functional.util.PBSUtils
3535

36-
import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
36+
import static org.prebid.server.functional.model.ModuleName.PB_ORTB2_BLOCKING
3737
import static org.prebid.server.functional.model.bidder.BidderName.ALIAS
3838
import static org.prebid.server.functional.model.bidder.BidderName.GENERIC
3939
import static org.prebid.server.functional.model.bidder.BidderName.IX
@@ -284,7 +284,7 @@ class PbOrtb2BlockingSpec extends ModuleBaseSpec {
284284
def response = pbsServiceWithEnabledOrtb2Blocking.sendAuctionRequest(bidRequest)
285285

286286
then: "PBS response should contain seatNonBid for the called bidder"
287-
assert response.ext.prebid.modules.errors.pbOrtb2Blocking["${ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"].first
287+
assert response.ext.prebid.modules.errors.pbOrtb2Blocking["${PB_ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"].first
288288
.contains("field in account configuration is not an array")
289289

290290
and: "PBS response shouldn't contain any module warning"
@@ -317,7 +317,7 @@ class PbOrtb2BlockingSpec extends ModuleBaseSpec {
317317
def response = pbsServiceWithEnabledOrtb2Blocking.sendAuctionRequest(bidRequest)
318318

319319
then: "PBS response should contain seatNonBid for the called bidder"
320-
assert response.ext.prebid.modules.errors.pbOrtb2Blocking["${ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"].first
320+
assert response.ext.prebid.modules.errors.pbOrtb2Blocking["${PB_ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"].first
321321
.contains("field in account configuration has unexpected type")
322322

323323
and: "PBS response shouldn't contain any module warning"
@@ -1308,7 +1308,7 @@ class PbOrtb2BlockingSpec extends ModuleBaseSpec {
13081308
assert !response?.ext?.prebid?.modules?.errors
13091309

13101310
and: "PBS response should contain proper warning"
1311-
assert response?.ext?.prebid?.modules?.warnings?.pbOrtb2Blocking["${ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"] ==
1311+
assert response?.ext?.prebid?.modules?.warnings?.pbOrtb2Blocking["${PB_ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"] ==
13121312
["More than one conditions matches request. Bidder: generic, request media types: [${bidRequest.imp[0].mediaTypes[0].value}]"]
13131313

13141314
where:
@@ -1531,7 +1531,7 @@ class PbOrtb2BlockingSpec extends ModuleBaseSpec {
15311531

15321532
private static Account getAccountWithOrtb2BlockingConfig(String accountId, Map<Ortb2BlockingAttribute, Ortb2BlockingAttributeConfig> attributes) {
15331533
def blockingConfig = new Ortb2BlockingConfig(attributes: attributes)
1534-
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [BIDDER_REQUEST, RAW_BIDDER_RESPONSE])
1534+
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [BIDDER_REQUEST, RAW_BIDDER_RESPONSE])
15351535
def moduleConfig = new PbsModulesConfig(pbOrtb2Blocking: blockingConfig)
15361536
def accountHooksConfig = new AccountHooksConfiguration(executionPlan: executionPlan, modules: moduleConfig)
15371537
def accountConfig = new AccountConfig(hooks: accountHooksConfig)

0 commit comments

Comments
 (0)