Skip to content

Commit d97b5cf

Browse files
Rise: Support Native Bids (#3654)
1 parent d563332 commit d97b5cf

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/main/java/org/prebid/server/bidder/rise/RiseBidder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ private static BidType resolveBidType(Bid bid) throws PreBidException {
132132
return switch (markupType) {
133133
case 1 -> BidType.banner;
134134
case 2 -> BidType.video;
135+
case 4 -> BidType.xNative;
135136
default ->
136137
throw new PreBidException("Unsupported MType: %s, for bid: %s".formatted(markupType, bid.getId()));
137138
};

src/main/resources/bidder-config/rise.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ adapters:
22
rise:
33
endpoint: https://pbs.yellowblue.io/pbs
44
modifying-vast-xml-allowed: true
5+
endpoint-compression: gzip
56
meta-info:
67
maintainer-email: [email protected]
78
app-media-types:
89
- banner
910
- video
11+
- native
1012
site-media-types:
1113
- banner
1214
- video
15+
- native
1316
supported-vendors:
1417
vendor-id: 1043
1518
usersync:

src/test/java/org/prebid/server/bidder/rise/RiseBidderTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
2929
import static org.prebid.server.proto.openrtb.ext.response.BidType.banner;
3030
import static org.prebid.server.proto.openrtb.ext.response.BidType.video;
31+
import static org.prebid.server.proto.openrtb.ext.response.BidType.xNative;
3132

3233
public class RiseBidderTest extends VertxTest {
3334

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

218+
@Test
219+
public void makeBidsShouldReturnNativeBidIfMTypeIsFour() throws JsonProcessingException {
220+
// given
221+
final BidderCall<BidRequest> httpCall = givenHttpCall(
222+
BidRequest.builder().imp(singletonList(Imp.builder().id("123").build())).build(),
223+
mapper.writeValueAsString(givenBidResponse(Bid.builder().mtype(4).build())));
224+
225+
// when
226+
final Result<List<BidderBid>> result = target.makeBids(httpCall, null);
227+
228+
// then
229+
assertThat(result.getErrors()).isEmpty();
230+
assertThat(result.getValue()).containsOnly(BidderBid.of(Bid.builder().mtype(4).build(), xNative, "USD"));
231+
}
232+
217233
@Test
218234
public void makeBidsShouldReturnErrorsForBidsThatDoesNotContainMType() throws JsonProcessingException {
219235
// given

0 commit comments

Comments
 (0)