Skip to content

Commit 2f3065d

Browse files
committed
update after review
1 parent 804c252 commit 2f3065d

5 files changed

Lines changed: 25 additions & 27 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class CommaSeparatedListSerializer extends JsonSerializer<List<Object>> {
88

99
@Override
1010
void serialize(List<Object> value, JsonGenerator generator, SerializerProvider serializers) throws IOException {
11-
String result = value.join(',')
12-
generator.writeString(result)
11+
generator.writeString(value.join(','))
1312
}
1413
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,8 @@ class PrebidServerService implements ObjectMapperWrapper {
353353
}
354354

355355
private Response getAuction(GeneralGetRequest request, Map<String, String> headers = [:]) {
356-
def map = toMap(request)
357-
358356
given(requestSpecification).headers(headers)
359-
.queryParams(map)
357+
.queryParams(toMap(request))
360358
.get(GENERAL_GET_ENDPOINT)
361359
}
362360

src/test/groovy/org/prebid/server/functional/tests/GeneralGetInterfaceImpSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ class GeneralGetInterfaceImpSpec extends BaseSpec {
17091709
assert bidderRequest.imp[0].ext.data.any == targeting.any
17101710
}
17111711

1712-
def "PBS should throw exception when general get request linked to stored request with several imps"() {
1712+
def "PBS should discard imps after first one and emit a sampled log entry with referrer and account information when request contain several imps"() {
17131713
given: "Start time"
17141714
def startTime = Instant.now()
17151715

@@ -1735,7 +1735,7 @@ class GeneralGetInterfaceImpSpec extends BaseSpec {
17351735

17361736
and: "PBS log should contain message"
17371737
def logs = defaultPbsService.getLogsByTime(startTime)
1738-
assert getLogsByText(logs, '').size() == 1 //TODO add logs
1738+
assert getLogsByText(logs, "Request includes ${request.imp.size()} imp elements. Only the first one will remain.").size() == 1
17391739

17401740
where:
17411741
generalGetRequest << [

src/test/groovy/org/prebid/server/functional/tests/ProfileSpec.groovy

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ class ProfileSpec extends BaseSpec {
641641
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
642642
assert response.ext?.warnings[ErrorType.PREBID]*.message == [LIMIT_ERROR_MESSAGE]
643643

644-
and: "Response should contain error"
644+
and: "Response shouldn't contain error"
645645
assert !response.ext?.errors
646646

647647
and: "Missing metric should increments"
@@ -811,7 +811,7 @@ class ProfileSpec extends BaseSpec {
811811
then: "PBS should emit proper warning"
812812
assert response.ext?.warnings[ErrorType.PREBID]*.message.contains(LIMIT_ERROR_MESSAGE)
813813

814-
and: "Response should contain error"
814+
and: "Response shouldn't contain error"
815815
assert !response.ext?.errors
816816

817817
and: "Missing metric should increments"
@@ -1194,7 +1194,7 @@ class ProfileSpec extends BaseSpec {
11941194
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
11951195
assert response.ext?.warnings[ErrorType.PREBID]*.message == [LIMIT_ERROR_MESSAGE]
11961196

1197-
and: "Response should contain error"
1197+
and: "Response shouldn't contain error"
11981198
assert !response.ext?.errors
11991199

12001200
and: "PBS log should contain error"
@@ -1238,7 +1238,7 @@ class ProfileSpec extends BaseSpec {
12381238
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
12391239
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_PROFILE_MESSAGE.formatted(requestProfile.id)]
12401240

1241-
and: "Response should contain error"
1241+
and: "Response shouldn't contain error"
12421242
assert !response.ext?.errors
12431243

12441244
and: "Missing metric should increments"
@@ -1292,7 +1292,7 @@ class ProfileSpec extends BaseSpec {
12921292
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
12931293
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_PROFILE_MESSAGE.formatted(requestProfile.id)]
12941294

1295-
and: "Response should contain error"
1295+
and: "Response shouldn't contain error"
12961296
assert !response.ext?.errors
12971297

12981298
and: "Missing metric should increments"
@@ -1341,7 +1341,7 @@ class ProfileSpec extends BaseSpec {
13411341
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
13421342
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_IMP_PROFILE_MESSAGE.formatted(invalidProfileId)]
13431343

1344-
and: "Response should contain error"
1344+
and: "Response shouldn't contain error"
13451345
assert !response.ext?.errors
13461346

13471347
and: "Missing metric should increments"
@@ -1373,7 +1373,7 @@ class ProfileSpec extends BaseSpec {
13731373
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
13741374
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_REQUEST_PROFILE_MESSAGE.formatted(invalidProfileId)]
13751375

1376-
and: "Response should contain error"
1376+
and: "Response shouldn't contain error"
13771377
assert !response.ext?.errors
13781378

13791379
and: "Missing metric should increments"
@@ -1421,7 +1421,7 @@ class ProfileSpec extends BaseSpec {
14211421
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
14221422
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_IMP_PROFILE_MESSAGE.formatted(invalidProfile.id)]
14231423

1424-
and: "Response should contain error"
1424+
and: "Response shouldn't contain error"
14251425
assert !response.ext?.errors
14261426

14271427
and: "Missing metric should increments"
@@ -1461,7 +1461,7 @@ class ProfileSpec extends BaseSpec {
14611461
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
14621462
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_REQUEST_PROFILE_MESSAGE.formatted(invalidProfileId)]
14631463

1464-
and: "Response should contain error"
1464+
and: "Response shouldn't contain error"
14651465
assert !response.ext?.errors
14661466

14671467
and: "Missing metric should increments"
@@ -1546,7 +1546,7 @@ class ProfileSpec extends BaseSpec {
15461546
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
15471547
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_REQUEST_PROFILE_MESSAGE.formatted(fileRequestProfileWithEmptyMerge.id)]
15481548

1549-
and: "Response should contain error"
1549+
and: "Response shouldn't contain error"
15501550
assert !response.ext?.errors
15511551

15521552
and: "Missing metric should increments"
@@ -1767,7 +1767,7 @@ class ProfileSpec extends BaseSpec {
17671767
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
17681768
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_PROFILE_MESSAGE.formatted(requestProfile.id)]
17691769

1770-
and: "Response should contain error"
1770+
and: "Response shouldn't contain error"
17711771
assert !response.ext?.errors
17721772

17731773
and: "Missing metric should increments"
@@ -1824,7 +1824,7 @@ class ProfileSpec extends BaseSpec {
18241824
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
18251825
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_PROFILE_MESSAGE.formatted(impProfile.id)]
18261826

1827-
and: "Response should contain error"
1827+
and: "Response shouldn't contain error"
18281828
assert !response.ext?.errors
18291829

18301830
and: "Missing metric should increments"
@@ -1860,7 +1860,7 @@ class ProfileSpec extends BaseSpec {
18601860
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
18611861
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_REQUEST_PROFILE_MESSAGE.formatted(requestProfile)]
18621862

1863-
and: "Response should contain error"
1863+
and: "Response shouldn't contain error"
18641864
assert !response.ext?.errors
18651865

18661866
and: "Missing metric should increments"
@@ -1923,7 +1923,7 @@ class ProfileSpec extends BaseSpec {
19231923
assert response.ext?.warnings[ErrorType.PREBID]*.code == [999]
19241924
assert response.ext?.warnings[ErrorType.PREBID]*.message == [NO_IMP_PROFILE_MESSAGE.formatted(impProfileId)]
19251925

1926-
and: "Response should contain error"
1926+
and: "Response shouldn't contain error"
19271927
assert !response.ext?.errors
19281928

19291929
and: "Missing metric should increments"
@@ -1995,7 +1995,10 @@ class ProfileSpec extends BaseSpec {
19951995
when: "PBS processes general get request"
19961996
def response = pbsWithStoredProfiles.sendGeneralGetRequest(generalGetRequest)
19971997

1998-
then: "Response should contain error"
1998+
then: "PBS should emit proper warning"
1999+
assert response.ext?.warnings[ErrorType.PREBID]*.message.contains(LIMIT_ERROR_MESSAGE)
2000+
2001+
and: "Response should contain error"
19992002
assert !response.ext?.errors
20002003

20012004
and: "Missing metric should increments"

src/test/groovy/org/prebid/server/functional/tests/privacy/GeneralGetInterfacePrivacySpec.groovy

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import org.prebid.server.functional.util.PBSUtils
1616
import org.prebid.server.functional.util.privacy.CcpaConsent
1717
import org.prebid.server.functional.util.privacy.TcfConsent
1818
import org.prebid.server.functional.util.privacy.gpp.UsNatV1Consent
19-
import spock.lang.PendingFeature
2019

2120
import static org.prebid.server.functional.model.config.Purpose.P2
2221
import static org.prebid.server.functional.model.config.PurposeEnforcement.BASIC
@@ -191,7 +190,7 @@ class GeneralGetInterfacePrivacySpec extends PrivacyBaseSpec {
191190
!it.gppSid
192191
}
193192

194-
and: "Shouldn't contain ext privacy info"
193+
and: "Bidder request shouldn't contain regs.ext"
195194
assert bidderRequest.regs.ext == new RegsExt()
196195

197196
where:
@@ -203,8 +202,7 @@ class GeneralGetInterfacePrivacySpec extends PrivacyBaseSpec {
203202
]
204203
}
205204

206-
@PendingFeature
207-
def "PBS should emit error when consent type is invalid"() {
205+
def "PBS get interface should emit error when consent type is invalid"() {
208206
given: "Default General get request"
209207
def consentValue = PBSUtils.randomString
210208
def accountId = PBSUtils.randomNumber.toString()
@@ -529,7 +527,7 @@ class GeneralGetInterfacePrivacySpec extends PrivacyBaseSpec {
529527
!it.gpp
530528
}
531529

532-
and: "Shouldn't contain ext privacy info"
530+
and: "Bidder request shouldn't contain regs.ext"
533531
assert bidderRequest.regs.ext == new RegsExt()
534532

535533
and: "PBS should cancel request"

0 commit comments

Comments
 (0)