Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename integration to channel in account config tests #1605

Merged
merged 6 commits into from
Feb 21, 2022
Merged
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
@@ -1,4 +1,4 @@
package org.prebid.server.functional.model.config
package org.prebid.server.functional.model

import com.fasterxml.jackson.annotation.JsonValue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package org.prebid.server.functional.model.config
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.databind.annotation.JsonNaming
import groovy.transform.ToString
import org.prebid.server.functional.model.ChannelType

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

Boolean enabled
Map<ChannelType, Boolean> enabledForRequestType
Map<ChannelType, Boolean> channelEnabled
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package org.prebid.server.functional.model.config
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.databind.annotation.JsonNaming
import groovy.transform.ToString
import org.prebid.server.functional.model.ChannelType

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

Boolean enabled
Map<ChannelType, Boolean> enabledForRequestType
Map<ChannelType, Boolean> channelEnabled
Map<Purpose, PurposeConfig> purposes
Map<SpecialFeature, SpecialFeatureConfig> specialFeatures
PurposeOneTreatmentInterpretation purposeOneTreatmentInterpretation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class AmpRequest {
Integer account
String gdprConsent
Net-burst marked this conversation as resolved.
Show resolved Hide resolved
String consentString
String targeting
ConsentType consentType
Boolean gdprApplies
String addtlConsent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class App {
AppExt ext

static App getDefaultApp() {
new App(id: PBSUtils.randomString)
new App().tap {
id = PBSUtils.randomString
publisher = Publisher.defaultPublisher
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore
import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString

import static org.prebid.server.functional.model.request.auction.DistributionChannel.APP
import static org.prebid.server.functional.model.request.auction.DistributionChannel.SITE

@EqualsAndHashCode
@ToString(includeNames = true, ignoreNulls = true)
class BidRequest {
Expand All @@ -29,14 +32,19 @@ class BidRequest {
Regs regs
BidRequestExt ext

static BidRequest getDefaultBidRequest() {
static BidRequest getDefaultBidRequest(DistributionChannel channel = SITE) {
new BidRequest().tap {
it.addImp(Imp.defaultImpression)
regs = Regs.defaultRegs
id = UUID.randomUUID()
tmax = 2500
site = Site.defaultSite
ext = new BidRequestExt(prebid: new Prebid(debug: 1))
if (channel == SITE) {
site = Site.defaultSite
}
if (channel == APP) {
app = App.defaultApp
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.prebid.server.functional.model.request.auction

import groovy.transform.ToString
import org.prebid.server.functional.model.ChannelType

@ToString(includeNames = true, ignoreNulls = true)
class Channel {

String name
ChannelType name
String version
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.prebid.server.functional.model.request.auction

import com.fasterxml.jackson.annotation.JsonValue

enum DistributionChannel {

SITE, APP

@JsonValue
String getValue() {
name().toLowerCase()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.prebid.server.functional.util.privacy.ConsentString
@ToString(includeNames = true, ignoreNulls = true)
class UserExt {

ConsentString consent
String consent
List<String> fcapids
UserTime time
UserExtData data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ class PbsServiceFactory {
}

PrebidServerService getService(Map<String, String> config) {
if (containers.size() >= MAX_CONTAINERS_COUNT) {
def container = containers.find { !it.key.isEmpty() }
remove([(container.key): container.value])
}
if (containers.containsKey(config)) {
return new PrebidServerService(getContainer(config), mapper)
return new PrebidServerService(containers.get(config), mapper)
} else {
if (containers.size() >= MAX_CONTAINERS_COUNT) {
def container = containers.find { !it.key.isEmpty() }
remove([(container.key): container.value])
}
def pbsContainer = new PrebidServerContainer(config)
pbsContainer.start()
containers.put(config, pbsContainer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ LIMIT 1

void withBidder(String host) {
withConfig(["adapters.generic.enabled" : "true",
"adapters.generic.endpoint" : "$host/auction".toString(),
"adapters.generic.usersync.url" : "$host/generic-usersync".toString(),
"adapters.generic.endpoint" : "$host/auction" as String,
"adapters.generic.usersync.url" : "$host/generic-usersync" as String,
"adapters.generic.usersync.type": "redirect"
])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ class TargetingSpec extends BasePgSpec {
}

APP_BUNDLE | BidRequest.defaultBidRequest.tap {
app = App.defaultApp.tap { bundle = stringTargetingValue }
app = new App(id: PBSUtils.randomString,
bundle: stringTargetingValue)
}

UFPD_LANGUAGE | BidRequest.defaultBidRequest.tap {
Expand Down Expand Up @@ -320,7 +321,7 @@ class TargetingSpec extends BasePgSpec {
}
},
BidRequest.defaultBidRequest.tap {
app = App.defaultApp.tap {
app = new App(id: PBSUtils.randomString).tap {
ext = new AppExt(data: new AppExtData(language: stringTargetingValue))
}
}
Expand Down
Loading