Align Missena adapter request payload with PBS Go - #4509
Conversation
bb332db to
a5365df
Compare
The adapter built bids without w/h, so every bid tripped creative size validation with size 'nullxnull' and produced no hb_size targeting. The Missena ad server already returns width and height in the response body; parse them and map them onto the bid.
Resolves conflict in test-missena-bid-request.json: upstream reformatted the fixture and added ext.prebid.server.http_method; reapplied the apiKey param and the test -> sample rename on top.
|
@CTMBNara friendly ping for a re-review when you get a chance 🙏 The requested passthrough test was added back in June: Some context on why the size passthrough matters to us in production. With On Happy to make any further changes needed to get this over the line. |
There was a problem hiding this comment.
There is a change in version string as I can see: https://github.com/prebid/prebid-server/pull/4557/changes#diff-9c33cbeca0009a8f587bf47e42c498eca85238611fed243c1f759202f2c20042R153
Update Java adapter if needed
There was a problem hiding this comment.
@CTMBNara The bid server expects name@version (Prebid.js sends prebid.js@<version>, Go sends prebid-server@<version>). PrebidVersionProvider yields pbs-java/<version>, so I reshape it in resolveVersion() rather than touching the shared provider. Kept -java so Go and Java traffic stay distinguishable. Falls back to prebid-server-java@unknown, with a test for that case.
| final JsonNode body = mapper.readTree(result.getValue().getFirst().getBody()); | ||
| assertThat(body.at("/params/apiKey").asText()).isEqualTo("apiKey1"); | ||
| assertThat(body.at("/debug").asBoolean()).isTrue(); | ||
| assertThat(body.at("/userEids/0/source").asText()).isEqualTo("id-source"); |
There was a problem hiding this comment.
This checks are redundant
There was a problem hiding this comment.
@CTMBNara Agreed, removed. containsExactly(expectedPayload) above already covers them. Also dropped the now-unused JsonNode/IOException imports.
There was a problem hiding this comment.
Add givenBidRequest(UnaryOperator<BidRequest.BidRequestBuilder> bidRequestCustomizer, Imp... imps)
method and use it instead of givenBidRequest(...).toBuilder()...
There was a problem hiding this comment.
Added, and all .toBuilder() call sites now use it. The old givenBidRequest(UnaryOperator<Imp.ImpBuilder>...) had to become givenBidRequest(Imp... imps), since keeping both made givenBidRequest(imp -> ...) ambiguous. Call sites now pass givenImp(...), as in VisibleMeasuresBidderTest.
Send the version as `prebid-server-java@<version>` to follow the `name@version` convention the bid server already receives from Prebid.js (`prebid.js@<version>`) and Prebid Server Go (`prebid-server@<version>`), while keeping Go and Java traffic distinguishable. Falls back to `prebid-server-java@unknown` when the version record is unavailable. Drop the JSON body assertions in makeHttpRequestsShouldMakeRequestForFirstValidImp; the preceding containsExactly(expectedPayload) already compares the whole payload, so they were redundant. Add givenBidRequest(UnaryOperator<BidRequest.BidRequestBuilder>, Imp...) and use it in place of givenBidRequest(...).toBuilder(). The existing imp-customizer overload is replaced by givenBidRequest(Imp...) as in VisibleMeasuresBidderTest, since two overloads both taking a lambda first are ambiguous at the call site.
Summary
testwithsampleapiKeyinparams, plus top-leveldebuganduserEidsTesting
git diff --check -- src/main/java/org/prebid/server/bidder/missena src/main/java/org/prebid/server/proto/openrtb/ext/request/missena src/main/resources/static/bidder-params/missena.json src/test/java/org/prebid/server/bidder/missena src/test/resources/org/prebid/server/it/openrtb2/missenajq empty src/main/resources/static/bidder-params/missena.json src/test/resources/org/prebid/server/it/openrtb2/missena/test-auction-missena-request.json src/test/resources/org/prebid/server/it/openrtb2/missena/test-missena-bid-request.json