Repository navigation
Conversation
osulzhenko
previously approved these changes
Oct 28, 2026
CTMBNara
requested changes
Oct 29, 2026
Comment on lines
+267
to
+282
| @Test | ||
| public void makeBidsShouldReturnNativeBidWhenMtypeIsNativeOnBannerAndNativeImp() throws JsonProcessingException { | ||
| // given | ||
| final BidRequest bidRequest = givenBidRequest(imp -> imp.id("imp1") | ||
| .banner(Banner.builder().build()) | ||
| .xNative(Native.builder().build())); | ||
| final Bid bid = givenBid("bid1", "imp1", 4); | ||
| final BidderCall<BidRequest> httpCall = givenHttpCall(bidRequest, givenBidResponse(singletonList(bid))); | ||
|
|
||
| // when | ||
| final Result<List<BidderBid>> result = target.makeBids(httpCall, bidRequest); | ||
|
|
||
| // then | ||
| assertThat(result.getErrors()).isEmpty(); | ||
| assertThat(result.getValue()).containsExactly(BidderBid.of(bid, BidType.xNative, "USD")); | ||
| } |
Collaborator
There was a problem hiding this comment.
Change test name to makeBidsShouldReturnNativeBidWhenMtypeIsNative. Remove banner and native from imp
Comment on lines
+284
to
+299
| @Test | ||
| public void makeBidsShouldReturnBannerBidWhenMtypeIsBannerOnBannerAndVideoImp() throws JsonProcessingException { | ||
| // given | ||
| final BidRequest bidRequest = givenBidRequest(imp -> imp.id("imp1") | ||
| .banner(Banner.builder().build()) | ||
| .video(Video.builder().build())); | ||
| final Bid bid = givenBid("bid1", "imp1", 1); | ||
| final BidderCall<BidRequest> httpCall = givenHttpCall(bidRequest, givenBidResponse(singletonList(bid))); | ||
|
|
||
| // when | ||
| final Result<List<BidderBid>> result = target.makeBids(httpCall, bidRequest); | ||
|
|
||
| // then | ||
| assertThat(result.getErrors()).isEmpty(); | ||
| assertThat(result.getValue()).containsExactly(BidderBid.of(bid, BidType.banner, "USD")); | ||
| } |
Comment on lines
+301
to
+316
| @Test | ||
| public void makeBidsShouldReturnVideoBidWhenMtypeIsVideoOnVideoAndNativeImp() throws JsonProcessingException { | ||
| // given | ||
| final BidRequest bidRequest = givenBidRequest(imp -> imp.id("imp1") | ||
| .video(Video.builder().build()) | ||
| .xNative(Native.builder().build())); | ||
| final Bid bid = givenBid("bid1", "imp1", 2); | ||
| final BidderCall<BidRequest> httpCall = givenHttpCall(bidRequest, givenBidResponse(singletonList(bid))); | ||
|
|
||
| // when | ||
| final Result<List<BidderBid>> result = target.makeBids(httpCall, bidRequest); | ||
|
|
||
| // then | ||
| assertThat(result.getErrors()).isEmpty(); | ||
| assertThat(result.getValue()).containsExactly(BidderBid.of(bid, BidType.video, "USD")); | ||
| } |
Comment on lines
+318
to
+335
| @Test | ||
| public void makeBidsShouldReturnNativeBidWhenMtypeIsNativeOnBannerVideoAndNativeImp() | ||
| throws JsonProcessingException { | ||
| // given | ||
| final BidRequest bidRequest = givenBidRequest(imp -> imp.id("imp1") | ||
| .banner(Banner.builder().build()) | ||
| .video(Video.builder().build()) | ||
| .xNative(Native.builder().build())); | ||
| final Bid bid = givenBid("bid1", "imp1", 4); | ||
| final BidderCall<BidRequest> httpCall = givenHttpCall(bidRequest, givenBidResponse(singletonList(bid))); | ||
|
|
||
| // when | ||
| final Result<List<BidderBid>> result = target.makeBids(httpCall, bidRequest); | ||
|
|
||
| // then | ||
| assertThat(result.getErrors()).isEmpty(); | ||
| assertThat(result.getValue()).containsExactly(BidderBid.of(bid, BidType.xNative, "USD")); | ||
| } |
Comment on lines
+337
to
+350
| @Test | ||
| public void makeBidsShouldReturnAudioBidWhenMtypeIsAudio() throws JsonProcessingException { | ||
| // given | ||
| final BidRequest bidRequest = givenBidRequest(imp -> imp.id("imp1").banner(Banner.builder().build())); | ||
| final Bid bid = givenBid("bid1", "imp1", 3); | ||
| final BidderCall<BidRequest> httpCall = givenHttpCall(bidRequest, givenBidResponse(singletonList(bid))); | ||
|
|
||
| // when | ||
| final Result<List<BidderBid>> result = target.makeBids(httpCall, bidRequest); | ||
|
|
||
| // then | ||
| assertThat(result.getErrors()).isEmpty(); | ||
| assertThat(result.getValue()).containsExactly(BidderBid.of(bid, BidType.audio, "USD")); | ||
| } |
…med to makeBidsShouldReturn{Native,Banner,Video}BidWhenMtypeIs{Native,Banner,Video}, all mtype tests now use an imp with no formats (including audio, which loses its banner), and the redundant all-format native test is removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…d in mtype.
🔧 Type of changes
✨ What's the context?
Nativo's server sets mtype on every bid. The adapter ignored it and inferred the media type from the request imp (native, then video, then banner), which mislabels bids on multi-format imps, for example a banner win on a banner + video imp reported as video.
🧠 Rationale behind the change
The adapter now uses bid.MType (1 banner, 2 video, 3 audio, 4 native) when present, as Prebid recommends. If it's missing or unrecognized, the existing imp-based and ext.prebid.type logic runs unchanged, so responses without mtype behave as before. New fixtures cover multi-format imps, audio, an unrecognized mtype and an unknown imp.
🔎 New Bid Adapter Checklist
🧪 Test plan
How do you know the changes are safe to ship to production?
🏎 Quality check