Skip to content

Commit bb42e74

Browse files
committed
update tests
1 parent 934ea4a commit bb42e74

6 files changed

Lines changed: 253 additions & 130 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.prebid.server.functional.model.request.get
2+
3+
import com.fasterxml.jackson.core.JsonGenerator
4+
import com.fasterxml.jackson.databind.JsonSerializer
5+
import com.fasterxml.jackson.databind.SerializerProvider
6+
7+
class CommaSeparatedListSerializer extends JsonSerializer<List<Object>> {
8+
9+
@Override
10+
void serialize(List<Object> value, JsonGenerator generator, SerializerProvider serializers) throws IOException {
11+
String result = value.join(',')
12+
generator.writeString(result)
13+
}
14+
}

src/test/groovy/org/prebid/server/functional/model/request/get/GeneralGetRequest.groovy

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.prebid.server.functional.model.request.get
22

33
import com.fasterxml.jackson.annotation.JsonProperty
4+
import com.fasterxml.jackson.databind.annotation.JsonSerialize
45
import org.prebid.server.functional.model.request.amp.ConsentType
56
import org.prebid.server.functional.model.request.auction.DebugCondition
67
import org.prebid.server.functional.model.request.auction.DeviceType
@@ -36,9 +37,11 @@ class GeneralGetRequest {
3637
String outputModule
3738

3839
@JsonProperty("rprof")
40+
@JsonSerialize(using = CommaSeparatedListSerializer)
3941
List<String> requestProfiles
4042

4143
@JsonProperty("iprof")
44+
@JsonSerialize(using = CommaSeparatedListSerializer)
4245
List<String> impProfiles
4346

4447
@JsonProperty("sarid")
@@ -53,10 +56,10 @@ class GeneralGetRequest {
5356
Integer height
5457

5558
@JsonProperty("ow")
56-
Integer originalWidth
59+
Integer overrideWidth
5760

5861
@JsonProperty("oh")
59-
Integer originalHeight
62+
Integer overrideHeight
6063

6164
Object sizes
6265

@@ -71,11 +74,14 @@ class GeneralGetRequest {
7174
@JsonProperty("maxdur")
7275
Integer maxDuration
7376

77+
@JsonSerialize(using = CommaSeparatedListSerializer)
7478
List<Integer> api
7579

7680
@JsonProperty("battr")
81+
@JsonSerialize(using = CommaSeparatedListSerializer)
7782
List<Integer> blockAttributes
7883

84+
@JsonSerialize(using = CommaSeparatedListSerializer)
7985
List<Integer> delivery
8086

8187
Integer linearity
@@ -105,9 +111,11 @@ class GeneralGetRequest {
105111
Integer podSequence
106112

107113
@JsonProperty("proto")
114+
@JsonSerialize(using = CommaSeparatedListSerializer)
108115
List<Integer> protocols
109116

110117
@JsonProperty("rqddurs")
118+
@JsonSerialize(using = CommaSeparatedListSerializer)
111119
List<Integer> requiredDurations
112120

113121
@JsonProperty("seq")
@@ -147,15 +155,18 @@ class GeneralGetRequest {
147155
Integer playbackEnd
148156

149157
@JsonProperty("playbackmethod")
158+
@JsonSerialize(using = CommaSeparatedListSerializer)
150159
List<Integer> playbackMethods
151160

152161
@JsonProperty("boxingallowed")
153162
Integer boxingAllowed
154163

155164
@JsonProperty("btype")
165+
@JsonSerialize(using = CommaSeparatedListSerializer)
156166
List<Integer> bannerTypes
157167

158168
@JsonProperty("expdir")
169+
@JsonSerialize(using = CommaSeparatedListSerializer)
159170
List<Integer> expandableDirections
160171

161172
@JsonProperty("topframe")
@@ -190,6 +201,7 @@ class GeneralGetRequest {
190201
ConsentType consentType
191202

192203
@JsonProperty("gpp_sid")
204+
@JsonSerialize(using = CommaSeparatedListSerializer)
193205
List<Integer> gppSid
194206

195207
Integer coppa
@@ -204,9 +216,11 @@ class GeneralGetRequest {
204216
Integer limitAdTracking
205217

206218
@JsonProperty("bcat")
219+
@JsonSerialize(using = CommaSeparatedListSerializer)
207220
List<String> blockedCategories
208221

209222
@JsonProperty("badv")
223+
@JsonSerialize(using = CommaSeparatedListSerializer)
210224
List<String> blockedAdvertisers
211225

212226
String page
@@ -233,7 +247,7 @@ class GeneralGetRequest {
233247
Integer contentCategory
234248

235249
@JsonProperty("ccattax")
236-
List<Integer> contentCategoryTaxonomy
250+
Integer contentCategoryTaxonomy
237251

238252
@JsonProperty("cseries")
239253
String contentSeries
@@ -248,7 +262,7 @@ class GeneralGetRequest {
248262
String contentUrl
249263

250264
@JsonProperty("clivestream")
251-
String contentLivestream
265+
Integer contentLivestream
252266

253267
@JsonProperty("ip")
254268
String deviceIp

src/test/groovy/org/prebid/server/functional/service/PrebidServerService.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ class PrebidServerService implements ObjectMapperWrapper {
9898
}
9999
}
100100

101-
GeneralGetResponse sendGeneralGetRequest(GeneralGetRequest request, Map<String, String> headers = [:]) {
101+
BidResponse sendGeneralGetRequest(GeneralGetRequest request, Map<String, String> headers = [:]) {
102102
def response = getAuction(request, headers)
103103

104104
checkResponseStatusCode(response)
105-
decode(response.body.asString(), GeneralGetResponse)
105+
decode(response.body.asString(), BidResponse)
106106
}
107107

108108
AmpResponse sendAmpRequest(AmpRequest ampRequest, Map<String, String> headers = [:]) {

0 commit comments

Comments
 (0)