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

Rise: Support Native Bids #3654

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Expand Up @@ -132,6 +132,7 @@ private static BidType resolveBidType(Bid bid) throws PreBidException {
return switch (markupType) {
case 1 -> BidType.banner;
case 2 -> BidType.video;
case 4 -> BidType.xNative;
default ->
throw new PreBidException("Unsupported MType: %s, for bid: %s".formatted(markupType, bid.getId()));
};
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/bidder-config/rise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ adapters:
rise:
endpoint: https://pbs.yellowblue.io/pbs
modifying-vast-xml-allowed: true
endpoint-compression: gzip
meta-info:
maintainer-email: [email protected]
app-media-types:
- banner
- video
- native
site-media-types:
- banner
- video
- native
supported-vendors:
vendor-id: 1043
usersync:
Expand Down
16 changes: 16 additions & 0 deletions src/test/java/org/prebid/server/bidder/rise/RiseBidderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.prebid.server.proto.openrtb.ext.response.BidType.banner;
import static org.prebid.server.proto.openrtb.ext.response.BidType.video;
import static org.prebid.server.proto.openrtb.ext.response.BidType.xNative;

public class RiseBidderTest extends VertxTest {

Expand Down Expand Up @@ -214,6 +215,21 @@ public void makeBidsShouldReturnVideoBidIfMTypeIsTwo() throws JsonProcessingExce
assertThat(result.getValue()).containsOnly(BidderBid.of(Bid.builder().mtype(2).build(), video, "USD"));
}

@Test
public void makeBidsShouldReturnNativeBidIfMTypeIsFour() throws JsonProcessingException {
// given
final BidderCall<BidRequest> httpCall = givenHttpCall(
BidRequest.builder().imp(singletonList(Imp.builder().id("123").build())).build(),
mapper.writeValueAsString(givenBidResponse(Bid.builder().mtype(4).build())));

// when
final Result<List<BidderBid>> result = target.makeBids(httpCall, null);

// then
assertThat(result.getErrors()).isEmpty();
assertThat(result.getValue()).containsOnly(BidderBid.of(Bid.builder().mtype(4).build(), xNative, "USD"));
}

@Test
public void makeBidsShouldReturnErrorsForBidsThatDoesNotContainMType() throws JsonProcessingException {
// given
Expand Down
Loading