diff --git a/docs/config-app.md b/docs/config-app.md index 015ac1f398e..58b5eb8deeb 100644 --- a/docs/config-app.md +++ b/docs/config-app.md @@ -18,6 +18,7 @@ This parameter exists to allow to change the location of the directory Vert.x wi ## Server - `server.max-headers-size` - set the maximum length of all headers. +- `server.max-body-size` - set the maximum length of body. - `server.ssl` - enable SSL/TLS support. - `server.jks-path` - path to the java keystore (if ssl is enabled). - `server.jks-password` - password for the keystore (if ssl is enabled). @@ -91,7 +92,6 @@ Removes and downloads file again if depending service cant process probably corr - `auction.biddertmax.max` - maximum operation timeout for OpenRTB Auction requests. - `auction.biddertmax.percent` - adjustment factor for `request.tmax` for bidders. - `auction.tmax-upstream-response-time` - the amount of time that PBS needs to respond to the original caller. -- `auction.max-request-size` - set the maximum size in bytes of OpenRTB Auction request. - `auction.stored-requests-timeout-ms` - timeout for stored requests fetching. - `auction.ad-server-currency` - default currency for auction, if its value was not specified in request. Important note: PBS uses ISO-4217 codes for the representation of currencies. - `auction.cache.expected-request-time-ms` - approximate value in milliseconds for Cache Service interacting. diff --git a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataServiceTest.java b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataServiceTest.java index 1a93b22a502..ff10c9bd69a 100644 --- a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataServiceTest.java +++ b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataServiceTest.java @@ -90,7 +90,7 @@ public void extractThrottlingMessagesFromBidRequestShouldReturnValidThrottlingMe assertThat(throttlingMessages).isNotEmpty(); assertThat(throttlingMessages) .extracting(ThrottlingMessage::getBidder) - .containsExactly("rubicon", "appnexus", "pubmatic"); + .containsExactly("magnite", "appnexus", "pubmatic"); throttlingMessages.forEach(message -> { assertThat(message.getAdUnitCode()).isEqualTo("adunitcodevalue"); @@ -128,7 +128,7 @@ public void extractThrottlingMessagesFromBidRequestShouldReturnValidThrottlingMe assertThat(throttlingMessages).isNotEmpty(); assertThat(throttlingMessages) .extracting(ThrottlingMessage::getBidder) - .containsExactly("rubicon", "appnexus", "pubmatic"); + .containsExactly("magnite", "appnexus", "pubmatic"); throttlingMessages.forEach(message -> { assertThat(message.getAdUnitCode()).isEqualTo("adunitcodevalue"); @@ -162,7 +162,7 @@ public void extractThrottlingMessagesFromBidRequestShouldHandleMissingIp() { assertThat(throttlingMessages).isNotEmpty(); assertThat(throttlingMessages) .extracting(ThrottlingMessage::getBidder) - .containsExactly("rubicon", "appnexus", "pubmatic"); + .containsExactly("magnite", "appnexus", "pubmatic"); throttlingMessages.forEach(message -> { assertThat(message.getAdUnitCode()).isEqualTo("adunitcodevalue"); diff --git a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInvocationResultCreatorTest.java b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInvocationResultCreatorTest.java index 1aa9e5022b4..50f2afd2b57 100644 --- a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInvocationResultCreatorTest.java +++ b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInvocationResultCreatorTest.java @@ -49,7 +49,7 @@ public void createGreenbidsInvocationResultWhenNotExploration() { assertThat(ortb2ImpExtResult).isNotNull(); assertThat(ortb2ImpExtResult.getGreenbids().getIsExploration()).isFalse(); assertThat(ortb2ImpExtResult.getGreenbids().getFingerprint()).isNotNull(); - assertThat(keptInAuction.get("rubicon")).isTrue(); + assertThat(keptInAuction.get("magnite")).isTrue(); assertThat(keptInAuction.get("appnexus")).isFalse(); assertThat(keptInAuction.get("pubmatic")).isFalse(); } @@ -78,7 +78,7 @@ public void createShouldReturnNoActionWhenExploration() { assertThat(ortb2ImpExtResult).isNotNull(); assertThat(ortb2ImpExtResult.getGreenbids().getIsExploration()).isTrue(); assertThat(ortb2ImpExtResult.getGreenbids().getFingerprint()).isNotNull(); - assertThat(keptInAuction.get("rubicon")).isFalse(); + assertThat(keptInAuction.get("magnite")).isFalse(); assertThat(keptInAuction.get("appnexus")).isFalse(); assertThat(keptInAuction.get("pubmatic")).isFalse(); } @@ -107,14 +107,14 @@ public void createShouldReturnRejectWhenAllImpsAreFilteredOutAndNoExploration() assertThat(ortb2ImpExtResult).isNotNull(); assertThat(ortb2ImpExtResult.getGreenbids().getIsExploration()).isFalse(); assertThat(ortb2ImpExtResult.getGreenbids().getFingerprint()).isNotNull(); - assertThat(keptInAuction.get("rubicon")).isFalse(); + assertThat(keptInAuction.get("magnite")).isFalse(); assertThat(keptInAuction.get("appnexus")).isFalse(); assertThat(keptInAuction.get("pubmatic")).isFalse(); } private Map> givenImpsBiddersFilterMap() { final Map biddersFitlerMap = Map.of( - "rubicon", true, + "magnite", true, "appnexus", false, "pubmatic", false); @@ -123,7 +123,7 @@ private Map> givenImpsBiddersFilterMap() { private Map> givenFilterMapWithAllFilteredImps() { final Map biddersFitlerMap = Map.of( - "rubicon", false, + "magnite", false, "appnexus", false, "pubmatic", false); diff --git a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsPayloadUpdaterTest.java b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsPayloadUpdaterTest.java index 261742146fa..dbc01798d26 100644 --- a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsPayloadUpdaterTest.java +++ b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsPayloadUpdaterTest.java @@ -11,7 +11,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.getAppnexusNode; import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.getPubmaticNode; -import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.getRubiconNode; +import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.getMagniteNode; import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.givenBidRequest; import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.givenImpExt; @@ -22,18 +22,18 @@ public void updateShouldReturnUpdatedBidRequest() { // given final Imp givenImp = Imp.builder() .id("adunitcodevalue") - .ext(givenImpExt(getRubiconNode(), getAppnexusNode(), getPubmaticNode())) + .ext(givenImpExt(getMagniteNode(), getAppnexusNode(), getPubmaticNode())) .build(); // when final BidRequest result = GreenbidsPayloadUpdater.update( givenBidRequest(identity(), List.of(givenImp)), - Map.of("adunitcodevalue", Map.of("rubicon", true, "appnexus", false, "pubmatic", false))); + Map.of("adunitcodevalue", Map.of("magnite", true, "appnexus", false, "pubmatic", false))); // then final Imp expectedImp = Imp.builder() .id("adunitcodevalue") - .ext(givenImpExt(getRubiconNode(), null, null)) + .ext(givenImpExt(getMagniteNode(), null, null)) .build(); assertThat(result.getImp()).containsOnly(expectedImp); @@ -44,13 +44,13 @@ public void updateShouldRemoveImpFromUpdateBidRequestWhenAllBiddersFiltered() { // given final Imp givenImp = Imp.builder() .id("adunitcodevalue") - .ext(givenImpExt(getRubiconNode(), null, null)) + .ext(givenImpExt(getMagniteNode(), null, null)) .build(); // when final BidRequest result = GreenbidsPayloadUpdater.update( givenBidRequest(identity(), List.of(givenImp)), - Map.of("adunitcodevalue", Map.of("rubicon", false, "appnexus", false, "pubmatic", false))); + Map.of("adunitcodevalue", Map.of("magnite", false, "appnexus", false, "pubmatic", false))); // then assertThat(result.getImp()).isEmpty(); diff --git a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/OnnxModelRunnerTest.java b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/OnnxModelRunnerTest.java index 51c4b34ff91..628717cb325 100644 --- a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/OnnxModelRunnerTest.java +++ b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/OnnxModelRunnerTest.java @@ -29,7 +29,7 @@ public void setUp() throws OrtException, IOException { public void runModelShouldReturnProbabilitiesWhenValidThrottlingInferenceRow() throws OrtException { // given final String[][] throttlingInferenceRow = {{ - "Chrome 59", "rubicon", "adunitcodevalue", "US", "www.leparisien.fr", "PC", "10", "1"}}; + "Chrome 59", "magnite", "adunitcodevalue", "US", "www.leparisien.fr", "PC", "10", "1"}}; // when final OrtSession.Result actualResult = target.runModel(throttlingInferenceRow); diff --git a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/util/TestBidRequestProvider.java b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/util/TestBidRequestProvider.java index 9a33620c087..4a90a45d393 100644 --- a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/util/TestBidRequestProvider.java +++ b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/util/TestBidRequestProvider.java @@ -37,14 +37,14 @@ public static Site givenSite() { } public static ObjectNode givenImpExt() { - return givenImpExt(getRubiconNode(), getAppnexusNode(), getPubmaticNode()); + return givenImpExt(getMagniteNode(), getAppnexusNode(), getPubmaticNode()); } - public static ObjectNode givenImpExt(ObjectNode rubiconNode, ObjectNode appnexusNode, ObjectNode pubmaticNode) { + public static ObjectNode givenImpExt(ObjectNode magniteNode, ObjectNode appnexusNode, ObjectNode pubmaticNode) { final ObjectNode bidderNode = MAPPER.createObjectNode(); - if (rubiconNode != null) { - bidderNode.set("rubicon", rubiconNode); + if (magniteNode != null) { + bidderNode.set("magnite", magniteNode); } if (appnexusNode != null) { @@ -70,7 +70,7 @@ public static ObjectNode getAppnexusNode() { return MAPPER.createObjectNode().put("placementId", 123456); } - public static ObjectNode getRubiconNode() { + public static ObjectNode getMagniteNode() { return MAPPER.createObjectNode() .put("accountId", 1001) .put("siteId", 267318) diff --git a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHookTest.java b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHookTest.java index 42e16253445..290bc0f0d98 100644 --- a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHookTest.java +++ b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHookTest.java @@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock; import static org.prebid.server.auction.model.BidRejectionReason.REQUEST_BLOCKED_OPTIMIZED; import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.MAPPER; -import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.getRubiconNode; +import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.getMagniteNode; import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.givenBidRequest; import static org.prebid.server.hooks.modules.greenbids.real.time.data.util.TestBidRequestProvider.givenImpExt; @@ -84,7 +84,7 @@ public void callShouldReturnAnalyticTagsWithoutFilteringOutBiddersWhenExploratio final AuctionInvocationContext invocationContext = givenAuctionInvocationContext(explorationRate); given(filterService.filterBidders(any(), any(), any())).willReturn(Map.of("adunitcodevalue", - Map.of("rubicon", false, "appnexus", false, "pubmatic", false))); + Map.of("magnite", false, "appnexus", false, "pubmatic", false))); // when final Future> future = target @@ -100,11 +100,11 @@ public void callShouldReturnAnalyticTagsWithoutFilteringOutBiddersWhenExploratio final ResultImpl actualResult = (ResultImpl) actualActivity.results().getFirst(); final AppliedTo acctualAppliedTo = actualResult.appliedTo(); - assertThat(acctualAppliedTo.bidders()).containsOnly("appnexus", "pubmatic", "rubicon"); + assertThat(acctualAppliedTo.bidders()).containsOnly("appnexus", "pubmatic", "magnite"); assertThat(acctualAppliedTo.impIds()).containsOnly("adunitcodevalue"); assertThat(actualResult.values().get("adunitcodevalue").get("greenbids").get("keptInAuction")) .isEqualTo(MAPPER.createObjectNode() - .put("rubicon", false) + .put("magnite", false) .put("appnexus", false) .put("pubmatic", false)); assertThat(actualResult.values().get("adunitcodevalue").get("greenbids").get("fingerprint").asText()) @@ -127,7 +127,7 @@ public void callShouldFilterBiddersBasedOnModelResultsWhenExplorationIsFalse() { final AuctionInvocationContext invocationContext = givenAuctionInvocationContext(explorationRate); given(filterService.filterBidders(any(), any(), any())).willReturn(Map.of("adunitcodevalue", - Map.of("rubicon", true, "appnexus", false, "pubmatic", false))); + Map.of("magnite", true, "appnexus", false, "pubmatic", false))); // when final Future> future = target @@ -145,7 +145,7 @@ public void callShouldFilterBiddersBasedOnModelResultsWhenExplorationIsFalse() { final Imp expectedImp = Imp.builder() .id("adunitcodevalue") - .ext(givenImpExt(getRubiconNode(), null, null)) + .ext(givenImpExt(getMagniteNode(), null, null)) .build(); assertThat(resultBidRequest).isEqualTo(givenBidRequest(identity(), List.of(expectedImp))); @@ -157,7 +157,7 @@ public void callShouldFilterBiddersBasedOnModelResultsWhenExplorationIsFalse() { assertThat(acctualAppliedTo.impIds()).containsOnly("adunitcodevalue"); assertThat(actualResult.values().get("adunitcodevalue").get("greenbids").get("keptInAuction")) .isEqualTo(MAPPER.createObjectNode() - .put("rubicon", true) + .put("magnite", true) .put("appnexus", false) .put("pubmatic", false)); assertThat(actualResult.values().get("adunitcodevalue").get("greenbids").get("fingerprint").asText()) diff --git a/src/main/java/org/prebid/server/auction/requestfactory/AuctionRequestFactory.java b/src/main/java/org/prebid/server/auction/requestfactory/AuctionRequestFactory.java index 7e6810e173c..d043d6e6a4d 100644 --- a/src/main/java/org/prebid/server/auction/requestfactory/AuctionRequestFactory.java +++ b/src/main/java/org/prebid/server/auction/requestfactory/AuctionRequestFactory.java @@ -39,7 +39,6 @@ */ public class AuctionRequestFactory { - private final long maxRequestSize; private final Ortb2RequestFactory ortb2RequestFactory; private final StoredRequestProcessor storedRequestProcessor; private final ProfilesProcessor profilesProcessor; @@ -58,8 +57,7 @@ public class AuctionRequestFactory { private static final String ENDPOINT = Endpoint.openrtb2_auction.value(); - public AuctionRequestFactory(long maxRequestSize, - Ortb2RequestFactory ortb2RequestFactory, + public AuctionRequestFactory(Ortb2RequestFactory ortb2RequestFactory, StoredRequestProcessor storedRequestProcessor, ProfilesProcessor profilesProcessor, BidRequestOrtbVersionConversionManager ortbVersionConversionManager, @@ -75,7 +73,6 @@ public AuctionRequestFactory(long maxRequestSize, GeoLocationServiceWrapper geoLocationServiceWrapper, BidAdjustmentsEnricher bidAdjustmentsEnricher) { - this.maxRequestSize = maxRequestSize; this.ortb2RequestFactory = Objects.requireNonNull(ortb2RequestFactory); this.storedRequestProcessor = Objects.requireNonNull(storedRequestProcessor); this.profilesProcessor = Objects.requireNonNull(profilesProcessor); @@ -167,10 +164,6 @@ private String extractAndValidateBody(RoutingContext routingContext) { throw new InvalidRequestException("Incoming request has no body"); } - if (body.length() > maxRequestSize) { - throw new InvalidRequestException("Request size exceeded max size of %d bytes.".formatted(maxRequestSize)); - } - return body; } diff --git a/src/main/java/org/prebid/server/auction/requestfactory/VideoRequestFactory.java b/src/main/java/org/prebid/server/auction/requestfactory/VideoRequestFactory.java index 9c663bd55d7..0c732095e60 100644 --- a/src/main/java/org/prebid/server/auction/requestfactory/VideoRequestFactory.java +++ b/src/main/java/org/prebid/server/auction/requestfactory/VideoRequestFactory.java @@ -51,7 +51,6 @@ public class VideoRequestFactory { private static final int DEFAULT_CACHE_LOG_TTL = 3600; private static final String ENDPOINT = Endpoint.openrtb2_video.value(); - private final int maxRequestSize; private final boolean enforceStoredRequest; private final Pattern escapeLogCacheRegexPattern; @@ -64,8 +63,7 @@ public class VideoRequestFactory { private final JacksonMapper mapper; private final GeoLocationServiceWrapper geoLocationServiceWrapper; - public VideoRequestFactory(int maxRequestSize, - boolean enforceStoredRequest, + public VideoRequestFactory(boolean enforceStoredRequest, String escapeLogCacheRegex, Ortb2RequestFactory ortb2RequestFactory, VideoStoredRequestProcessor storedRequestProcessor, @@ -77,7 +75,6 @@ public VideoRequestFactory(int maxRequestSize, GeoLocationServiceWrapper geoLocationServiceWrapper) { this.enforceStoredRequest = enforceStoredRequest; - this.maxRequestSize = maxRequestSize; this.ortb2RequestFactory = Objects.requireNonNull(ortb2RequestFactory); this.storedRequestProcessor = Objects.requireNonNull(storedRequestProcessor); this.ortbVersionConversionManager = Objects.requireNonNull(ortbVersionConversionManager); @@ -178,10 +175,6 @@ private String extractAndValidateBody(RoutingContext routingContext) { throw new InvalidRequestException("Incoming request has no body"); } - if (body.length() > maxRequestSize) { - throw new InvalidRequestException("Request size exceeded max size of %d bytes.".formatted(maxRequestSize)); - } - return body; } diff --git a/src/main/java/org/prebid/server/bidder/resetdigital/ResetDigitalBidder.java b/src/main/java/org/prebid/server/bidder/resetdigital/ResetDigitalBidder.java index 3bc78b588b0..09a5f2af116 100644 --- a/src/main/java/org/prebid/server/bidder/resetdigital/ResetDigitalBidder.java +++ b/src/main/java/org/prebid/server/bidder/resetdigital/ResetDigitalBidder.java @@ -1,10 +1,12 @@ package org.prebid.server.bidder.resetdigital; +import com.fasterxml.jackson.core.type.TypeReference; import com.iab.openrtb.request.BidRequest; import com.iab.openrtb.request.Imp; import com.iab.openrtb.response.Bid; import com.iab.openrtb.response.BidResponse; import com.iab.openrtb.response.SeatBid; +import io.vertx.core.MultiMap; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.prebid.server.bidder.Bidder; @@ -12,171 +14,157 @@ import org.prebid.server.bidder.model.BidderCall; import org.prebid.server.bidder.model.BidderError; import org.prebid.server.bidder.model.HttpRequest; -import org.prebid.server.bidder.model.Price; import org.prebid.server.bidder.model.Result; -import org.prebid.server.currency.CurrencyConversionService; import org.prebid.server.exception.PreBidException; import org.prebid.server.json.DecodeException; import org.prebid.server.json.JacksonMapper; +import org.prebid.server.proto.openrtb.ext.ExtPrebid; +import org.prebid.server.proto.openrtb.ext.request.resetdigital.ExtImpResetDigital; import org.prebid.server.proto.openrtb.ext.response.BidType; import org.prebid.server.util.BidderUtil; import org.prebid.server.util.HttpUtil; +import org.prebid.server.util.Uri; -import java.math.BigDecimal; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.stream.Stream; +import java.util.Optional; public class ResetDigitalBidder implements Bidder { private static final String DEFAULT_CURRENCY = "USD"; + private static final TypeReference> EXT_TYPE_REFERENCE = + new TypeReference<>() { + }; - private final String endpointUrl; - private final CurrencyConversionService currencyConversionService; + private final Uri endpointUrl; private final JacksonMapper mapper; - public ResetDigitalBidder(String endpointUrl, - CurrencyConversionService currencyConversionService, - JacksonMapper mapper) { - - this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); - this.currencyConversionService = Objects.requireNonNull(currencyConversionService); + public ResetDigitalBidder(String endpointUrl, JacksonMapper mapper) { + this.endpointUrl = Uri.of(endpointUrl); this.mapper = Objects.requireNonNull(mapper); } @Override public Result>> makeHttpRequests(BidRequest request) { - final List bannerImps = new ArrayList<>(); - final List videoImps = new ArrayList<>(); - final List audioImps = new ArrayList<>(); - Price bidFloorPrice; - - for (Imp imp : request.getImp()) { - try { - bidFloorPrice = resolveBidFloor(imp, request); - } catch (PreBidException e) { - return Result.withError(BidderError.badInput(e.getMessage())); - } - populateBannerImps(bannerImps, bidFloorPrice, imp); - populateVideoImps(videoImps, bidFloorPrice, imp); - populateAudiImps(audioImps, bidFloorPrice, imp); + if (request.getImp().size() != 1) { + return Result.withError(BidderError.badInput( + "ResetDigital adapter supports only one impression per request")); } - return Result.withValues(getHttpRequests(request, bannerImps, videoImps, audioImps)); - } - - private List> getHttpRequests(BidRequest request, - List bannerImps, - List videoImps, - List audioImps) { - - return Stream.of(bannerImps, videoImps, audioImps) - .filter(CollectionUtils::isNotEmpty) - .map(imp -> makeHttpRequest(request, imp)) - .toList(); - } - - private HttpRequest makeHttpRequest(BidRequest bidRequest, List imp) { - final BidRequest outgoingRequest = bidRequest.toBuilder().imp(imp).build(); - - return BidderUtil.defaultRequest(outgoingRequest, endpointUrl, mapper); - } - - private static Imp modifyImp(Imp imp, Price bidFloorPrice) { - return imp.toBuilder() - .bidfloorcur(bidFloorPrice.getCurrency()) - .bidfloor(bidFloorPrice.getValue()) - .build(); - } - - private Price resolveBidFloor(Imp imp, BidRequest bidRequest) { - final Price initialBidFloorPrice = Price.of(imp.getBidfloorcur(), imp.getBidfloor()); - return BidderUtil.isValidPrice(initialBidFloorPrice) - ? convertBidFloor(initialBidFloorPrice, imp.getId(), bidRequest) - : initialBidFloorPrice; - } - - private Price convertBidFloor(Price bidFloorPrice, String impId, BidRequest bidRequest) { - final String bidFloorCur = bidFloorPrice.getCurrency(); + final Imp imp = request.getImp().getFirst(); + final ExtImpResetDigital extImp; try { - final BigDecimal convertedPrice = currencyConversionService - .convertCurrency(bidFloorPrice.getValue(), bidRequest, bidFloorCur, DEFAULT_CURRENCY); - - return Price.of(DEFAULT_CURRENCY, convertedPrice); + extImp = parseImpExt(imp); } catch (PreBidException e) { - throw new PreBidException( - "Unable to convert provided bid floor currency from %s to %s for imp `%s`" - .formatted(bidFloorCur, DEFAULT_CURRENCY, impId)); + return Result.withError(BidderError.badInput(e.getMessage())); } - } - private static void populateBannerImps(List bannerImps, Price bidFloorPrice, Imp imp) { - if (imp.getBanner() != null) { - final Imp bannerImp = imp.toBuilder().video(null).xNative(null).audio(null).build(); - bannerImps.add(modifyImp(bannerImp, bidFloorPrice)); - } + final Imp modifiedImp = modifyImp(imp, extImp); + final BidRequest outgoingRequest = request.toBuilder() + .imp(Collections.singletonList(modifiedImp)) + .build(); + final String uri = endpointUrl.addQueryParam("pid", StringUtils.stripToEmpty(extImp.getPlacementId())).expand(); + final MultiMap headers = HttpUtil.headers() + .add(HttpUtil.X_OPENRTB_VERSION_HEADER, "2.5"); + + return Result.withValue(BidderUtil.defaultRequest(outgoingRequest, headers, uri, mapper)); } - private static void populateVideoImps(List videoImps, Price bidFloorPrice, Imp imp) { - if (imp.getVideo() != null) { - final Imp videoImp = imp.toBuilder().banner(null).xNative(null).audio(null).build(); - videoImps.add(modifyImp(videoImp, bidFloorPrice)); + private ExtImpResetDigital parseImpExt(Imp imp) { + try { + return mapper.mapper().convertValue(imp.getExt(), EXT_TYPE_REFERENCE).getBidder(); + } catch (IllegalArgumentException e) { + throw new PreBidException("Error parsing resetDigitalExt from imp.ext: " + e.getMessage()); } } - private static void populateAudiImps(List audioImps, Price bidFloorPrice, Imp imp) { - if (imp.getAudio() != null) { - final Imp audioImp = imp.toBuilder().banner(null).xNative(null).video(null).build(); - audioImps.add(modifyImp(audioImp, bidFloorPrice)); - } + private static Imp modifyImp(Imp imp, ExtImpResetDigital extImp) { + return StringUtils.isBlank(imp.getTagid()) + ? imp.toBuilder().tagid(extImp.getPlacementId()).build() + : imp; } @Override public final Result> makeBids(BidderCall httpCall, BidRequest bidRequest) { try { + final List errors = new ArrayList<>(); final BidResponse bidResponse = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); - return Result.withValues(extractBids(bidResponse, httpCall.getRequest().getPayload())); + return Result.of(extractBids(bidResponse, httpCall.getRequest().getPayload(), errors), errors); } catch (DecodeException | PreBidException e) { return Result.withError(BidderError.badServerResponse(e.getMessage())); } } - private static List extractBids(BidResponse bidResponse, BidRequest bidRequest) { + private static List extractBids(BidResponse bidResponse, + BidRequest bidRequest, + List errors) { + if (bidResponse == null || CollectionUtils.isEmpty(bidResponse.getSeatbid())) { return Collections.emptyList(); } - if (bidResponse.getCur() != null && !StringUtils.equalsIgnoreCase(DEFAULT_CURRENCY, bidResponse.getCur())) { - throw new PreBidException("Bidder support only USD currency"); + + final Imp imp = bidRequest.getImp().getFirst(); + final String currency = StringUtils.isNotBlank(bidResponse.getCur()) + ? bidResponse.getCur() + : bidRequest.getCur().stream().findFirst().orElse(DEFAULT_CURRENCY); + + final List bidderBids = new ArrayList<>(); + for (SeatBid seatBid : bidResponse.getSeatbid()) { + if (seatBid == null || CollectionUtils.isEmpty(seatBid.getBid())) { + continue; + } + + for (Bid bid : seatBid.getBid()) { + try { + bidderBids.add(makeBidderBid(bid, seatBid.getSeat(), currency, imp)); + } catch (PreBidException e) { + errors.add(BidderError.badServerResponse(e.getMessage())); + } + } + } + + return bidderBids; + } + + private static BidderBid makeBidderBid(Bid bid, String seat, String currency, Imp imp) { + if (!BidderUtil.isValidPrice(bid.getPrice())) { + throw new PreBidException("price %s <= 0 filtered out".formatted(bid.getPrice())); } - return bidsFromResponse(bidResponse, bidRequest); + + final BidType bidType = Optional.ofNullable(getBidType(bid)) + .orElseGet(() -> getBidType(bid, imp)); + + return StringUtils.isNotBlank(seat) + ? BidderBid.of(bid, bidType, seat, currency) + : BidderBid.of(bid, bidType, currency); } - private static List bidsFromResponse(BidResponse bidResponse, BidRequest bidRequest) { - return bidResponse.getSeatbid().stream() - .filter(Objects::nonNull) - .map(SeatBid::getBid) - .filter(Objects::nonNull) - .flatMap(Collection::stream) - .map(bid -> BidderBid.of(bid, getBidType(bid, bidRequest.getImp()), DEFAULT_CURRENCY)) - .toList(); + private static BidType getBidType(Bid bid) { + final Integer mtype = bid.getMtype(); + return switch (mtype) { + case 1 -> BidType.banner; + case 2 -> BidType.video; + case 3 -> BidType.audio; + case 4 -> BidType.xNative; + case null -> null; + default -> throw new PreBidException("Unsupported MType: " + mtype); + }; } - private static BidType getBidType(Bid bid, List imps) { - final String impId = bid.getImpid(); - for (Imp imp : imps) { - if (imp.getId().equals(impId)) { - if (imp.getBanner() != null) { - return BidType.banner; - } else if (imp.getVideo() != null) { - return BidType.video; - } else if (imp.getAudio() != null) { - return BidType.audio; - } - } + private static BidType getBidType(Bid bid, Imp imp) { + if (!imp.getId().equals(bid.getImpid())) { + throw new PreBidException("No matching impression found for ImpID: " + bid.getImpid()); + } + + if (imp.getVideo() != null) { + return BidType.video; + } else if (imp.getAudio() != null) { + return BidType.audio; + } else if (imp.getXNative() != null) { + return BidType.xNative; } - throw new PreBidException("Failed to find banner/video/audio impression " + impId); + return BidType.banner; } } diff --git a/src/main/java/org/prebid/server/spring/config/ServiceConfiguration.java b/src/main/java/org/prebid/server/spring/config/ServiceConfiguration.java index 9426c810038..d2146333737 100644 --- a/src/main/java/org/prebid/server/spring/config/ServiceConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/ServiceConfiguration.java @@ -141,7 +141,6 @@ import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; -import jakarta.validation.constraints.Min; import java.io.IOException; import java.time.Clock; import java.util.ArrayList; @@ -471,7 +470,6 @@ Ortb2RequestFactory openRtb2RequestFactory( @Bean AuctionRequestFactory auctionRequestFactory( - @Value("${auction.max-request-size}") @Min(0) int maxRequestSize, Ortb2RequestFactory ortb2RequestFactory, StoredRequestProcessor storedRequestProcessor, ProfilesProcessor profilesProcessor, @@ -488,7 +486,6 @@ AuctionRequestFactory auctionRequestFactory( BidAdjustmentsEnricher bidAdjustmentsEnricher) { return new AuctionRequestFactory( - maxRequestSize, ortb2RequestFactory, storedRequestProcessor, profilesProcessor, @@ -558,7 +555,6 @@ AmpRequestFactory ampRequestFactory(Ortb2RequestFactory ortb2RequestFactory, @Bean VideoRequestFactory videoRequestFactory( - @Value("${auction.max-request-size}") int maxRequestSize, @Value("${video.stored-request-required}") boolean enforceStoredRequest, @Value("${auction.video.escape-log-cache-regex:#{null}}") String escapeLogCacheRegex, Ortb2RequestFactory ortb2RequestFactory, @@ -571,7 +567,6 @@ VideoRequestFactory videoRequestFactory( GeoLocationServiceWrapper geoLocationServiceWrapper) { return new VideoRequestFactory( - maxRequestSize, enforceStoredRequest, escapeLogCacheRegex, ortb2RequestFactory, diff --git a/src/main/java/org/prebid/server/spring/config/VertxConfiguration.java b/src/main/java/org/prebid/server/spring/config/VertxConfiguration.java index 3ac62c8fd59..844a4f930dc 100644 --- a/src/main/java/org/prebid/server/spring/config/VertxConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/VertxConfiguration.java @@ -12,10 +12,13 @@ import org.prebid.server.log.LoggerFactory; import org.prebid.server.spring.config.metrics.MetricsConfiguration; import org.prebid.server.vertx.ContextRunner; +import org.prebid.server.vertx.http.ParametrizedDecompressionHandler; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import jakarta.validation.constraints.Min; + @Configuration public class VertxConfiguration { @@ -55,8 +58,18 @@ FileSystem fileSystem(Vertx vertx) { } @Bean - BodyHandler bodyHandler(@Value("${vertx.uploads-dir}") String uploadsDir) { - return BodyHandler.create(uploadsDir); + BodyHandler bodyHandler(@Value("${vertx.uploads-dir}") String uploadsDir, + @Value("${server.max-body-size}") @Min(0) long maxBodySize) { + + return BodyHandler.create(uploadsDir) + .setBodyLimit(maxBodySize); + } + + @Bean + ParametrizedDecompressionHandler gzipParamDecompressionHandler( + @Value("${server.max-body-size}") @Min(0) int maxBodySize) { + + return new ParametrizedDecompressionHandler(maxBodySize); } @Bean diff --git a/src/main/java/org/prebid/server/spring/config/bidder/ResetDigitalConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/ResetDigitalConfiguration.java index 5421fd03218..7163e38fe2a 100644 --- a/src/main/java/org/prebid/server/spring/config/bidder/ResetDigitalConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/bidder/ResetDigitalConfiguration.java @@ -2,7 +2,6 @@ import org.prebid.server.bidder.BidderDeps; import org.prebid.server.bidder.resetdigital.ResetDigitalBidder; -import org.prebid.server.currency.CurrencyConversionService; import org.prebid.server.json.JacksonMapper; import org.prebid.server.spring.config.bidder.model.BidderConfigurationProperties; import org.prebid.server.spring.config.bidder.util.BidderDepsAssembler; @@ -26,15 +25,11 @@ BidderConfigurationProperties configurationProperties() { @Bean BidderDeps resetDigitalBidderDeps(BidderConfigurationProperties resetDigitalConfigurationProperties, - CurrencyConversionService currencyConversionService, JacksonMapper mapper) { return BidderDepsAssembler.forBidder(BIDDER_NAME) .withConfig(resetDigitalConfigurationProperties) - .bidderCreator(config -> new ResetDigitalBidder( - config.getEndpoint(), - currencyConversionService, - mapper)) + .bidderCreator(config -> new ResetDigitalBidder(config.getEndpoint(), mapper)) .assemble(); } } diff --git a/src/main/java/org/prebid/server/spring/config/bidder/util/BidderDepsAssembler.java b/src/main/java/org/prebid/server/spring/config/bidder/util/BidderDepsAssembler.java index 415a20f8ee2..d81bbc02d26 100644 --- a/src/main/java/org/prebid/server/spring/config/bidder/util/BidderDepsAssembler.java +++ b/src/main/java/org/prebid/server/spring/config/bidder/util/BidderDepsAssembler.java @@ -21,6 +21,7 @@ import org.prebid.server.spring.config.bidder.model.MetaInfo; import org.prebid.server.spring.config.bidder.model.usersync.UsersyncConfigurationProperties; import org.prebid.server.spring.env.YamlPropertySourceFactory; +import org.prebid.server.util.ObjectUtil; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.MapConfigurationPropertySource; import org.springframework.core.io.InputStreamResource; @@ -210,11 +211,17 @@ private CFG configurationAsPropertiesObject(Object configuration, Class targe @SuppressWarnings({"unchecked", "rawtypes"}) private CFG mergeConfigurations(CFG aliasConfiguration, CFG coreConfiguration) { try { + final Integer aliasVendorId = ObjectUtil.getIfNotNull( + aliasConfiguration.getMetaInfo(), MetaInfo::getVendorId); final JsonNode mergedNode = JsonMergePatch .fromJson(MAPPER.valueToTree(aliasConfiguration)) .apply(MAPPER.valueToTree(coreConfiguration)); - return (CFG) MAPPER.treeToValue(mergedNode, (Class) coreConfiguration.getSelfClass()); + final CFG mergedConfiguration = (CFG) MAPPER.treeToValue( + mergedNode, (Class) coreConfiguration.getSelfClass()); + mergedConfiguration.getMetaInfo().setVendorId(aliasVendorId); + + return mergedConfiguration; } catch (JsonPatchException | JsonProcessingException e) { throw new IllegalArgumentException("Exception occurred while merging alias configuration", e); } diff --git a/src/main/java/org/prebid/server/spring/config/server/admin/AdminServerConfiguration.java b/src/main/java/org/prebid/server/spring/config/server/admin/AdminServerConfiguration.java index e88e04be03d..e64ea153aaa 100644 --- a/src/main/java/org/prebid/server/spring/config/server/admin/AdminServerConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/server/admin/AdminServerConfiguration.java @@ -4,6 +4,7 @@ import io.vertx.core.net.SocketAddress; import io.vertx.ext.web.Router; import io.vertx.ext.web.handler.BodyHandler; +import org.prebid.server.vertx.http.ParametrizedDecompressionHandler; import org.prebid.server.vertx.verticles.VerticleDefinition; import org.prebid.server.vertx.verticles.server.ServerVerticle; import org.springframework.beans.factory.annotation.Value; @@ -18,10 +19,12 @@ public class AdminServerConfiguration { @Bean Router adminPortAdminServerRouter(Vertx vertx, AdminResourcesBinder adminPortAdminResourcesBinder, - BodyHandler bodyHandler) { + BodyHandler bodyHandler, + ParametrizedDecompressionHandler parametrizedDecompressionHandler) { final Router router = Router.router(vertx); router.route().handler(bodyHandler); + router.route().handler(parametrizedDecompressionHandler); adminPortAdminResourcesBinder.bind(router); return router; diff --git a/src/main/java/org/prebid/server/spring/config/server/application/ApplicationServerConfiguration.java b/src/main/java/org/prebid/server/spring/config/server/application/ApplicationServerConfiguration.java index b16d1397cab..0d4785db1e9 100644 --- a/src/main/java/org/prebid/server/spring/config/server/application/ApplicationServerConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/server/application/ApplicationServerConfiguration.java @@ -64,6 +64,7 @@ import org.prebid.server.util.HttpUtil; import org.prebid.server.validation.BidderParamValidator; import org.prebid.server.version.PrebidVersionProvider; +import org.prebid.server.vertx.http.ParametrizedDecompressionHandler; import org.prebid.server.vertx.verticles.VerticleDefinition; import org.prebid.server.vertx.verticles.server.HttpEndpoint; import org.prebid.server.vertx.verticles.server.ServerVerticle; @@ -169,6 +170,7 @@ ExceptionHandler exceptionHandler(Metrics metrics) { @Bean Router applicationServerRouter(Vertx vertx, BodyHandler bodyHandler, + ParametrizedDecompressionHandler parametrizedDecompressionHandler, NoCacheHandler noCacheHandler, CorsHandler corsHandler, List resources, @@ -177,6 +179,7 @@ Router applicationServerRouter(Vertx vertx, final Router router = Router.router(vertx); router.route().handler(bodyHandler); + router.route().handler(parametrizedDecompressionHandler); router.route().handler(noCacheHandler); router.route().handler(corsHandler); diff --git a/src/main/java/org/prebid/server/vertx/http/ParametrizedDecompressionHandler.java b/src/main/java/org/prebid/server/vertx/http/ParametrizedDecompressionHandler.java new file mode 100644 index 00000000000..20af702492f --- /dev/null +++ b/src/main/java/org/prebid/server/vertx/http/ParametrizedDecompressionHandler.java @@ -0,0 +1,81 @@ +package org.prebid.server.vertx.http; + +import io.netty.handler.codec.http.HttpResponseStatus; +import io.vertx.core.Handler; +import io.vertx.core.buffer.Buffer; +import io.vertx.ext.web.RoutingContext; +import io.vertx.ext.web.impl.RoutingContextInternal; +import org.apache.commons.lang3.StringUtils; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.zip.GZIPInputStream; + +public class ParametrizedDecompressionHandler implements Handler { + + private final ThreadLocal intermediateBuffer; + private final ThreadLocal inputBuffer; + private final ThreadLocal outputBuffer; + + public ParametrizedDecompressionHandler(int maxBodySize) { + intermediateBuffer = ThreadLocal.withInitial(() -> new byte[16384]); + inputBuffer = ThreadLocal.withInitial(() -> new byte[maxBodySize]); + outputBuffer = ThreadLocal.withInitial(() -> new byte[2 * maxBodySize]); + } + + @Override + public void handle(RoutingContext routingContext) { + if (!StringUtils.equalsAny(routingContext.request().getParam("gzip"), "1", "true")) { + routingContext.next(); + return; + } + + try { + final Buffer decompressed = decompressGzip(routingContext.body().buffer()); + ((RoutingContextInternal) routingContext).setBody(decompressed); + routingContext.next(); + } catch (IOException e) { + respondWithBadRequest(routingContext, "Invalid body: " + e.getMessage()); + } + } + + private static void respondWithBadRequest(RoutingContext routingContext, String message) { + routingContext.response() + .setStatusCode(HttpResponseStatus.BAD_REQUEST.code()) + .end(message); + } + + private Buffer decompressGzip(Buffer compressed) throws IOException { + final byte[] decompressionBuffer = intermediateBuffer.get(); + final byte[] compressedBuffer = inputBuffer.get(); + final byte[] decompressedBuffer = outputBuffer.get(); + + compressed.getBytes(compressedBuffer); + try (ByteArrayInputStream input = new ByteArrayInputStream(compressedBuffer); + GZIPInputStream gzip = new GZIPInputStream(input); + FastByteArrayOutputStream baos = new FastByteArrayOutputStream(decompressedBuffer)) { + + int totalLen = 0; + int len; + while ((len = gzip.read(decompressionBuffer)) > 0) { + baos.write(decompressionBuffer, 0, len); + totalLen += len; + } + + compressed.setBytes(0, baos.getBuffer(), 0, totalLen); + return compressed.slice(0, totalLen); + } + } + + private static class FastByteArrayOutputStream extends ByteArrayOutputStream { + + FastByteArrayOutputStream(byte[] buf) { + this.buf = buf; + } + + public byte[] getBuffer() { + return buf; + } + } +} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 4439533ddc7..e92c50172af 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -10,6 +10,7 @@ vertx: server: max-initial-line-length: 8092 max-headers-size: 16384 + max-body-size: 262144 ssl: false jks-path: jks-password: @@ -119,7 +120,6 @@ auction: log-result: false log-failure-only: false log-sampling-rate: 0.0 - max-request-size: 262144 generate-bid-id: false cache: expected-request-time-ms: 10 diff --git a/src/main/resources/bidder-config/adf.yaml b/src/main/resources/bidder-config/adf.yaml index 7aa57c8ecae..5f25325dcf6 100644 --- a/src/main/resources/bidder-config/adf.yaml +++ b/src/main/resources/bidder-config/adf.yaml @@ -2,7 +2,9 @@ adapters: adf: endpoint: https://adx.adform.net/adx/openrtb aliases: - adform: ~ + adform: + meta-info: + vendor-id: 50 meta-info: maintainer-email: scope.sspp@adform.com app-media-types: diff --git a/src/main/resources/bidder-config/adkernel.yaml b/src/main/resources/bidder-config/adkernel.yaml index 1f594cf7275..a2307cff83c 100644 --- a/src/main/resources/bidder-config/adkernel.yaml +++ b/src/main/resources/bidder-config/adkernel.yaml @@ -3,8 +3,12 @@ adapters: endpoint: http://pbs.adksrv.com/hb?zone={ZoneId} endpoint-compression: gzip aliases: - rxnetwork: ~ - 152media: ~ + rxnetwork: + meta-info: + vendor-id: 0 + 152media: + meta-info: + vendor-id: 1111 xapads: enabled: false meta-info: diff --git a/src/main/resources/bidder-config/admatic.yaml b/src/main/resources/bidder-config/admatic.yaml index 3085797000c..a65d6502441 100644 --- a/src/main/resources/bidder-config/admatic.yaml +++ b/src/main/resources/bidder-config/admatic.yaml @@ -6,24 +6,30 @@ adapters: enabled: false meta-info: maintainer-email: publisher@adtarget.com.tr - vendor-id: 779 + vendor-id: 779 pixad: enabled: false meta-info: maintainer-email: prebid@pixad.com.tr + vendor-id: 1281 monetixads: enabled: false meta-info: maintainer-email: team@monetixads.com + vendor-id: 1281 admaticde: enabled: false + meta-info: + vendor-id: 1281 yobee: enabled: false meta-info: maintainer-email: adops@yobee.it + vendor-id: 1281 netaddiction: meta-info: maintainer-email: publishers-support@netaddiction.it + vendor-id: 1281 meta-info: maintainer-email: prebid@admatic.com.tr app-media-types: diff --git a/src/main/resources/bidder-config/adtelligent.yaml b/src/main/resources/bidder-config/adtelligent.yaml index faeb18c9bdf..8e4775294c0 100644 --- a/src/main/resources/bidder-config/adtelligent.yaml +++ b/src/main/resources/bidder-config/adtelligent.yaml @@ -17,25 +17,25 @@ adapters: - video site-media-types: - video - vendor-id: 0 + vendor-id: 410 janet: enabled: false endpoint: http://ghb.bidder.jmgads.com/pbs/ortb meta-info: maintainer-email: info@thejmg.com - vendor-id: 0 + vendor-id: 410 pgam: enabled: false endpoint: http://ghb.pgamssp.com/pbs/ortb meta-info: maintainer-email: ppatel@pgammedia.com - vendor-id: 0 + vendor-id: 1353 copper6: enabled: false endpoint: http://ghb.app.copper6.com/pbs/ortb meta-info: maintainer-email: info@copper6.com - vendor-id: 0 + vendor-id: 1356 indicue: enabled: false endpoint: http://ghb.console.indicue.com/pbs/ortb diff --git a/src/main/resources/bidder-config/adverxo.yaml b/src/main/resources/bidder-config/adverxo.yaml index 469aec0ce59..988897fcddc 100644 --- a/src/main/resources/bidder-config/adverxo.yaml +++ b/src/main/resources/bidder-config/adverxo.yaml @@ -6,6 +6,8 @@ adapters: adport: enabled: false endpoint: https://adport.pbsadverxo.com/auction?id={adUnitId}&auth={auth} + meta-info: + vendor-id: 0 usersync: enabled: false cookie-family-name: adport @@ -18,6 +20,8 @@ adapters: bidsmind: enabled: false endpoint: https://bidsmind.pbsadverxo.com/auction?id={adUnitId}&auth={auth} + meta-info: + vendor-id: 0 usersync: enabled: false cookie-family-name: bidsmind @@ -30,6 +34,8 @@ adapters: harrenmedia: enabled: false endpoint: https://harrenmedia.pbsadverxo.com/auction?id={adUnitId}&auth={auth} + meta-info: + vendor-id: 0 usersync: enabled: false cookie-family-name: harrenmedia diff --git a/src/main/resources/bidder-config/apacdex.yaml b/src/main/resources/bidder-config/apacdex.yaml index 1fb97e98e34..974857be722 100644 --- a/src/main/resources/bidder-config/apacdex.yaml +++ b/src/main/resources/bidder-config/apacdex.yaml @@ -3,8 +3,12 @@ adapters: modifying-vast-xml-allowed: false endpoint: http://useast.quantumdex.io/auction/pbs aliases: - quantumdex: ~ - valueimpression: ~ + quantumdex: + meta-info: + vendor-id: 0 + valueimpression: + meta-info: + vendor-id: 0 meta-info: maintainer-email: support@apacdex.com app-media-types: diff --git a/src/main/resources/bidder-config/appnexus.yaml b/src/main/resources/bidder-config/appnexus.yaml index 68ea6ec9658..318dad0ec9d 100644 --- a/src/main/resources/bidder-config/appnexus.yaml +++ b/src/main/resources/bidder-config/appnexus.yaml @@ -5,6 +5,7 @@ adapters: mediafuse: meta-info: maintainer-email: support@mediafuse.com + vendor-id: 0 meta-info: maintainer-email: prebid@microsoft.com app-media-types: diff --git a/src/main/resources/bidder-config/aso.yaml b/src/main/resources/bidder-config/aso.yaml index 14ba5ff60e9..40f0e4e8186 100644 --- a/src/main/resources/bidder-config/aso.yaml +++ b/src/main/resources/bidder-config/aso.yaml @@ -7,18 +7,20 @@ adapters: endpoint: https://srv.datacygnal.io/pbs/bidder?zid={ZoneID} meta-info: maintainer-email: contact@bcm.ltd + vendor-id: 0 usersync: cookie-family-name: bcmint redirect: url: https://track.datacygnal.io/sync/v2?gdpr={gdpr}&gdpr_consent={gdpr_consent}&usp={us_privacy}&gpp={gpp}&gpp_sid={gpp_sid}&redir={redirect_url} uid-macro: '{uid}' - bidagency: + bidgency: enabled: false endpoint: https://srv.bidgx.com/pbs/bidder?zid={ZoneID} meta-info: maintainer-email: aso@bidgency.com + vendor-id: 0 usersync: - cookie-family-name: bidagency + cookie-family-name: bidgency redirect: url: https://track.bidgx.com/sync/v2?gdpr={gdpr}&gdpr_consent={gdpr_consent}&usp={us_privacy}&gpp={gpp}&gpp_sid={gpp_sid}&redir={redirect_url} uid-macro: '{uid}' @@ -27,6 +29,7 @@ adapters: endpoint: https://srv.kntxy.com/pbs/bidder?zid={ZoneID} meta-info: maintainer-email: ssp@kuantyx.com + vendor-id: 0 usersync: cookie-family-name: kuantyx redirect: diff --git a/src/main/resources/bidder-config/beyondmedia.yaml b/src/main/resources/bidder-config/beyondmedia.yaml index 7c5859a1c39..e187f64d85a 100644 --- a/src/main/resources/bidder-config/beyondmedia.yaml +++ b/src/main/resources/bidder-config/beyondmedia.yaml @@ -4,6 +4,8 @@ adapters: aliases: andbeyondmedia: endpoint: http://backend.andbeyond.media/pserver + meta-info: + vendor-id: 0 meta-info: maintainer-email: sysengg@andbeyond.media app-media-types: diff --git a/src/main/resources/bidder-config/colossus.yaml b/src/main/resources/bidder-config/colossus.yaml index b03b7dcb72a..d74bfbd505a 100644 --- a/src/main/resources/bidder-config/colossus.yaml +++ b/src/main/resources/bidder-config/colossus.yaml @@ -5,6 +5,8 @@ adapters: aliases: colossusssp: enabled: false + meta-info: + vendor-id: 0 meta-info: maintainer-email: support@colossusmediassp.com app-media-types: diff --git a/src/main/resources/bidder-config/elementaltv.yaml b/src/main/resources/bidder-config/elementaltv.yaml index 0d6a83cf6a9..f5e3fc8d8d8 100644 --- a/src/main/resources/bidder-config/elementaltv.yaml +++ b/src/main/resources/bidder-config/elementaltv.yaml @@ -3,7 +3,9 @@ adapters: endpoint: https://pbs.elementaltv.io/ads/processHeaderBid/{AdUnit} ortb-version: "2.6" aliases: - adoppler: ~ + adoppler: + meta-info: + vendor-id: 0 meta-info: maintainer-email: support@elementaltv.com app-media-types: diff --git a/src/main/resources/bidder-config/emxdigital.yaml b/src/main/resources/bidder-config/emxdigital.yaml index f89c489dc51..e358522534b 100644 --- a/src/main/resources/bidder-config/emxdigital.yaml +++ b/src/main/resources/bidder-config/emxdigital.yaml @@ -4,6 +4,8 @@ adapters: aliases: cadent_aperture_mx: enabled: false + meta-info: + vendor-id: 183 # CadentAperture only operates in North America geoscope: - USA diff --git a/src/main/resources/bidder-config/epsilon.yaml b/src/main/resources/bidder-config/epsilon.yaml index b93929ad431..63767be2b34 100644 --- a/src/main/resources/bidder-config/epsilon.yaml +++ b/src/main/resources/bidder-config/epsilon.yaml @@ -4,6 +4,8 @@ adapters: ortb-version: "2.6" aliases: conversant: + meta-info: + vendor-id: 24 usersync: cookie-family-name: conversant meta-info: diff --git a/src/main/resources/bidder-config/freewheelssp.yaml b/src/main/resources/bidder-config/freewheelssp.yaml index cb0cb6d04cb..97d488da30b 100644 --- a/src/main/resources/bidder-config/freewheelssp.yaml +++ b/src/main/resources/bidder-config/freewheelssp.yaml @@ -8,6 +8,8 @@ adapters: enabled: false endpoint: "https://prebid.v.fwmrm.net/ortb/ssp" endpoint-compression: gzip + meta-info: + vendor-id: 285 usersync: enabled: true cookie-family-name: fwssp diff --git a/src/main/resources/bidder-config/generic.yaml b/src/main/resources/bidder-config/generic.yaml index 80f5af96d1c..57ab0ca72e8 100644 --- a/src/main/resources/bidder-config/generic.yaml +++ b/src/main/resources/bidder-config/generic.yaml @@ -4,6 +4,8 @@ adapters: aliases: genericAlias: enabled: false + meta-info: + vendor-id: 0 adrino: enabled: false endpoint: https://prd-prebid-bidder.adrino.io/openrtb/bid diff --git a/src/main/resources/bidder-config/gothamads.yaml b/src/main/resources/bidder-config/gothamads.yaml index 9b4add5f93d..1cc2e2fe26b 100644 --- a/src/main/resources/bidder-config/gothamads.yaml +++ b/src/main/resources/bidder-config/gothamads.yaml @@ -7,6 +7,7 @@ adapters: endpoint: http://lb-east.intenze.co/?pass={AccountID} meta-info: maintainer-email: connect@intenze.co + vendor-id: 0 meta-info: maintainer-email: support@gothamads.com app-media-types: diff --git a/src/main/resources/bidder-config/imds.yaml b/src/main/resources/bidder-config/imds.yaml index b617fb99d39..ee52cfd8bc9 100644 --- a/src/main/resources/bidder-config/imds.yaml +++ b/src/main/resources/bidder-config/imds.yaml @@ -9,6 +9,8 @@ adapters: synacormedia: deprecated-names: null # Must re-declare as empty or the deprecation error in the response is incorrect endpoint: "https://pbs.technoratimedia.com/openrtb/bids/{AccountID}?src={SourceId}&adapter=synacormedia" + meta-info: + vendor-id: 0 endpoint: "https://pbs.technoratimedia.com/openrtb/bids/{AccountID}?src={SourceId}&adapter=imds" meta-info: maintainer-email: eng-demand@imds.tv diff --git a/src/main/resources/bidder-config/limelightDigital.yaml b/src/main/resources/bidder-config/limelightDigital.yaml index 4ce130419ef..8b7822cecf2 100644 --- a/src/main/resources/bidder-config/limelightDigital.yaml +++ b/src/main/resources/bidder-config/limelightDigital.yaml @@ -4,6 +4,8 @@ adapters: aliases: filmzie: enabled: false + meta-info: + vendor-id: 0 iionads: enabled: false endpoint: http://ads-pbs.iionads.com/openrtb/{PublisherID}?host={Host} @@ -12,6 +14,8 @@ adapters: evtech: enabled: false endpoint: http://ads-pbs.direct.e-volution.ai/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 usersync: enabled: true cookie-family-name: evtech @@ -24,38 +28,62 @@ adapters: adsyield: enabled: false endpoint: http://ads-pbs.open-adsyield.com/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 greedygame: enabled: false endpoint: http://ads-pbs.rtb-greedygame.com/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 appstock: enabled: false endpoint: http://ads-pbs.pre.vr-tb.com/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 xtrmqb: enabled: false endpoint: http://ads-pbs.ortb.tech/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 embimedia: enabled: false endpoint: http://ads-pbs.bidder-embi.media/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 tgm: enabled: false + meta-info: + vendor-id: 0 streamlyn: enabled: false endpoint: http://rtba.bidsxchange.com/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 streamvision: enabled: false endpoint: http://ads-pbs.adops.streamvisionmedia.com/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 orangeclickmedia: enabled: false endpoint: http://ads-pbs.scotty.orangeclickmedia.com/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 velonium: enabled: false endpoint: http://ads-pbs.adxvel.com/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 adtg_org: enabled: false endpoint: http://ads-pbs.rtb.adtarget.org/openrtb/{PublisherID}?host={Host} + meta-info: + vendor-id: 0 performist: enabled: false endpoint: http://ads-pbs.performserv.com/openrtb/{PublisherID} + meta-info: + vendor-id: 0 meta-info: maintainer-email: engineering@project-limelight.com app-media-types: diff --git a/src/main/resources/bidder-config/magnite.yaml b/src/main/resources/bidder-config/magnite.yaml index 64a95dd98bd..d2259d3a95b 100644 --- a/src/main/resources/bidder-config/magnite.yaml +++ b/src/main/resources/bidder-config/magnite.yaml @@ -11,6 +11,8 @@ adapters: aliases: rubicon: enabled: false + meta-info: + vendor-id: 52 ortb: multiformat-supported: true meta-info: diff --git a/src/main/resources/bidder-config/nexx360.yaml b/src/main/resources/bidder-config/nexx360.yaml index 129fcaaf95e..802b8b2963d 100644 --- a/src/main/resources/bidder-config/nexx360.yaml +++ b/src/main/resources/bidder-config/nexx360.yaml @@ -3,9 +3,15 @@ adapters: endpoint: http://fast.nexx360.io/prebid-server endpoint-compression: gzip aliases: - 1accord: ~ - easybid: ~ - prismassp: ~ + 1accord: + meta-info: + vendor-id: 0 + easybid: + meta-info: + vendor-id: 0 + prismassp: + meta-info: + vendor-id: 0 ybidder: enabled: false meta-info: diff --git a/src/main/resources/bidder-config/resetdigital.yaml b/src/main/resources/bidder-config/resetdigital.yaml index 5efda8c5b3c..78b59045e5b 100644 --- a/src/main/resources/bidder-config/resetdigital.yaml +++ b/src/main/resources/bidder-config/resetdigital.yaml @@ -1,20 +1,23 @@ adapters: resetdigital: - endpoint: http://b-us-east14.resetdigital.co:9001 + endpoint: https://prebid.resetdigital.co + endpoint-compression: gzip meta-info: maintainer-email: biddersupport@resetdigital.co app-media-types: - banner - video + - native - audio site-media-types: - banner - video + - native - audio supported-vendors: vendor-id: 1162 usersync: cookie-family-name: resetdigital redirect: - url: https://sync.resetdigital.co/csync?pid=rubicon&redir={redirect_url} - uid-macro: '$USER_ID' + url: https://sync.resetdigital.co/usersync?gdpr={gdpr}&gdpr_consent={gdpr_consent}&us_privacy={us_privacy}&redirect={redirect_url} + uid-macro: '$UID' diff --git a/src/main/resources/bidder-config/screencore.yaml b/src/main/resources/bidder-config/screencore.yaml index 87331bd4abd..7d471dbd1df 100644 --- a/src/main/resources/bidder-config/screencore.yaml +++ b/src/main/resources/bidder-config/screencore.yaml @@ -12,4 +12,4 @@ adapters: - video - native supported-vendors: - vendor-id: 0 + vendor-id: 1473 diff --git a/src/main/resources/bidder-config/seedingAlliance.yaml b/src/main/resources/bidder-config/seedingAlliance.yaml index 212dab14afe..890074d823c 100644 --- a/src/main/resources/bidder-config/seedingAlliance.yaml +++ b/src/main/resources/bidder-config/seedingAlliance.yaml @@ -16,6 +16,8 @@ adapters: finative: enabled: false endpoint: https://b.finative.cloud/cds/rtb/bid?ssp={AccountId} + meta-info: + vendor-id: 371 meta-info: maintainer-email: tech@seeding-alliance.de app-media-types: diff --git a/src/main/resources/bidder-config/showheroes.yaml b/src/main/resources/bidder-config/showheroes.yaml index b5fd953ac71..16fde8ec973 100644 --- a/src/main/resources/bidder-config/showheroes.yaml +++ b/src/main/resources/bidder-config/showheroes.yaml @@ -2,8 +2,12 @@ adapters: showheroes: endpoint: https://ads.viralize.tv/openrtb2/auction/ aliases: - showheroes-bs: ~ - showheroesBs: ~ + showheroes-bs: + meta-info: + vendor-id: 111 + showheroesBs: + meta-info: + vendor-id: 111 ortb-version: '2.6' meta-info: maintainer-email: tech@showheroes.com diff --git a/src/main/resources/bidder-config/smartadserver.yaml b/src/main/resources/bidder-config/smartadserver.yaml index cfb95121f45..81704a4c2a3 100644 --- a/src/main/resources/bidder-config/smartadserver.yaml +++ b/src/main/resources/bidder-config/smartadserver.yaml @@ -6,6 +6,8 @@ adapters: aliases: equativ: enabled: false + meta-info: + vendor-id: 45 meta-info: maintainer-email: supply-partner-integration@equativ.com app-media-types: diff --git a/src/main/resources/bidder-config/smarthub.yaml b/src/main/resources/bidder-config/smarthub.yaml index 118742dc858..8ed2e05b854 100644 --- a/src/main/resources/bidder-config/smarthub.yaml +++ b/src/main/resources/bidder-config/smarthub.yaml @@ -5,30 +5,48 @@ adapters: markapp: enabled: false endpoint: https://markapp-prebid.attekmi.com/pbserver/?seat={AccountID}&token={SourceId} + meta-info: + vendor-id: 0 jdpmedia: enabled: false endpoint: https://jdpmedia-prebid.attekmi.com/pbserver/?seat={AccountID}&token={SourceId} + meta-info: + vendor-id: 0 tredio: enabled: false endpoint: https://tredio-prebid.attekmi.com/pbserver/?seat={AccountID}&token={SourceId} + meta-info: + vendor-id: 0 felixads: enabled: false endpoint: https://felixads-prebid.attekmi.com/pbserver/?seat={AccountID}&token={SourceId} + meta-info: + vendor-id: 0 jambojar: enabled: false endpoint: https://jambojar-prebid.attekmi.com/pbserver/?seat={AccountID}&token={SourceId} + meta-info: + vendor-id: 0 adinify: enabled: false endpoint: https://adinify-prebid.attekmi.com/pbserver/?seat={AccountID}&token={SourceId} + meta-info: + vendor-id: 0 artechnology: enabled: false endpoint: https://artechnology-prebid.attekmi.com/pbserver/?seat={AccountID}&token={SourceId} + meta-info: + vendor-id: 0 addigi: enabled: false endpoint: https://addigi-prebid.attekmi.com/pbserver/?seat={AccountID}&token={SourceId} - radianfusion: + meta-info: + vendor-id: 0 + radiantfusion: enabled: false endpoint: https://radiantfusion-prebid.attekmi.co/pbserver/?seat={AccountID}&token={SourceId} + meta-info: + vendor-id: 0 meta-info: maintainer-email: prebid@attekmi.com app-media-types: diff --git a/src/main/resources/bidder-config/teal.yaml b/src/main/resources/bidder-config/teal.yaml index 38f06be0be3..0ea60923d2d 100644 --- a/src/main/resources/bidder-config/teal.yaml +++ b/src/main/resources/bidder-config/teal.yaml @@ -9,6 +9,8 @@ adapters: aliases: tealplus: enabled: false + meta-info: + vendor-id: 1378 ortb: multiformat-supported: true meta-info: diff --git a/src/main/resources/bidder-config/teqblaze.yaml b/src/main/resources/bidder-config/teqblaze.yaml index 094beaec09a..d6c34012379 100644 --- a/src/main/resources/bidder-config/teqblaze.yaml +++ b/src/main/resources/bidder-config/teqblaze.yaml @@ -7,6 +7,7 @@ adapters: endpoint: https://ssp.360playvid.com/pserver meta-info: maintainer-email: prebid@360playvid.com + vendor-id: 0 usersync: enabled: true cookie-family-name: 360playvid @@ -21,11 +22,13 @@ adapters: endpoint: https://us-east-ep.pinklion.io/pserver meta-info: maintainer-email: prebid@pinklion.io + vendor-id: 0 rocketlab: enabled: false endpoint: https://traffic1.rocketlab.ai/pserver meta-info: maintainer-email: support@rocketlab.ai + vendor-id: 0 usersync: enabled: true cookie-family-name: rocketlab @@ -39,6 +42,7 @@ adapters: endpoint: https://#{REGION}#.al-ad.com/pserver meta-info: maintainer-email: sdksupport@app-stock.com + vendor-id: 0 usersync: enabled: true cookie-family-name: appStockSSP @@ -51,7 +55,7 @@ adapters: gravite: enabled: false endpoint: https://node1-rtb.gravite.net/pserver - mata-info: + meta-info: maintainer-email: support@gravite.net vendor-id: 377 bidfuse: @@ -59,6 +63,7 @@ adapters: endpoint: https://bn.bidfuse.com/pserver meta-info: maintainer-email: support@bidfuse.com + vendor-id: 0 usersync: enabled: true cookie-family-name: bidfuse @@ -94,6 +99,7 @@ adapters: endpoint: https://east-backend.mycodemedia.com/pserver meta-info: maintainer-email: support-platform@mycodemedia.com + vendor-id: 0 usersync: enabled: true cookie-family-name: mycodemedia @@ -108,6 +114,7 @@ adapters: endpoint: https://tag-ssp.adsmovil.com/pserver meta-info: maintainer-email: prebid@adsmovil.com + vendor-id: 0 meta-info: maintainer-email: github@teqblaze.com app-media-types: diff --git a/src/main/resources/bidder-config/thetradedesk.yaml b/src/main/resources/bidder-config/thetradedesk.yaml index 74d6bf2176b..628e3b149fa 100644 --- a/src/main/resources/bidder-config/thetradedesk.yaml +++ b/src/main/resources/bidder-config/thetradedesk.yaml @@ -2,7 +2,9 @@ adapters: thetradedesk: endpoint: https://direct.adsrvr.org/bid/bidder/{SupplyId} aliases: - ttd: ~ + ttd: + meta-info: + vendor-id: 21 meta-info: maintainer-email: Prebid-Maintainers@thetradedesk.com app-media-types: diff --git a/src/main/resources/bidder-config/thirtythreeacross.yaml b/src/main/resources/bidder-config/thirtythreeacross.yaml index 990440ca78d..fd76cc6254d 100644 --- a/src/main/resources/bidder-config/thirtythreeacross.yaml +++ b/src/main/resources/bidder-config/thirtythreeacross.yaml @@ -7,8 +7,12 @@ adapters: aliases: 33across: enabled: false + meta-info: + vendor-id: 58 ttx: enabled: false + meta-info: + vendor-id: 58 meta-info: maintainer-email: headerbidding@33across.com app-media-types: diff --git a/src/main/resources/bidder-config/vidazoo.yaml b/src/main/resources/bidder-config/vidazoo.yaml index b116a231baa..93a0d2287c9 100644 --- a/src/main/resources/bidder-config/vidazoo.yaml +++ b/src/main/resources/bidder-config/vidazoo.yaml @@ -4,10 +4,11 @@ adapters: aliases: omnidex: endpoint: https://exchange.omni-dex.io/openrtb/{ConnectionId} + meta-info: + vendor-id: 1463 usersync: enabled: true cookie-family-name: omnidex - vendor-id: 1463 iframe: url: https://sync.omni-dex.io/api/user/html/6810d0c7f163277130f3d7a9?pbs=true&gdpr={gdpr}&gdpr_consent={gdpr_consent}&us_privacy={us_privacy}&redirect={redirect_url}&gpp={gpp}&gpp_sid={gpp_sid} uid-macro: '${userId}' @@ -15,6 +16,7 @@ adapters: endpoint: https://exchange.tagoras.io/openrtb/{ConnectionId} meta-info: maintainer-email: prebid@tagoras.io + vendor-id: 1450 usersync: enabled: true cookie-family-name: tagoras diff --git a/src/main/resources/bidder-config/vungle.yaml b/src/main/resources/bidder-config/vungle.yaml index 0a9baf58403..53c20a2e959 100644 --- a/src/main/resources/bidder-config/vungle.yaml +++ b/src/main/resources/bidder-config/vungle.yaml @@ -4,6 +4,8 @@ adapters: aliases: liftoff: enabled: false + meta-info: + vendor-id: 0 modifying-vast-xml-allowed: true endpoint-compression: gzip meta-info: diff --git a/src/main/resources/bidder-config/xeworks.yaml b/src/main/resources/bidder-config/xeworks.yaml index c37e5b098a0..911fab6c66c 100644 --- a/src/main/resources/bidder-config/xeworks.yaml +++ b/src/main/resources/bidder-config/xeworks.yaml @@ -7,6 +7,7 @@ adapters: endpoint: http://rtb.connektai.live/?pid={SourceId}&host={Host}&s=pbs meta-info: maintainer-email: adops@connekt.ai + vendor-id: 0 adipolo: enabled: false endpoint: http://rtb.adipolo.live?pid={SourceId}&host={Host}&pbs=1 diff --git a/src/main/resources/bidder-config/yahooAds.yaml b/src/main/resources/bidder-config/yahooAds.yaml index c45be2e9377..4359ee36f16 100644 --- a/src/main/resources/bidder-config/yahooAds.yaml +++ b/src/main/resources/bidder-config/yahooAds.yaml @@ -3,9 +3,15 @@ adapters: endpoint: https://s2shb.ssp.yahoo.com/admax/bid/partners/PBS ortb-version: "2.6" aliases: - yssp: ~ - yahoossp: ~ - yahooAdvertising: ~ + yssp: + meta-info: + vendor-id: 25 + yahoossp: + meta-info: + vendor-id: 25 + yahooAdvertising: + meta-info: + vendor-id: 25 meta-info: maintainer-email: prebid-tech-team@yahooinc.com app-media-types: diff --git a/src/main/resources/static/bidder-params/resetdigital.json b/src/main/resources/static/bidder-params/resetdigital.json index 3710cfbc598..dc79816ce68 100644 --- a/src/main/resources/static/bidder-params/resetdigital.json +++ b/src/main/resources/static/bidder-params/resetdigital.json @@ -4,20 +4,12 @@ "description": "A schema which validates params accepted by the ResetDigital adapter", "type": "object", "properties": { - "pubId": { + "placement_id": { "type": "string", - "description": "The publisher's ID provided" - }, - "zoneId": { - "type": "string", - "description": "Zone ID" - }, - "forceBid": { - "type": "boolean", - "description": "Force bids with a test creative" + "description": "Placement ID provided by ResetDigital", + "minLength": 1 } }, - "required": [ - "pubId" - ] + "required": ["placement_id"], + "additionalProperties": false } diff --git a/src/test/groovy/org/prebid/server/functional/tests/AlternateBidderCodeSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/AlternateBidderCodeSpec.groovy index aabdc832c72..27bc35f3cc3 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/AlternateBidderCodeSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/AlternateBidderCodeSpec.groovy @@ -1339,8 +1339,9 @@ class AlternateBidderCodeSpec extends BaseSpec { def "PBS shouldn't discard bid when hard alias and alternate bidder allow bidder code"() { given: "PBS config with bidder" - def pbsConfig = AMX_CONFIG + ["adapters.amx.aliases.alias.enabled" : "true", - "adapters.amx.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + def pbsConfig = AMX_CONFIG + ["adapters.amx.aliases.alias.enabled" : "true", + "adapters.amx.aliases.alias.meta-info.vendor-id": "0", + "adapters.amx.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] def defaultPbsService = pbsServiceFactory.getService(pbsConfig) and: "Default bid request with alias" @@ -1525,8 +1526,9 @@ class AlternateBidderCodeSpec extends BaseSpec { def "PBS should populate adapter code with requested bidder when conflict soft and hard alias and alternate bidder code"() { given: "PBS config with bidder" - def pbsConfig = AMX_CONFIG + ["adapters.amx.aliases.alias.enabled" : "true", - "adapters.amx.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + def pbsConfig = AMX_CONFIG + ["adapters.amx.aliases.alias.enabled" : "true", + "adapters.amx.aliases.alias.meta-info.vendor-id": "0", + "adapters.amx.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] def defaultPbsService = pbsServiceFactory.getService(pbsConfig) and: "Bid request with amx bidder and targeting" diff --git a/src/test/groovy/org/prebid/server/functional/tests/BaseSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/BaseSpec.groovy index 880b4ab5636..b50f9772eef 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/BaseSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/BaseSpec.groovy @@ -47,8 +47,9 @@ abstract class BaseSpec extends Specification implements ObjectMapperWrapper { private static final int DEFAULT_TARGETING_PRECISION = 1 private static final String DEFAULT_CACHE_DIRECTORY = "/app/prebid-server/data" protected static final String ALERT_GENERAL = "alerts.general" - protected static final Map GENERIC_ALIAS_CONFIG = ["adapters.generic.aliases.alias.enabled" : "true", - "adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + protected static final Map GENERIC_ALIAS_CONFIG = ["adapters.generic.aliases.alias.enabled" : "true", + "adapters.generic.aliases.alias.meta-info.vendor-id": "0", + "adapters.generic.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] protected static final PrebidServerService defaultPbsService = pbsServiceFactory.getService([:]) @@ -116,7 +117,7 @@ abstract class BaseSpec extends Specification implements ObjectMapperWrapper { } private static LinkedHashMap> collectRequestByBidderName(String bidderName, - List bidderCalls) { + List bidderCalls) { [(bidderName): bidderCalls.collect { bidderCall -> decode(bidderCall.requestBody as String, BidRequest) }] } diff --git a/src/test/groovy/org/prebid/server/functional/tests/BidderFieldDisplayBehaviorSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/BidderFieldDisplayBehaviorSpec.groovy index 6acd01d09cd..57df9ae7c53 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/BidderFieldDisplayBehaviorSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/BidderFieldDisplayBehaviorSpec.groovy @@ -48,7 +48,7 @@ import static org.prebid.server.functional.model.Currency.USD import static org.prebid.server.functional.model.bidder.BidderName.ALIAS import static org.prebid.server.functional.model.bidder.BidderName.GENERIC import static org.prebid.server.functional.model.bidder.BidderName.OPENX -import static org.prebid.server.functional.model.bidder.BidderName.RUBICON +import static org.prebid.server.functional.model.bidder.BidderName.MAGNITE import static org.prebid.server.functional.model.mock.services.currencyconversion.CurrencyConversionRatesResponse.defaultConversionRates import static org.prebid.server.functional.model.request.auction.AdjustmentType.MULTIPLIER import static org.prebid.server.functional.model.request.auction.BidAdjustmentMediaType.BANNER @@ -342,7 +342,7 @@ class BidderFieldDisplayBehaviorSpec extends BaseSpec { ext.prebid.alternateBidderCodes = new AlternateBidderCodes().tap { it.enabled = true it.bidders = [(GENERIC): new CodesBidderConfig(enabled: true, allowedBidderCodes: [GENERIC]), - (RUBICON): new CodesBidderConfig(enabled: true, allowedBidderCodes: [RUBICON])] + (MAGNITE): new CodesBidderConfig(enabled: true, allowedBidderCodes: [MAGNITE])] } } @@ -497,11 +497,11 @@ class BidderFieldDisplayBehaviorSpec extends BaseSpec { given: "Default basic BidRequest with generic bidder with includeBidderKeys = false" def bidRequest = BidRequest.defaultBidRequest - and: "Set maxbids = 2 for generic and rubicon bidder" + and: "Set maxbids = 2 for generic and magnite bidder" def maxBids = 2 def genericMultiBid = new MultiBid(bidder: GENERIC, maxBids: maxBids, targetBidderCodePrefix: PBSUtils.randomString) - def rubiconMultiBid = new MultiBid(bidder: RUBICON, maxBids: maxBids, targetBidderCodePrefix: PBSUtils.randomString) - bidRequest.ext.prebid.multibid = [genericMultiBid, rubiconMultiBid] + def magniteMultiBid = new MultiBid(bidder: MAGNITE, maxBids: maxBids, targetBidderCodePrefix: PBSUtils.randomString) + bidRequest.ext.prebid.multibid = [genericMultiBid, magniteMultiBid] and: "Default basic bid" def bidResponse = BidResponse.getDefaultBidResponse(bidRequest) diff --git a/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy index 42579c0f688..49bbd9c2e17 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy @@ -1017,6 +1017,7 @@ class BidderParamsSpec extends BaseSpec { given: "PBS with adapter configuration" def pbsConfig = [ "adapters.generic.aliases.alias.enabled" : "true", + "adapters.generic.aliases.alias.meta-info.vendor-id" : "0", "adapters.generic.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), "adapters.generic.aliases.alias.meta-info.currency-accepted": ""] def pbsService = pbsServiceFactory.getService(pbsConfig) @@ -1137,6 +1138,7 @@ class BidderParamsSpec extends BaseSpec { given: "PBS with adapter configuration" def pbsConfig = [ "adapters.generic.aliases.alias.enabled" : "true", + "adapters.generic.aliases.alias.meta-info.vendor-id" : "0", "adapters.generic.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), "adapters.generic.aliases.alias.meta-info.currency-accepted": "${USD},${EUR}".toString()] def pbsService = pbsServiceFactory.getService(pbsConfig) @@ -1182,6 +1184,7 @@ class BidderParamsSpec extends BaseSpec { given: "PBS with adapter configuration" def pbsConfig = [ "adapters.generic.aliases.alias.enabled" : "true", + "adapters.generic.aliases.alias.meta-info.vendor-id" : "0", "adapters.generic.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), "adapters.generic.aliases.alias.meta-info.currency-accepted": "${JPY},${CHF}".toString()] def pbsService = pbsServiceFactory.getService(pbsConfig) @@ -1349,8 +1352,9 @@ class BidderParamsSpec extends BaseSpec { def "PBS should populate same code for adapter code when make call for generic hard code alias"() { given: "PBS config with bidder" - def pbsConfig = ["adapters.generic.aliases.alias.enabled" : "true", - "adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + def pbsConfig = ["adapters.generic.aliases.alias.enabled" : "true", + "adapters.generic.aliases.alias.meta-info.vendor-id": "0", + "adapters.generic.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] def defaultPbsService = pbsServiceFactory.getService(pbsConfig) and: "Default bid request with alias" @@ -1390,10 +1394,11 @@ class BidderParamsSpec extends BaseSpec { def "PBS should make call for alias when hard alias and demandSource specified"() { given: "PBS config with bidder" - def pbsConfig = ["adapters.amx.enabled" : "true", - "adapters.amx.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), - "adapters.amx.aliases.alias.enabled" : "true", - "adapters.amx.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + def pbsConfig = ["adapters.amx.enabled" : "true", + "adapters.amx.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), + "adapters.amx.aliases.alias.enabled" : "true", + "adapters.amx.aliases.alias.meta-info.vendor-id": "0", + "adapters.amx.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] def defaultPbsService = pbsServiceFactory.getService(pbsConfig) and: "Default bid Request with generic and openx bidder within separate imps" @@ -1537,10 +1542,11 @@ class BidderParamsSpec extends BaseSpec { def "PBS should populate adapter code with requested bidder when conflict with soft and hard alias"() { given: "PBS config with bidder" - def pbsConfig = ["adapters.amx.enabled" : "true", - "adapters.amx.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), - "adapters.amx.aliases.alias.enabled" : "true", - "adapters.amx.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + def pbsConfig = ["adapters.amx.enabled" : "true", + "adapters.amx.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), + "adapters.amx.aliases.alias.enabled" : "true", + "adapters.amx.aliases.alias.meta-info.vendor-id": "0", + "adapters.amx.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] def defaultPbsService = pbsServiceFactory.getService(pbsConfig) and: "Bid request with amx bidder and targeting" @@ -1580,10 +1586,11 @@ class BidderParamsSpec extends BaseSpec { def "PBS should populate adapter code with requested bidder when conflict with soft and generic hard alias"() { given: "PBS config with bidders" - def pbsConfig = ["adapters.amx.enabled" : "true", - "adapters.amx.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), - "adapters.generic.aliases.alias.enabled" : "true", - "adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + def pbsConfig = ["adapters.amx.enabled" : "true", + "adapters.amx.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), + "adapters.generic.aliases.alias.enabled" : "true", + "adapters.generic.aliases.alias.meta-info.vendor-id": "0", + "adapters.generic.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] def defaultPbsService = pbsServiceFactory.getService(pbsConfig) and: "Bid request with amx bidder and targeting" diff --git a/src/test/groovy/org/prebid/server/functional/tests/CookieSyncSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/CookieSyncSpec.groovy index 0fea9561336..43453891d1a 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/CookieSyncSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/CookieSyncSpec.groovy @@ -102,6 +102,7 @@ class CookieSyncSpec extends BaseSpec { def bidderAlias = ALIAS def prebidServerService = pbsServiceFactory.getService(GENERIC_CONFIG + APPNEXUS_CONFIG + ["adapters.${GENERIC.value}.aliases.${bidderAlias.value}.enabled" : "true", + "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.meta-info.vendor-id" : "0", "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.usersync.cookie-family-name": null]) and: "Default cookie sync request" @@ -133,6 +134,7 @@ class CookieSyncSpec extends BaseSpec { def prebidServerService = pbsServiceFactory.getService(GENERIC_CONFIG + ["adapters.${GENERIC.value}.usersync.redirect.url" : "$networkServiceContainer.rootUri/generic-usersync&redir={redirect_url}".toString(), "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.enabled" : "true", + "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.meta-info.vendor-id" : "0", "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.usersync.cookie-family-name": GENERIC.value]) and: "Cookie sync request for alias bidder" @@ -326,6 +328,7 @@ class CookieSyncSpec extends BaseSpec { def bidderAlias = ALIAS def prebidServerService = pbsServiceFactory.getService(GENERIC_CONFIG + ["adapters.${GENERIC.value}.aliases.${bidderAlias.value}.enabled" : "true", + "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.meta-info.vendor-id" : "0", "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.usersync.cookie-family-name": null]) and: "Cookie sync request with 2 bidders" @@ -695,6 +698,7 @@ class CookieSyncSpec extends BaseSpec { def bidderAlias = ALIAS def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG + ["adapters.${GENERIC.value}.aliases.${bidderAlias.value}.enabled" : "true", + "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.meta-info.vendor-id" : "0", "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.usersync.cookie-family-name": null]) and: "Cookie sync request with 2 bidders" @@ -725,6 +729,7 @@ class CookieSyncSpec extends BaseSpec { def bidderAlias = ALIAS def prebidServerService = pbsServiceFactory.getService(PBS_CONFIG + ["adapters.${GENERIC.value}.aliases.${bidderAlias.value}.enabled" : "true", + "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.meta-info.vendor-id" : "0", "adapters.${GENERIC.value}.aliases.${bidderAlias.value}.usersync.cookie-family-name": bidderAlias.value]) and: "Cookie sync request with 2 bidders" diff --git a/src/test/groovy/org/prebid/server/functional/tests/SecondaryBidderSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/SecondaryBidderSpec.groovy index 058af6495c7..b38b1c18794 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/SecondaryBidderSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/SecondaryBidderSpec.groovy @@ -28,8 +28,9 @@ class SecondaryBidderSpec extends BaseSpec { "adapters.${OPENX.value}.enabled" : "true", "adapters.${OPENX.value}.endpoint": "$networkServiceContainer.rootUri$OPENX_AUCTION_ENDPOINT".toString()] private static final Map GENERIC_ALIAS_CONFIG = [ - "adapters.${GENERIC.value}.aliases.${ALIAS}.enabled" : "true", - "adapters.${GENERIC.value}.aliases.${ALIAS}.endpoint": "$networkServiceContainer.rootUri$GENERIC_ALIAS_AUCTION_ENDPOINT".toString()] + "adapters.${GENERIC.value}.aliases.${ALIAS}.enabled" : "true", + "adapters.${GENERIC.value}.aliases.${ALIAS}.meta-info.vendor-id": "0", + "adapters.${GENERIC.value}.aliases.${ALIAS}.endpoint" : "$networkServiceContainer.rootUri$GENERIC_ALIAS_AUCTION_ENDPOINT".toString()] private static final Integer RESPONSE_DELAY_MILLISECONDS = 5_000 private static final Bidder openXBidder = new Bidder(networkServiceContainer, OPENX_AUCTION_ENDPOINT) private static final Bidder genericAliasBidder = new Bidder(networkServiceContainer, GENERIC_ALIAS_AUCTION_ENDPOINT) diff --git a/src/test/groovy/org/prebid/server/functional/tests/SetUidSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/SetUidSpec.groovy index b767cec7f4e..d14d58c3f61 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/SetUidSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/SetUidSpec.groovy @@ -43,8 +43,9 @@ class SetUidSpec extends BaseSpec { private static final String GENERIC_COOKIE_FAMILY_NAME = GENERIC.value private static final String VENDOR_ID = PBSUtils.randomNumber as String private static final Map UID_COOKIES_CONFIG = ['setuid.number-of-uid-cookies': MAX_NUMBER_OF_UID_COOKIES.toString()] - private static final Map GENERIC_ALIAS_CONFIG = ["adapters.generic.aliases.alias.enabled" : "true", - "adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + private static final Map GENERIC_ALIAS_CONFIG = ["adapters.generic.aliases.alias.enabled" : "true", + "adapters.generic.aliases.alias.meta-info.vendor-id": "0", + "adapters.generic.aliases.alias.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] private static final String TCF_ERROR_MESSAGE = "The gdpr_consent param prevents cookies from being saved" private static final int UNAVAILABLE_FOR_LEGAL_REASONS_CODE = 451 private static final Map PBS_CONFIG = diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineBaseSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineBaseSpec.groovy index 4ed578adbf8..494a44f8460 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineBaseSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineBaseSpec.groovy @@ -76,8 +76,9 @@ abstract class PbRuleEngineBaseSpec extends ModuleBaseSpec { protected static final Map AMX_CONFIG = ["adapters.${AMX}.enabled" : "true", "adapters.${AMX}.endpoint" : "$networkServiceContainer.rootUri/auction".toString(), "adapters.${AMX}.meta-info.vendor-id": AMX_VENDOR_ID as String] - protected static final Map OPENX_ALIAS_CONFIG = ["adapters.${OPENX}.aliases.${OPENX_ALIAS}.enabled" : "true", - "adapters.${OPENX}.aliases.${OPENX_ALIAS}.endpoint": "$networkServiceContainer.rootUri/auction".toString()] + protected static final Map OPENX_ALIAS_CONFIG = ["adapters.${OPENX}.aliases.${OPENX_ALIAS}.enabled" : "true", + "adapters.${OPENX}.aliases.${OPENX_ALIAS}.meta-info.vendor-id": "0", + "adapters.${OPENX}.aliases.${OPENX_ALIAS}.endpoint" : "$networkServiceContainer.rootUri/auction".toString()] protected static final String CONFIG_DATA_CENTER = PBSUtils.randomString private static final String USER_SYNC_URL = "$networkServiceContainer.rootUri/generic-usersync" private static final Map GENERIC_CONFIG = [ diff --git a/src/test/java/org/prebid/server/auction/BasicCategoryMappingServiceTest.java b/src/test/java/org/prebid/server/auction/BasicCategoryMappingServiceTest.java index 7be988f887a..9b68eb0560b 100644 --- a/src/test/java/org/prebid/server/auction/BasicCategoryMappingServiceTest.java +++ b/src/test/java/org/prebid/server/auction/BasicCategoryMappingServiceTest.java @@ -79,7 +79,7 @@ public void setUp() { public void applyCategoryMappingShouldReturnFilteredBidsWithCategory() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "9", singletonList("cat1")), BidType.video, 10), givenBidderBid(givenBid("2", null, "15", singletonList("cat2")), @@ -122,14 +122,14 @@ public void applyCategoryMappingShouldReturnFilteredBidsWithCategory() { .containsOnly("2", "3", "4"); assertThat(resultFuture.result().getErrors()).hasSize(1) - .containsOnly("Bid rejected [bidder: rubicon, bid ID: 1] with a reason: Bid was deduplicated"); + .containsOnly("Bid rejected [bidder: magnite, bid ID: 1] with a reason: Bid was deduplicated"); } @Test public void applyCategoryMappingShouldTolerateBidsWithSameIdWithingDifferentBidders() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBid", givenBidderBid(givenBid("1", null, "5", singletonList("cat2")), BidType.video, 3))); @@ -163,7 +163,7 @@ public void applyCategoryMappingShouldTolerateBidsWithSameIdWithingDifferentBidd public void applyCategoryMappingShouldNotCallFetchCategoryWhenTranslateCategoriesFalse() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(1, "publisher", @@ -185,7 +185,7 @@ public void applyCategoryMappingShouldNotCallFetchCategoryWhenTranslateCategorie public void applyCategoryMappingShouldReturnFailedFutureWhenTranslateTrueAndAdServerNull() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(null, "publisher", null, true, true); @@ -201,7 +201,7 @@ bidderResponses, givenBidRequestWithTargeting(extRequestTargeting), Account.empt public void applyCategoryMappingShouldReturnFailedFutureWhenTranslateTrueAndAdServerIsThree() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(3, "publisher", null, true, true); @@ -217,7 +217,7 @@ bidderResponses, givenBidRequestWithTargeting(extRequestTargeting), Account.empt public void applyCategoryMappingShouldReturnUseFreewheelAdServerWhenAdServerIs1() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(1, "publisher", @@ -241,7 +241,7 @@ public void applyCategoryMappingShouldReturnUseFreewheelAdServerWhenAdServerIs1( public void applyCategoryMappingShouldReturnUseDpfAdServerWhenAdServerIs2() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(2, "publisher", @@ -265,7 +265,7 @@ public void applyCategoryMappingShouldReturnUseDpfAdServerWhenAdServerIs2() { public void applyCategoryMappingShouldRejectBidsWithFailedCategoryFetch() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBid", givenBidderBid(givenBid("2", null, "5", singletonList("cat2")), BidType.video, 3))); @@ -293,7 +293,7 @@ public void applyCategoryMappingShouldRejectBidsWithFailedCategoryFetch() { public void applyCategoryMappingShouldRejectBidsWithCatLengthMoreThanOne() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBid", givenBidderBid(givenBid("2", null, "5", asList("cat2-1", "cat2-2")), BidType.video, 3))); @@ -321,7 +321,7 @@ public void applyCategoryMappingShouldRejectBidsWithCatLengthMoreThanOne() { public void applyCategoryMappingShouldRejectBidsWithWhenCatIsNull() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse( "otherBid", givenBidderBid(givenBid("2", null, "5", null), BidType.video, 3))); @@ -349,7 +349,7 @@ public void applyCategoryMappingShouldRejectBidsWithWhenCatIsNull() { public void applyCategoryMappingShouldRejectBidWhenNullCategoryReturnedFromSource() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBid", givenBidderBid(givenBid("2", null, "5", singletonList("cat2")), BidType.video, 3))); @@ -377,7 +377,7 @@ public void applyCategoryMappingShouldRejectBidWhenNullCategoryReturnedFromSourc public void applyCategoryMappingShouldUseMediaTypePriceGranularityIfDefined() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = ExtRequestTargeting.builder() @@ -405,7 +405,7 @@ public void applyCategoryMappingShouldUseMediaTypePriceGranularityIfDefined() { public void applyCategoryMappingShouldRejectBidIfItsDurationLargerThanTargetingMax() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBid", givenBidderBid(givenBid("2", null, "5", singletonList("cat2")), BidType.video, 20))); @@ -433,7 +433,7 @@ public void applyCategoryMappingShouldRejectBidIfItsDurationLargerThanTargetingM public void applyCategoryMappingShouldReturnEmptyCategoryMappingResult() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, null))); final ExtRequestTargeting extRequestTargeting = ExtRequestTargeting.builder().build(); @@ -457,7 +457,7 @@ public void applyCategoryMappingShouldReturnFirstVideoCategoryIfPresent() { // given final List bidderResponses = List.of( givenBidderResponse( - "rubicon", + "magnite", givenBidderBid( givenBid("1", null, "10", singletonList("cat1"), "videoCategory"), BidType.video, @@ -482,7 +482,7 @@ public void applyCategoryMappingShouldReturnEmptyCategoryIfNotWithCategory() { // given final List bidderResponses = List.of( givenBidderResponse( - "rubicon", + "magnite", givenBidderBid( givenBid("1", null, "10", singletonList("cat1"), "videoCategory"), BidType.video, @@ -507,7 +507,7 @@ public void applyCategoryMappingShouldReturnFirstIabBidCategoryIfWithCategoryAnd // given final List bidderResponses = List.of( givenBidderResponse( - "rubicon", + "magnite", givenBidderBid( givenBid("1", null, "10", List.of("cat1")), BidType.video, @@ -532,7 +532,7 @@ public void applyCategoryMappingShouldReturnFetchedCategoryIfWithCategoryAndTran // given final List bidderResponses = List.of( givenBidderResponse( - "rubicon", + "magnite", givenBidderBid( givenBid("1", null, "10", List.of("cat1")), BidType.video, @@ -559,7 +559,7 @@ public void applyCategoryMappingShouldReturnFetchedCategoryIfWithCategoryAndTran public void applyCategoryMappingShouldSetFirstDurationFromRangeIfDurationIsNull() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, null))); final ExtRequestTargeting extRequestTargeting = givenTargeting(1, "publisher", @@ -582,7 +582,7 @@ public void applyCategoryMappingShouldSetFirstDurationFromRangeIfDurationIsNull( public void applyCategoryMappingShouldDeduplicateBidsByFetchedCategoryWhenWithCategoryIsTrue() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBid", givenBidderBid(givenBid("2", null, "5", singletonList("cat2")), BidType.video, 4))); @@ -610,7 +610,7 @@ public void applyCategoryMappingShouldDeduplicateBidsByFetchedCategoryWhenWithCa public void applyCategoryMappingShouldDeduplicateBidsByBidCatWhenWithCategoryIsTrueAndTranslateFalse() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBid", givenBidderBid(givenBid("2", null, "5", singletonList("cat1")), BidType.video, 4))); @@ -637,7 +637,7 @@ public void applyCategoryMappingShouldDeduplicateBidsByBidCatWhenWithCategoryIsT public void applyCategoryMappingShouldDeduplicateBidsByPriceAndDurationIfWithCategoryFalse() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBid", givenBidderBid(givenBid("2", null, "10", singletonList("cat2")), BidType.video, 10))); @@ -665,7 +665,7 @@ public void applyCategoryMappingShouldDeduplicateBidsByPriceAndDurationIfWithCat public void applyCategoryMappingShouldReturnDurCatBuiltFromPriceAndFetchedCategoryAndDuration() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(1, "publisher", asList(10, 15, 5), true, true); @@ -687,7 +687,7 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriceAndFetchedCatego public void applyCategoryMappingShouldReturnDurCatBuiltFromPriceAndBidCatAndDuration() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(1, "publisher", asList(10, 15, 5), true, false); @@ -709,7 +709,7 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriceAndBidCatAndDura public void applyCategoryMappingShouldReturnDurCatBuiltFromPriceAndBidCatAndDurationAndBidder() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(1, "publisher", asList(10, 15, 5), true, false) @@ -725,14 +725,14 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriceAndBidCatAndDura assertThat(resultFuture.succeeded()).isTrue(); assertThat(resultFuture.result().getBiddersToBidsCategories()) .isEqualTo(Collections.singletonMap(givenBid("1", null, "10", singletonList("cat1")), - "10.00_cat1_10s_rubicon")); + "10.00_cat1_10s_magnite")); } @Test public void applyCategoryMappingShouldReturnDurCatBuiltFromPriceAndDuration() { // given final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10))); final ExtRequestTargeting extRequestTargeting = givenTargeting(1, "publisher", asList(10, 15, 5), false, null); @@ -754,7 +754,7 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriorityAndDuration() // given final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") - .ext(mapper.createObjectNode().set("rubicon", givenDealTier("rubiconPrefix", 3))) + .ext(mapper.createObjectNode().set("magnite", givenDealTier("magnitePrefix", 3))) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), false, null)) @@ -763,7 +763,7 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriorityAndDuration() .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -777,7 +777,7 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriorityAndDuration() assertThat(resultFuture.succeeded()).isTrue(); assertThat(resultFuture.result().getBiddersToBidsCategories()) .isEqualTo(Collections.singletonMap(givenBid("1", "impId1", "10", singletonList("cat1")), - "rubiconPrefix3_10s")); + "magnitePrefix3_10s")); assertThat(resultFuture.result().getBidderResponses()) .extracting(BidderResponse::getSeatBid) .flatExtracting(BidderSeatBid::getBids).hasSize(1); @@ -791,7 +791,7 @@ public void applyCategoryMappingShouldUseDealTierFromImpExtPrebidBidders() { .imp(singletonList(Imp.builder().id("impId1") .ext(mapper.valueToTree(ExtImp.of(ExtImpPrebid.builder() .bidder(mapper.createObjectNode() - .set("rubicon", givenDealTier("prebidPrefix", 4))).build(), null))) + .set("magnite", givenDealTier("prebidPrefix", 4))).build(), null))) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), false, null)) @@ -800,7 +800,7 @@ public void applyCategoryMappingShouldUseDealTierFromImpExtPrebidBidders() { .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -825,9 +825,9 @@ public void applyCategoryMappingShouldUseDealTierFromImpExtPrebidBidders() { public void applyCategoryMappingShouldPrecedencePriorityAndDurationFromPrebidOverFromImpExt() { // given final ExtImp extImp = ExtImp.of(ExtImpPrebid.builder() - .bidder(mapper.createObjectNode().set("rubicon", givenDealTier("prebidPrefix", 4))).build(), null); + .bidder(mapper.createObjectNode().set("magnite", givenDealTier("prebidPrefix", 4))).build(), null); final ObjectNode impExt = mapper.valueToTree(extImp); - impExt.set("rubicon", givenDealTier("extPrefix", 3)); + impExt.set("magnite", givenDealTier("extPrefix", 3)); final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") .ext(impExt) @@ -839,7 +839,7 @@ public void applyCategoryMappingShouldPrecedencePriorityAndDurationFromPrebidOve .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -865,7 +865,7 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriorityCatAndDuratio // given final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") - .ext(mapper.createObjectNode().set("rubicon", givenDealTier("rubiconPrefix", 3))) + .ext(mapper.createObjectNode().set("magnite", givenDealTier("magnitePrefix", 3))) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), true, true)) @@ -874,7 +874,7 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriorityCatAndDuratio .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -888,7 +888,7 @@ public void applyCategoryMappingShouldReturnDurCatBuiltFromPriorityCatAndDuratio assertThat(resultFuture.succeeded()).isTrue(); assertThat(resultFuture.result().getBiddersToBidsCategories()) .isEqualTo(Collections.singletonMap(givenBid("1", "impId1", "10", singletonList("cat1")), - "rubiconPrefix3_fetchedCat1_10s")); + "magnitePrefix3_fetchedCat1_10s")); assertThat(resultFuture.result().getBidderResponses()) .extracting(BidderResponse::getSeatBid) .flatExtracting(BidderSeatBid::getBids).hasSize(1); @@ -902,7 +902,7 @@ public void applyCategoryMappingShouldBuildCatDurFromPriceCatAndDurIfSupportDeal // given final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") - .ext(mapper.createObjectNode().set("rubicon", givenDealTier("rubiconPrefix", 3))) + .ext(mapper.createObjectNode().set("magnite", givenDealTier("magnitePrefix", 3))) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), true, true)) @@ -911,7 +911,7 @@ public void applyCategoryMappingShouldBuildCatDurFromPriceCatAndDurIfSupportDeal .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -937,7 +937,7 @@ public void applyCategoryMappingShouldBuildCatDurFromPriceCatAndDurIfBidPriority // given final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") - .ext(mapper.createObjectNode().set("rubicon", givenDealTier("rubiconPrefix", 10))) + .ext(mapper.createObjectNode().set("magnite", givenDealTier("magnitePrefix", 10))) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), true, true)) @@ -946,7 +946,7 @@ public void applyCategoryMappingShouldBuildCatDurFromPriceCatAndDurIfBidPriority .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -972,7 +972,7 @@ public void applyCategoryMappingShouldBuildCatDurFromPriceCatAndDurIfBidPriority @Test public void applyCategoryMappingShouldIgnoreContextAndPrebidInImpExt() { // given - final ObjectNode impExt = mapper.createObjectNode().set("rubicon", givenDealTier("rubiconPrefix", 3)); + final ObjectNode impExt = mapper.createObjectNode().set("magnite", givenDealTier("magnitePrefix", 3)); impExt.set("context", mapper.createObjectNode()); impExt.set("prebid", mapper.createObjectNode()); final BidRequest bidRequest = BidRequest.builder() @@ -986,7 +986,7 @@ public void applyCategoryMappingShouldIgnoreContextAndPrebidInImpExt() { .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -1000,7 +1000,7 @@ public void applyCategoryMappingShouldIgnoreContextAndPrebidInImpExt() { assertThat(resultFuture.succeeded()).isTrue(); assertThat(resultFuture.result().getBiddersToBidsCategories()) .isEqualTo(Collections.singletonMap(givenBid("1", "impId1", "10", singletonList("cat1")), - "rubiconPrefix3_fetchedCat1_10s")); + "magnitePrefix3_fetchedCat1_10s")); assertThat(resultFuture.result().getBidderResponses()) .extracting(BidderResponse::getSeatBid) .flatExtracting(BidderSeatBid::getBids).hasSize(1); @@ -1012,7 +1012,7 @@ public void applyCategoryMappingShouldAddErrorIfImpBidderDoesNotHaveDealTierAndC // given final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") - .ext(mapper.createObjectNode().set("rubicon", mapper.createObjectNode())) + .ext(mapper.createObjectNode().set("magnite", mapper.createObjectNode())) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), true, true)) @@ -1021,7 +1021,7 @@ public void applyCategoryMappingShouldAddErrorIfImpBidderDoesNotHaveDealTierAndC .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -1040,7 +1040,7 @@ public void applyCategoryMappingShouldAddErrorIfImpBidderDoesNotHaveDealTierAndC .extracting(BidderResponse::getSeatBid) .flatExtracting(BidderSeatBid::getBids).hasSize(1); assertThat(resultFuture.result().getErrors()).hasSize(1) - .containsOnly("DealTier configuration not defined for bidder 'rubicon', imp ID 'impId1'"); + .containsOnly("DealTier configuration not defined for bidder 'magnite', imp ID 'impId1'"); } @Test @@ -1050,7 +1050,7 @@ public void applyCategoryMappingShouldAddErrorIfPrefixIsNullAndCreateRegularCatD mapper.createObjectNode().put("minDealTier", 3)); final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") - .ext(mapper.createObjectNode().set("rubicon", dealTier)) + .ext(mapper.createObjectNode().set("magnite", dealTier)) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), true, true)) @@ -1059,7 +1059,7 @@ public void applyCategoryMappingShouldAddErrorIfPrefixIsNullAndCreateRegularCatD .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -1078,7 +1078,7 @@ public void applyCategoryMappingShouldAddErrorIfPrefixIsNullAndCreateRegularCatD .extracting(BidderResponse::getSeatBid) .flatExtracting(BidderSeatBid::getBids).hasSize(1); assertThat(resultFuture.result().getErrors()).hasSize(1) - .containsOnly("DealTier configuration not valid for bidder 'rubicon', imp ID 'impId1' " + .containsOnly("DealTier configuration not valid for bidder 'magnite', imp ID 'impId1' " + "with a reason: dealTier.prefix empty string or null"); } @@ -1086,10 +1086,10 @@ public void applyCategoryMappingShouldAddErrorIfPrefixIsNullAndCreateRegularCatD public void applyCategoryMappingShouldAddErrorIfMinDealTierIsNullAndCreateRegularCatDur() { // given final JsonNode dealTier = mapper.createObjectNode().set("dealTier", - mapper.createObjectNode().put("prefix", "rubiconPrefix")); + mapper.createObjectNode().put("prefix", "magnitePrefix")); final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") - .ext(mapper.createObjectNode().set("rubicon", dealTier)) + .ext(mapper.createObjectNode().set("magnite", dealTier)) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), true, true)) @@ -1098,7 +1098,7 @@ public void applyCategoryMappingShouldAddErrorIfMinDealTierIsNullAndCreateRegula .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -1117,7 +1117,7 @@ public void applyCategoryMappingShouldAddErrorIfMinDealTierIsNullAndCreateRegula .extracting(BidderResponse::getSeatBid) .flatExtracting(BidderSeatBid::getBids).hasSize(1); assertThat(resultFuture.result().getErrors()).hasSize(1) - .containsOnly("DealTier configuration not valid for bidder 'rubicon', imp ID 'impId1' with a reason:" + .containsOnly("DealTier configuration not valid for bidder 'magnite', imp ID 'impId1' with a reason:" + " dealTier.minDealTier should be larger than 0, but was null"); } @@ -1126,7 +1126,7 @@ public void applyCategoryMappingShouldAddErrorIfMinDealTierLessThanZeroAndCreate // given final BidRequest bidRequest = BidRequest.builder() .imp(singletonList(Imp.builder().id("impId1") - .ext(mapper.createObjectNode().set("rubicon", givenDealTier("prefix", -1))) + .ext(mapper.createObjectNode().set("magnite", givenDealTier("prefix", -1))) .build())) .ext(ExtRequest.of(ExtRequestPrebid.builder() .targeting(givenTargeting(1, "publisher", asList(10, 15, 5), true, true)) @@ -1135,7 +1135,7 @@ public void applyCategoryMappingShouldAddErrorIfMinDealTierLessThanZeroAndCreate .build(); final List bidderResponses = singletonList( - givenBidderResponse("rubicon", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), + givenBidderResponse("magnite", givenBidderBid(givenBid("1", "impId1", "10", singletonList("cat1")), BidType.video, 10))); given(applicationSettings.getCategories(anyString(), anyString(), any())).willReturn( @@ -1154,7 +1154,7 @@ public void applyCategoryMappingShouldAddErrorIfMinDealTierLessThanZeroAndCreate .extracting(BidderResponse::getSeatBid) .flatExtracting(BidderSeatBid::getBids).hasSize(1); assertThat(resultFuture.result().getErrors()).hasSize(1) - .containsOnly("DealTier configuration not valid for bidder 'rubicon', imp ID 'impId1' with a reason:" + .containsOnly("DealTier configuration not valid for bidder 'magnite', imp ID 'impId1' with a reason:" + " dealTier.minDealTier should be larger than 0, but was -1"); } @@ -1162,7 +1162,7 @@ public void applyCategoryMappingShouldAddErrorIfMinDealTierLessThanZeroAndCreate public void applyCategoryMappingShouldRejectAllBidsFromBidderInDifferentReasons() { // given final List bidderResponses = asList( - givenBidderResponse("rubicon", + givenBidderResponse("magnite", givenBidderBid(givenBid("1", null, "10", singletonList("cat1")), BidType.video, 10)), givenBidderResponse("otherBidder", givenBidderBid(givenBid("2", null, "10", null), BidType.video, 10), diff --git a/src/test/java/org/prebid/server/auction/ExchangeServiceTest.java b/src/test/java/org/prebid/server/auction/ExchangeServiceTest.java index b5036c497c3..d021aeb1fd0 100644 --- a/src/test/java/org/prebid/server/auction/ExchangeServiceTest.java +++ b/src/test/java/org/prebid/server/auction/ExchangeServiceTest.java @@ -3248,10 +3248,10 @@ public void shouldIncrementGotBidsAndErrorMetricsIfBidderReturnsBidAndDifferentE .bids(singletonList(givenBidderBid(Bid.builder().impid("impId").price(TEN).build()))) .errors(asList( // two identical errors to verify corresponding metric is submitted only once - BidderError.badInput("rubicon error"), - BidderError.badInput("rubicon error"), - BidderError.badServerResponse("rubicon error"), - BidderError.failedToRequestBids("rubicon failed to request bids"), + BidderError.badInput("magnite error"), + BidderError.badInput("magnite error"), + BidderError.badServerResponse("magnite error"), + BidderError.failedToRequestBids("magnite failed to request bids"), BidderError.timeout("timeout error"), BidderError.generic("timeout error"))) .build())); diff --git a/src/test/java/org/prebid/server/auction/FpdResolverTest.java b/src/test/java/org/prebid/server/auction/FpdResolverTest.java index 1e094a120d6..5dd1e3fd461 100644 --- a/src/test/java/org/prebid/server/auction/FpdResolverTest.java +++ b/src/test/java/org/prebid/server/auction/FpdResolverTest.java @@ -565,7 +565,7 @@ public void resolveImpExtShouldCreateExtImpContextDataIfExtImpIsNull() { @Test public void resolveImpExtShouldCreateExtImpContextDataIfExtImpContextIsNullAndKeepOtherFields() { // given - final ObjectNode extImp = mapper.createObjectNode().put("prebid", 1).put("rubicon", 2); + final ObjectNode extImp = mapper.createObjectNode().put("prebid", 1).put("magnite", 2); final ObjectNode targeting = mapper.createObjectNode() .put("site", "site").put("replacedAttr", "fpdValue").put("fpdAttr", "fpdValue2"); @@ -573,7 +573,7 @@ public void resolveImpExtShouldCreateExtImpContextDataIfExtImpContextIsNullAndKe final ObjectNode result = target.resolveImpExt(extImp, targeting); // then - final ObjectNode expectedResult = mapper.createObjectNode().put("prebid", 1).put("rubicon", 2); + final ObjectNode expectedResult = mapper.createObjectNode().put("prebid", 1).put("magnite", 2); assertThat(result).isEqualTo(expectedResult .set("data", mapper.createObjectNode().put("replacedAttr", "fpdValue") .put("fpdAttr", "fpdValue2"))); diff --git a/src/test/java/org/prebid/server/auction/externalortb/StoredResponseProcessorTest.java b/src/test/java/org/prebid/server/auction/externalortb/StoredResponseProcessorTest.java index d281139df5f..55895873a41 100644 --- a/src/test/java/org/prebid/server/auction/externalortb/StoredResponseProcessorTest.java +++ b/src/test/java/org/prebid/server/auction/externalortb/StoredResponseProcessorTest.java @@ -63,7 +63,7 @@ public class StoredResponseProcessorTest extends VertxTest { private ApplicationSettings applicationSettings; @Mock - private BidRejectionTracker rubiconBidRejectionTracker; + private BidRejectionTracker magniteBidRejectionTracker; @Mock private BidRejectionTracker appnexusBidRejectionTracker; @@ -87,7 +87,7 @@ public void getStoredResponseResultShouldReturnSeatBidsForAuctionResponseId() th given(applicationSettings.getStoredResponses(any(), any())) .willReturn(Future.succeededFuture(StoredResponseDataResult.of(singletonMap("1", - mapper.writeValueAsString(singletonList(SeatBid.builder().seat("rubicon") + mapper.writeValueAsString(singletonList(SeatBid.builder().seat("magnite") .bid(singletonList(Bid.builder().id("id").build())).build()))), emptyList()))); @@ -98,7 +98,7 @@ public void getStoredResponseResultShouldReturnSeatBidsForAuctionResponseId() th assertThat(result.result()).isEqualTo(StoredResponseResult.of( emptyList(), singletonList(SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(singletonList(Bid.builder().id("id").impid("impId").build())) .build()), emptyMap())); @@ -109,7 +109,7 @@ public void getStoredResponseResultShouldNotChangeImpsAndReturnSeatBidsWhenThere // given final Imp imp = Imp.builder() .ext(mapper.valueToTree(ExtImp.of( - ExtImpPrebid.builder().bidder(mapper.createObjectNode().put("rubicon", 1)).build(), + ExtImpPrebid.builder().bidder(mapper.createObjectNode().put("magnite", 1)).build(), null))) .build(); // when @@ -169,7 +169,7 @@ public void getStoredResponseResultShouldReturnFailedFutureWhenErrorHappenedDuri public void getStoredResponseResultShouldReturnResultForBidStoredResponseId() { // given final Imp imp = givenImp("impId1", null, asList( - ExtStoredBidResponse.of("rubicon", "storedBidResponseId1"), + ExtStoredBidResponse.of("magnite", "storedBidResponseId1"), ExtStoredBidResponse.of("appnexus", "storedBidResponseId2"))); given(applicationSettings.getStoredResponses(any(), any())).willReturn( @@ -185,7 +185,7 @@ public void getStoredResponseResultShouldReturnResultForBidStoredResponseId() { assertThat(result.result()).isEqualTo(StoredResponseResult.of( singletonList(imp), emptyList(), - singletonMap("impId1", doubleMap("rubicon", "storedBidResponse1", "appnexus", "storedBidResponse2")))); + singletonMap("impId1", doubleMap("magnite", "storedBidResponse1", "appnexus", "storedBidResponse2")))); } @Test @@ -199,7 +199,7 @@ public void getStoredResponseResultShouldReturnResultForBidAndAuctionStoredRespo final Imp imp2 = givenImp( "impId2", null, - singletonList(ExtStoredBidResponse.of("rubicon", "storedBidResponseId"))); + singletonList(ExtStoredBidResponse.of("magnite", "storedBidResponseId"))); final List imps = asList(imp1, imp2); final Map storedResponse = new HashMap<>(); @@ -222,7 +222,7 @@ public void getStoredResponseResultShouldReturnResultForBidAndAuctionStoredRespo .seat("appnexus") .bid(singletonList(Bid.builder().id("id1").impid("impId1").build())) .build()), - singletonMap("impId2", singletonMap("rubicon", "storedBidResponse")))); + singletonMap("impId2", singletonMap("magnite", "storedBidResponse")))); } @Test @@ -253,9 +253,9 @@ public void getStoredResponseResultShouldMergeStoredSeatBidsForTheSameBidder() t final Map storedResponse = new HashMap<>(); storedResponse.put("storedAuctionResponse1", mapper.writeValueAsString(asList( SeatBid.builder().seat("appnexus").bid(singletonList(Bid.builder().id("id1").build())).build(), - SeatBid.builder().seat("rubicon").bid(singletonList(Bid.builder().id("id3").build())).build()))); + SeatBid.builder().seat("magnite").bid(singletonList(Bid.builder().id("id3").build())).build()))); storedResponse.put("storedAuctionResponse2", mapper.writeValueAsString(singletonList( - SeatBid.builder().seat("rubicon").bid(singletonList(Bid.builder().id("id2").build())).build()))); + SeatBid.builder().seat("magnite").bid(singletonList(Bid.builder().id("id2").build())).build()))); given(applicationSettings.getStoredResponses(any(), any())).willReturn( Future.succeededFuture(StoredResponseDataResult.of(storedResponse, emptyList()))); @@ -269,14 +269,14 @@ public void getStoredResponseResultShouldMergeStoredSeatBidsForTheSameBidder() t emptyList(), asList( SeatBid.builder() - .seat("appnexus") - .bid(singletonList(Bid.builder().id("id1").impid("impId1").build())) - .build(), - SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(asList( Bid.builder().id("id3").impid("impId1").build(), Bid.builder().id("id2").impid("impId2").build())) + .build(), + SeatBid.builder() + .seat("appnexus") + .bid(singletonList(Bid.builder().id("id1").impid("impId1").build())) .build()), emptyMap())); } @@ -291,7 +291,7 @@ public void getStoredResponseResultShouldUseStoredSeatBidsFromRequest() throws J "storedAuctionResponse1", null, SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(singletonList(Bid.builder().id("id4").build())) .build()), null), @@ -310,9 +310,9 @@ public void getStoredResponseResultShouldUseStoredSeatBidsFromRequest() throws J final Map storedResponse = new HashMap<>(); storedResponse.put("storedAuctionResponse1", mapper.writeValueAsString(asList( SeatBid.builder().seat("appnexus").bid(singletonList(Bid.builder().id("id1").build())).build(), - SeatBid.builder().seat("rubicon").bid(singletonList(Bid.builder().id("id3").build())).build()))); + SeatBid.builder().seat("magnite").bid(singletonList(Bid.builder().id("id3").build())).build()))); storedResponse.put("storedAuctionResponse2", mapper.writeValueAsString(singletonList( - SeatBid.builder().seat("rubicon").bid(singletonList(Bid.builder().id("id2").build())).build()))); + SeatBid.builder().seat("magnite").bid(singletonList(Bid.builder().id("id2").build())).build()))); given(applicationSettings.getStoredResponses(any(), any())).willReturn( Future.succeededFuture(StoredResponseDataResult.of(storedResponse, emptyList()))); @@ -326,14 +326,14 @@ public void getStoredResponseResultShouldUseStoredSeatBidsFromRequest() throws J emptyList(), asList( SeatBid.builder() - .seat("appnexus") - .bid(singletonList(Bid.builder().id("id5").impid("impId3").build())) - .build(), - SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(asList( Bid.builder().id("id4").impid("impId1").build(), Bid.builder().id("id2").impid("impId2").build())) + .build(), + SeatBid.builder() + .seat("appnexus") + .bid(singletonList(Bid.builder().id("id5").impid("impId3").build())) .build()), emptyMap())); } @@ -430,19 +430,19 @@ public void updateStoredBidResponseShouldTolerateMissingBidImpId() { .imp(singletonList(Imp.builder().id("imp1").build())) .build(); final BidderRequest bidderRequest = BidderRequest.builder() - .bidder("rubicon") + .bidder("magnite") .storedResponse("storedresponse") .bidRequest(bidRequest) .build(); final BidderResponse bidderResponse = BidderResponse.of( - "rubicon", + "magnite", BidderSeatBid.of( singletonList(BidderBid.of(Bid.builder().id("bid1").build(), BidType.banner, "USD"))), 100); final AuctionParticipation requestAuctionParticipation = AuctionParticipation.builder() - .bidder("rubicon") + .bidder("magnite") .bidderRequest(bidderRequest) .bidderResponse(bidderResponse) .build(); @@ -462,19 +462,19 @@ public void updateStoredBidResponseShouldNotModifyParticipationWithMoreThanOneIm .imp(List.of(Imp.builder().build(), Imp.builder().build())) .build(); final BidderRequest bidderRequest = BidderRequest.builder() - .bidder("rubicon") + .bidder("magnite") .storedResponse("storedresponse") .bidRequest(bidRequest) .build(); final BidderResponse bidderResponse = BidderResponse.of( - "rubicon", + "magnite", BidderSeatBid.of( singletonList(BidderBid.of(Bid.builder().id("bid1").build(), BidType.banner, "USD"))), 100); final AuctionParticipation requestAuctionParticipation = AuctionParticipation.builder() - .bidder("rubicon") + .bidder("magnite") .bidderRequest(bidderRequest) .bidderResponse(bidderResponse) .build(); @@ -494,7 +494,7 @@ public void updateStoredBidResponseShouldReplaceAllBidImpIdMacrosForStoredRespon .imp(singletonList(Imp.builder().id("impId").build())) .build(); final BidderRequest bidderRequest = BidderRequest.builder() - .bidder("rubicon") + .bidder("magnite") .storedResponse("storedresponse") .bidRequest(bidRequest) .build(); @@ -503,10 +503,10 @@ public void updateStoredBidResponseShouldReplaceAllBidImpIdMacrosForStoredRespon BidderBid.of(Bid.builder().impid("##PBSIMPID##").build(), BidType.banner, "USD"), BidderBid.of(Bid.builder().impid("##PBSIMPID##").build(), BidType.video, "USD")); final BidderResponse bidderResponse = BidderResponse.of( - "rubicon", BidderSeatBid.of(bids), 100); + "magnite", BidderSeatBid.of(bids), 100); final AuctionParticipation requestAuctionParticipation = AuctionParticipation.builder() - .bidder("rubicon") + .bidder("magnite") .bidderRequest(bidderRequest) .bidderResponse(bidderResponse) .build(); @@ -520,7 +520,7 @@ public void updateStoredBidResponseShouldReplaceAllBidImpIdMacrosForStoredRespon BidderBid.of(Bid.builder().impid("impId").build(), BidType.banner, "USD"), BidderBid.of(Bid.builder().impid("impId").build(), BidType.video, "USD")); final BidderResponse expectedBidderResponse = BidderResponse.of( - "rubicon", BidderSeatBid.of(expectedBids), 100); + "magnite", BidderSeatBid.of(expectedBids), 100); assertThat(result).containsExactly(requestAuctionParticipation.with(expectedBidderResponse)); } @@ -529,12 +529,12 @@ public void updateStoredBidResponseShouldReplaceAllBidImpIdMacrosForStoredRespon public void mergeWithBidderResponsesShouldReturnMergedStoredSeatWithResponseWithoutBlocked() { // given final BidderResponse bidderResponse = BidderResponse.of( - "rubicon", + "magnite", BidderSeatBid.of(singletonList(BidderBid.of( - Bid.builder().id("bid1").build(), BidType.banner, "rubicon", "USD"))), + Bid.builder().id("bid1").build(), BidType.banner, "magnite", "USD"))), 100); final AuctionParticipation requestAuctionParticipation = AuctionParticipation.builder() - .bidder("rubicon") + .bidder("magnite") .bidderResponse(bidderResponse) .build(); final AuctionParticipation blockedRequestAuctionParticipation = AuctionParticipation.builder() @@ -545,14 +545,14 @@ public void mergeWithBidderResponsesShouldReturnMergedStoredSeatWithResponseWith blockedRequestAuctionParticipation); final List seatBid = singletonList(SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(singletonList(Bid.builder().id("bid2").impid("storedImp").build())) .build()); final List imps = singletonList(Imp.builder().id("storedImp").banner(Banner.builder().build()).build()); final Map bidRejectionTrackers = Map.of( - "rubicon", rubiconBidRejectionTracker, + "magnite", magniteBidRejectionTracker, "appnexus", appnexusBidRejectionTracker); // when @@ -567,32 +567,32 @@ public void mergeWithBidderResponsesShouldReturnMergedStoredSeatWithResponseWith .impid("storedImp") .build(), BidType.banner, - "rubicon", + "magnite", "USD"), BidderBid.of( Bid.builder() .id("bid1") .build(), BidType.banner, - "rubicon", + "magnite", "USD")); verifyNoInteractions(appnexusBidRejectionTracker); - verify(rubiconBidRejectionTracker).restoreFromRejection(expectedBids); + verify(magniteBidRejectionTracker).restoreFromRejection(expectedBids); assertThat(result) .extracting(AuctionParticipation::getBidderResponse) - .containsOnly(BidderResponse.of("rubicon", BidderSeatBid.of(expectedBids), 100), null); + .containsOnly(BidderResponse.of("magnite", BidderSeatBid.of(expectedBids), 100), null); } @Test public void mergeWithBidderResponsesShouldMergeBidderResponsesWithoutCorrespondingStoredSeatBid() { // given - final List givenRubiconBids = singletonList(BidderBid.of( + final List givenMagniteBids = singletonList(BidderBid.of( Bid.builder().id("bid1").build(), BidType.banner, "USD")); - final BidderResponse bidderResponse = BidderResponse.of("rubicon", BidderSeatBid.of(givenRubiconBids), 100); + final BidderResponse bidderResponse = BidderResponse.of("magnite", BidderSeatBid.of(givenMagniteBids), 100); final AuctionParticipation requestAuctionParticipation = AuctionParticipation.builder() - .bidder("rubicon") + .bidder("magnite") .bidderResponse(bidderResponse) .build(); final List auctionParticipations = singletonList(requestAuctionParticipation); @@ -605,7 +605,7 @@ public void mergeWithBidderResponsesShouldMergeBidderResponsesWithoutCorrespondi final List imps = singletonList(Imp.builder().id("storedImp").banner(Banner.builder().build()).build()); final Map bidRejectionTrackers = Map.of( - "rubicon", rubiconBidRejectionTracker, + "magnite", magniteBidRejectionTracker, "appnexus", appnexusBidRejectionTracker); // when @@ -616,7 +616,7 @@ public void mergeWithBidderResponsesShouldMergeBidderResponsesWithoutCorrespondi final List expectedAppnexusBids = singletonList( BidderBid.of(Bid.builder().id("bid2").impid("storedImp").build(), BidType.banner, "appnexus", "USD")); - verify(rubiconBidRejectionTracker).restoreFromRejection(givenRubiconBids); + verify(magniteBidRejectionTracker).restoreFromRejection(givenMagniteBids); verify(appnexusBidRejectionTracker).restoreFromRejection(expectedAppnexusBids); final BidderResponse secondExpectedBidResponse = BidderResponse.of( @@ -632,15 +632,15 @@ public void mergeWithBidderResponsesShouldMergeBidderResponsesWithoutCorrespondi public void mergeWithBidderResponsesShouldMergeStoredSeatBidsWithoutBidderResponses() { // given final List seatBid = singletonList(SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(singletonList(Bid.builder().id("bid2").impid("storedImp").build())) .build()); final List imps = singletonList(Imp.builder().id("storedImp").banner(Banner.builder().build()).build()); final Map bidRejectionTrackers = Map.of( - "rubicon", rubiconBidRejectionTracker, - "appnexus", rubiconBidRejectionTracker); + "magnite", magniteBidRejectionTracker, + "appnexus", appnexusBidRejectionTracker); // when final List result = @@ -650,42 +650,42 @@ public void mergeWithBidderResponsesShouldMergeStoredSeatBidsWithoutBidderRespon final List expectedBids = singletonList(BidderBid.of( Bid.builder().id("bid2").impid("storedImp").build(), BidType.banner, - "rubicon", + "magnite", "USD")); - verify(rubiconBidRejectionTracker).restoreFromRejection(expectedBids); + verify(magniteBidRejectionTracker).restoreFromRejection(expectedBids); verifyNoInteractions(appnexusBidRejectionTracker); assertThat(result) .extracting(AuctionParticipation::getBidderResponse) - .contains(BidderResponse.of("rubicon", BidderSeatBid.of(expectedBids), 0)); + .contains(BidderResponse.of("magnite", BidderSeatBid.of(expectedBids), 0)); } @Test public void mergeWithBidderResponsesShouldResolveCurrencyFromBidderResponse() { // given final BidderResponse bidderResponse = BidderResponse.of( - "rubicon", + "magnite", BidderSeatBid.of( singletonList(BidderBid.of( - Bid.builder().id("bid1").build(), BidType.banner, "rubicon", "EUR"))), + Bid.builder().id("bid1").build(), BidType.banner, "magnite", "EUR"))), 100); final AuctionParticipation requestAuctionParticipation = AuctionParticipation.builder() - .bidder("rubicon") + .bidder("magnite") .bidderResponse(bidderResponse) .build(); final List auctionParticipations = singletonList(requestAuctionParticipation); final List seatBid = singletonList(SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(singletonList(Bid.builder().id("bid2").impid("storedImp").build())) .build()); final List imps = singletonList(Imp.builder().id("storedImp").banner(Banner.builder().build()).build()); final Map bidRejectionTrackers = Map.of( - "rubicon", rubiconBidRejectionTracker, - "appnexus", rubiconBidRejectionTracker); + "magnite", magniteBidRejectionTracker, + "appnexus", appnexusBidRejectionTracker); // when final List result = target.mergeWithBidderResponses( @@ -696,33 +696,33 @@ public void mergeWithBidderResponsesShouldResolveCurrencyFromBidderResponse() { BidderBid.of( Bid.builder().id("bid2").impid("storedImp").build(), BidType.banner, - "rubicon", + "magnite", "EUR"), BidderBid.of( Bid.builder().id("bid1").build(), BidType.banner, - "rubicon", + "magnite", "EUR")); - verify(rubiconBidRejectionTracker).restoreFromRejection(expectedBids); + verify(magniteBidRejectionTracker).restoreFromRejection(expectedBids); verifyNoInteractions(appnexusBidRejectionTracker); assertThat(result) .extracting(AuctionParticipation::getBidderResponse) - .contains(BidderResponse.of("rubicon", BidderSeatBid.of(expectedBids), 100)); + .contains(BidderResponse.of("magnite", BidderSeatBid.of(expectedBids), 100)); } @Test public void mergeWithBidderResponsesShouldResolveBidTypeFromStoredBidExt() { // given final BidderResponse bidderResponse = BidderResponse.of( - "rubicon", + "magnite", BidderSeatBid.of( singletonList(BidderBid.of( - Bid.builder().id("bid1").build(), BidType.banner, "rubicon", "USD"))), + Bid.builder().id("bid1").build(), BidType.banner, "magnite", "USD"))), 100); final AuctionParticipation requestAuctionParticipation = AuctionParticipation.builder() - .bidder("rubicon") + .bidder("magnite") .bidderResponse(bidderResponse) .build(); final List auctionParticipations = singletonList(requestAuctionParticipation); @@ -730,7 +730,7 @@ public void mergeWithBidderResponsesShouldResolveBidTypeFromStoredBidExt() { final ExtBidPrebid extBidPrebid = ExtBidPrebid.builder().type(BidType.video).build(); final List seatBid = singletonList(SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(singletonList(Bid.builder() .id("bid2") .impid("storedImp") @@ -741,8 +741,8 @@ public void mergeWithBidderResponsesShouldResolveBidTypeFromStoredBidExt() { final List imps = singletonList(Imp.builder().id("storedImp").banner(Banner.builder().build()).build()); final Map bidRejectionTrackers = Map.of( - "rubicon", rubiconBidRejectionTracker, - "appnexus", rubiconBidRejectionTracker); + "magnite", magniteBidRejectionTracker, + "appnexus", appnexusBidRejectionTracker); // when final List result = target.mergeWithBidderResponses( @@ -756,15 +756,15 @@ public void mergeWithBidderResponsesShouldResolveBidTypeFromStoredBidExt() { .impid("storedImp") .ext(mapper.createObjectNode() .set("prebid", mapper.valueToTree(extBidPrebid))).build(), - BidType.video, "rubicon", "USD"), - BidderBid.of(Bid.builder().id("bid1").build(), BidType.banner, "rubicon", "USD")); + BidType.video, "magnite", "USD"), + BidderBid.of(Bid.builder().id("bid1").build(), BidType.banner, "magnite", "USD")); - verify(rubiconBidRejectionTracker).restoreFromRejection(expectedBids); + verify(magniteBidRejectionTracker).restoreFromRejection(expectedBids); verifyNoInteractions(appnexusBidRejectionTracker); assertThat(result) .extracting(AuctionParticipation::getBidderResponse) - .contains(BidderResponse.of("rubicon", BidderSeatBid.of(expectedBids), 100)); + .contains(BidderResponse.of("magnite", BidderSeatBid.of(expectedBids), 100)); } @Test @@ -773,7 +773,7 @@ public void mergeWithBidderResponsesShouldThrowPrebidExceptionWhenExtBidPrebidIn final ObjectNode extBidPrebid = mapper.createObjectNode().put("type", "invalid"); final List seatBid = singletonList(SeatBid.builder() - .seat("rubicon") + .seat("magnite") .bid(singletonList(Bid.builder() .id("bid2") .impid("storedImp") @@ -784,14 +784,14 @@ public void mergeWithBidderResponsesShouldThrowPrebidExceptionWhenExtBidPrebidIn final List imps = singletonList(Imp.builder().id("storedImp").banner(Banner.builder().build()).build()); final Map bidRejectionTrackers = Map.of( - "rubicon", rubiconBidRejectionTracker, - "appnexus", rubiconBidRejectionTracker); + "magnite", magniteBidRejectionTracker, + "appnexus", appnexusBidRejectionTracker); // when and then assertThatThrownBy(() -> target.mergeWithBidderResponses(emptyList(), seatBid, imps, bidRejectionTrackers)) .isInstanceOf(PreBidException.class).hasMessage("Error decoding stored response bid.ext.prebid"); - verifyNoInteractions(appnexusBidRejectionTracker, rubiconBidRejectionTracker); + verifyNoInteractions(appnexusBidRejectionTracker, magniteBidRejectionTracker); } @Test @@ -799,9 +799,9 @@ public void mergeWithBidderResponsesShouldReturnSameResponseWhenThereAreNoStored // given final List givenBids = singletonList( BidderBid.of(Bid.builder().id("bid1").build(), BidType.banner, "USD")); - final BidderResponse bidderResponse = BidderResponse.of("rubicon", BidderSeatBid.of(givenBids), 100); + final BidderResponse bidderResponse = BidderResponse.of("magnite", BidderSeatBid.of(givenBids), 100); final AuctionParticipation requestAuctionParticipation = AuctionParticipation.builder() - .bidder("rubicon") + .bidder("magnite") .bidderResponse(bidderResponse) .build(); final List auctionParticipations = singletonList(requestAuctionParticipation); @@ -809,8 +809,8 @@ public void mergeWithBidderResponsesShouldReturnSameResponseWhenThereAreNoStored final List imps = singletonList(Imp.builder().banner(Banner.builder().build()).build()); final Map bidRejectionTrackers = Map.of( - "rubicon", rubiconBidRejectionTracker, - "appnexus", rubiconBidRejectionTracker); + "magnite", magniteBidRejectionTracker, + "appnexus", appnexusBidRejectionTracker); // when final List result = target.mergeWithBidderResponses( @@ -821,7 +821,7 @@ public void mergeWithBidderResponsesShouldReturnSameResponseWhenThereAreNoStored .extracting(AuctionParticipation::getBidderResponse) .containsOnly(bidderResponse); - verifyNoInteractions(appnexusBidRejectionTracker, rubiconBidRejectionTracker); + verifyNoInteractions(appnexusBidRejectionTracker, magniteBidRejectionTracker); } @Test diff --git a/src/test/java/org/prebid/server/auction/requestfactory/AmpRequestFactoryTest.java b/src/test/java/org/prebid/server/auction/requestfactory/AmpRequestFactoryTest.java index ad2c84c4669..bc757ddd8bb 100644 --- a/src/test/java/org/prebid/server/auction/requestfactory/AmpRequestFactoryTest.java +++ b/src/test/java/org/prebid/server/auction/requestfactory/AmpRequestFactoryTest.java @@ -1309,7 +1309,7 @@ public void shouldReturnBidRequestImpExtContextDataWithTargetingAttributes() thr // given routingContext.queryParams() .add("targeting", mapper.writeValueAsString( - Targeting.of(Arrays.asList("appnexus", "rubicon"), null, null))); + Targeting.of(Arrays.asList("appnexus", "magnite"), null, null))); given(fpdResolver.resolveImpExt(any(), any())) .willReturn(mapper.createObjectNode().set("context", mapper.createObjectNode() diff --git a/src/test/java/org/prebid/server/auction/requestfactory/AuctionRequestFactoryTest.java b/src/test/java/org/prebid/server/auction/requestfactory/AuctionRequestFactoryTest.java index 59615bdbaab..ea694557289 100644 --- a/src/test/java/org/prebid/server/auction/requestfactory/AuctionRequestFactoryTest.java +++ b/src/test/java/org/prebid/server/auction/requestfactory/AuctionRequestFactoryTest.java @@ -210,7 +210,6 @@ public void setUp() { given(bidAdjustmentsEnricher.enrichBidRequest(any())).willReturn(defaultBidRequest); target = new AuctionRequestFactory( - Integer.MAX_VALUE, ortb2RequestFactory, storedRequestProcessor, profilesProcessor, @@ -243,39 +242,6 @@ public void shouldReturnFailedFutureIfRequestBodyIsMissing() { .hasMessage("Incoming request has no body"); } - @Test - public void shouldReturnFailedFutureIfRequestBodyExceedsMaxRequestSize() { - // given - target = new AuctionRequestFactory( - 1, - ortb2RequestFactory, - storedRequestProcessor, - profilesProcessor, - ortbVersionConversionManager, - auctionGppService, - cookieDeprecationService, - paramsExtractor, - paramsResolver, - interstitialProcessor, - ortbTypesResolver, - auctionPrivacyContextFactory, - debugResolver, - jacksonMapper, - geoLocationServiceWrapper, - bidAdjustmentsEnricher); - - given(requestBody.asString()).willReturn("body"); - - // when - final Future future = target.parseRequest(routingContext, 0L); - - // then - assertThat(future.failed()).isTrue(); - assertThat(future.cause()) - .isInstanceOf(InvalidRequestException.class) - .hasMessage("Request size exceeded max size of 1 bytes."); - } - @Test public void shouldReturnFailedFutureIfRequestBodyCouldNotBeParsed() { // given diff --git a/src/test/java/org/prebid/server/auction/requestfactory/VideoRequestFactoryTest.java b/src/test/java/org/prebid/server/auction/requestfactory/VideoRequestFactoryTest.java index ad154e06b49..ec2c147a281 100644 --- a/src/test/java/org/prebid/server/auction/requestfactory/VideoRequestFactoryTest.java +++ b/src/test/java/org/prebid/server/auction/requestfactory/VideoRequestFactoryTest.java @@ -137,7 +137,6 @@ public void setUp() { .willReturn(Future.succeededFuture(defaultPrivacyContext)); target = new VideoRequestFactory( - Integer.MAX_VALUE, false, null, ortb2RequestFactory, @@ -173,7 +172,6 @@ public void shouldReturnFailedFutureIfStoredRequestIsEnforcedAndIdIsNotProvided( given(routingContext.request().headers()).willReturn(MultiMap.caseInsensitiveMultiMap() .add(HttpUtil.USER_AGENT_HEADER, "123")); target = new VideoRequestFactory( - Integer.MAX_VALUE, true, null, ortb2RequestFactory, @@ -195,34 +193,6 @@ public void shouldReturnFailedFutureIfStoredRequestIsEnforcedAndIdIsNotProvided( .hasMessage("Unable to find required stored request id"); } - @Test - public void shouldReturnFailedFutureIfRequestBodyExceedsMaxRequestSize() { - // given - target = new VideoRequestFactory( - 2, - true, - null, - ortb2RequestFactory, - videoStoredRequestProcessor, - ortbVersionConversionManager, - paramsResolver, - auctionPrivacyContextFactory, - debugResolver, - jacksonMapper, - geoLocationServiceWrapper); - - given(requestBody.asString()).willReturn("body"); - - // when - final Future future = target.fromRequest(routingContext, 0L); - - // then - assertThat(future.failed()).isTrue(); - assertThat(future.cause()) - .isInstanceOf(InvalidRequestException.class) - .hasMessage("Request size exceeded max size of 2 bytes."); - } - @Test public void shouldReturnFailedFutureIfRequestBodyCouldNotBeParsed() { // given diff --git a/src/test/java/org/prebid/server/bidder/magnite/MagniteBidderTest.java b/src/test/java/org/prebid/server/bidder/magnite/MagniteBidderTest.java index 0012756a67c..1ee1eb0cb8e 100644 --- a/src/test/java/org/prebid/server/bidder/magnite/MagniteBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/magnite/MagniteBidderTest.java @@ -146,10 +146,10 @@ public class MagniteBidderTest extends VertxTest { private static final String BIDDER_NAME = "bidderName"; - private static final String ENDPOINT_URL = "http://rubiconproject.com/exchange.json"; + private static final String ENDPOINT_URL = "http://magniteproject.com/exchange.json"; private static final String DEFAULT_TK_X_INT = "prebid"; private static final String EXTERNAL_URL = "http://localhost:8080"; - private static final String APEX_RENDERER_URL = "https://video-outstream.rubiconproject.com/apex-2.2.1.js"; + private static final String APEX_RENDERER_URL = "https://video-outstream.magniteproject.com/apex-2.2.1.js"; private static final String USERNAME = "username"; private static final String PASSWORD = "password"; private static final String PBS_VERSION = "pbs_version"; @@ -417,7 +417,7 @@ public void makeHttpRequestsShouldReplaceDefaultParametersWithExtPrebidBiddersBi final Result>> result = target.makeHttpRequests(bidRequest); // then - final String expectedUrl = "http://rubiconproject.com/exchange.json?tk_xint=test"; + final String expectedUrl = "http://magniteproject.com/exchange.json?tk_xint=test"; assertThat(result.getValue()).hasSize(1).element(0).isNotNull() .returns(HttpMethod.POST, HttpRequest::getMethod) .returns(expectedUrl, HttpRequest::getUri); diff --git a/src/test/java/org/prebid/server/bidder/resetdigital/ResetDigitalBidderTest.java b/src/test/java/org/prebid/server/bidder/resetdigital/ResetDigitalBidderTest.java index dbcc555489a..71b8c798266 100644 --- a/src/test/java/org/prebid/server/bidder/resetdigital/ResetDigitalBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/resetdigital/ResetDigitalBidderTest.java @@ -10,11 +10,9 @@ import com.iab.openrtb.response.Bid; import com.iab.openrtb.response.BidResponse; import com.iab.openrtb.response.SeatBid; +import io.vertx.core.MultiMap; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; import org.prebid.server.VertxTest; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderCall; @@ -22,475 +20,377 @@ import org.prebid.server.bidder.model.HttpRequest; import org.prebid.server.bidder.model.HttpResponse; import org.prebid.server.bidder.model.Result; -import org.prebid.server.currency.CurrencyConversionService; -import org.prebid.server.exception.PreBidException; +import org.prebid.server.proto.openrtb.ext.response.BidType; +import org.prebid.server.util.HttpUtil; import java.math.BigDecimal; import java.util.List; +import java.util.Map; import java.util.function.UnaryOperator; import static java.util.Collections.singletonList; import static java.util.function.UnaryOperator.identity; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; -import static org.assertj.core.api.AssertionsForClassTypes.tuple; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.BDDMockito.given; -import static org.prebid.server.proto.openrtb.ext.response.BidType.audio; -import static org.prebid.server.proto.openrtb.ext.response.BidType.banner; -import static org.prebid.server.proto.openrtb.ext.response.BidType.video; - -@ExtendWith(MockitoExtension.class) -public class ResetDigitalBidderTest extends VertxTest { - - public static final String ENDPOINT_URL = "https://test.endpoint.com"; +import static org.assertj.core.api.Assertions.tuple; - @Mock - private CurrencyConversionService currencyConversionService; +public class ResetDigitalBidderTest extends VertxTest { + private static final String ENDPOINT_URL = "https://test.endpoint.com"; private ResetDigitalBidder target; @BeforeEach public void setUp() { - target = new ResetDigitalBidder(ENDPOINT_URL, currencyConversionService, jacksonMapper); + target = new ResetDigitalBidder(ENDPOINT_URL, jacksonMapper); } @Test public void creationShouldFailOnInvalidEndpointUrl() { assertThatIllegalArgumentException().isThrownBy(() -> - new ResetDigitalBidder("invalid_url", currencyConversionService, jacksonMapper)); + new ResetDigitalBidder("invalid_url", jacksonMapper)); } @Test - public void makeHttpRequestShouldReturnEmptyResponseIfAbsentAnyTypeInImp() { + public void makeHttpRequestsShouldReturnErrorWhenNoImpressions() { // given - final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(impBuilder -> impBuilder.banner(null)))) - .build(); - + final BidRequest bidRequest = BidRequest.builder().imp(List.of()).build(); // when final Result>> result = target.makeHttpRequests(bidRequest); - // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()).hasSize(0); + assertThat(result.getValue()).isEmpty(); + assertThat(result.getErrors()).hasSize(1) + .extracting(BidderError::getMessage) + .containsExactly("ResetDigital adapter supports only one impression per request"); } @Test - public void makeHttpRequestShouldReturnEmptyResponseIfxNativeImpTypePresent() { + public void makeHttpRequestsShouldReturnErrorWhenMultipleImpressions() { // given final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(impBuilder -> impBuilder.banner(null) - .xNative(Native.builder().build())))) + .imp(List.of(givenImp(identity()), givenImp(identity()))) .build(); - // when final Result>> result = target.makeHttpRequests(bidRequest); - // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()).hasSize(0); + assertThat(result.getValue()).isEmpty(); + assertThat(result.getErrors()).hasSize(1) + .extracting(BidderError::getMessage) + .containsExactly("ResetDigital adapter supports only one impression per request"); } @Test - public void makeHttpRequestShouldReturnSeparateResponseWithBannerAndVideoAndAudioImp() { + public void makeHttpRequestsShouldReturnErrorWhenImpExtIsInvalid() { // given final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(impBuilder -> impBuilder - .audio(Audio.builder().build()) - .video(Video.builder().build())))) + .imp(singletonList(Imp.builder() + .id("123") + .ext(jacksonMapper.mapper().createObjectNode().put("bidder", "invalid")) + .build())) .build(); - // when final Result>> result = target.makeHttpRequests(bidRequest); - // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()).hasSize(3); - assertThat(result.getValue().get(0)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getBanner) - .isNotNull(); - - assertThat(result.getValue().get(1)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getVideo) - .isNotNull(); - - assertThat(result.getValue().get(2)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getAudio) - .isNotNull(); + assertThat(result.getValue()).isEmpty(); + assertThat(result.getErrors()).hasSize(1) + .allSatisfy(error -> { + assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input); + assertThat(error.getMessage()).startsWith("Error parsing resetDigitalExt from imp.ext"); + }); } @Test - public void makeHttpRequestShouldReturnSeparateResponseWithBannerAndVideoImp() { + public void makeHttpRequestsShouldCreateCorrectUrl() { // given - final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(impBuilder -> impBuilder - .video(Video.builder().build())))) - .build(); - + final BidRequest bidRequest = givenBidRequest(identity()); // when final Result>> result = target.makeHttpRequests(bidRequest); - // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()).hasSize(2); - assertThat(result.getValue().get(0)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getBanner) - .isNotNull(); - - assertThat(result.getValue().get(1)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getVideo) - .isNotNull(); + assertThat(result.getValue()).hasSize(1) + .extracting(HttpRequest::getUri) + .containsExactly("https://test.endpoint.com?pid=placementId123"); + assertThat(result.getErrors()).isEmpty(); } @Test - public void makeHttpRequestShouldReturnSeparateResponseWithBannerAndAudioImp() { + public void makeHttpRequestsShouldContainXOpenRtbVersionHeader() { // given - final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(impBuilder -> impBuilder - .audio(Audio.builder().build())))) - .build(); - + final BidRequest bidRequest = givenBidRequest(identity()); // when final Result>> result = target.makeHttpRequests(bidRequest); - // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()).hasSize(2); - assertThat(result.getValue().get(0)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getBanner) - .isNotNull(); - - assertThat(result.getValue().get(1)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getAudio) - .isNotNull(); + assertThat(result.getValue()) + .extracting(HttpRequest::getHeaders) + .flatExtracting(MultiMap::entries) + .extracting(Map.Entry::getKey, Map.Entry::getValue) + .containsOnlyOnce(tuple(HttpUtil.X_OPENRTB_VERSION_HEADER.toString(), "2.5")); + assertThat(result.getErrors()).isEmpty(); } @Test - public void makeHttpRequestShouldReturnSeparateResponseWithVideoAndAudioImp() { + public void makeHttpRequestsShouldSetTagIdFromPlacementIdWhenEmpty() { // given - final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(impBuilder -> impBuilder - .banner(null) - .video(Video.builder().build()) - .audio(Audio.builder().build())))) - .build(); - + final BidRequest bidRequest = givenBidRequest(identity()); // when final Result>> result = target.makeHttpRequests(bidRequest); - // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()).hasSize(2); - assertThat(result.getValue().get(0)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getVideo) - .isNotNull(); - - assertThat(result.getValue().get(1)) - .extracting(HttpRequest::getPayload) - .extracting(BidRequest::getImp) - .extracting(a -> a.getFirst()) - .extracting(Imp::getAudio) - .isNotNull(); + assertThat(result.getValue()).hasSize(1); + assertThat(result.getValue().getFirst().getPayload().getImp().getFirst().getTagid()) + .isEqualTo("placementId123"); + assertThat(result.getErrors()).isEmpty(); } @Test - public void makeHttpRequestShouldReturnResponseOnlyWithBannerImp() { + public void makeHttpRequestsShouldNotOverrideExistingTagId() { // given - final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(identity()))) - .build(); - + final BidRequest bidRequest = givenBidRequest(impBuilder -> impBuilder.tagid("existingTagId")); // when final Result>> result = target.makeHttpRequests(bidRequest); - // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()) - .extracting(HttpRequest::getPayload) - .flatExtracting(BidRequest::getImp) - .allSatisfy(imp -> { - assertThat(imp.getBanner()).isNotNull(); - assertThat(imp.getVideo()).isNull(); - assertThat(imp.getAudio()).isNull(); - }); + assertThat(result.getValue()).hasSize(1); + assertThat(result.getValue().getFirst().getPayload().getImp().getFirst().getTagid()) + .isEqualTo("existingTagId"); + assertThat(result.getErrors()).isEmpty(); } @Test - public void makeHttpRequestShouldReturnResponseOnlyWithVideoImp() { + public void makeBidsShouldReturnErrorIfResponseBodyCouldNotBeParsed() { // given - final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(impBuilder -> impBuilder.banner(null) - .video(Video.builder().build())))) - .build(); - + final BidderCall httpCall = givenHttpCall(givenBidRequest(identity()), "invalid"); // when - final Result>> result = target.makeHttpRequests(bidRequest); - + final Result> result = target.makeBids(httpCall, null); // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()) - .extracting(HttpRequest::getPayload) - .flatExtracting(BidRequest::getImp) - .allSatisfy(imp -> { - assertThat(imp.getBanner()).isNull(); - assertThat(imp.getVideo()).isNotNull(); - assertThat(imp.getAudio()).isNull(); + assertThat(result.getErrors()).hasSize(1) + .allSatisfy(error -> { + assertThat(error.getType()).isEqualTo(BidderError.Type.bad_server_response); + assertThat(error.getMessage()).startsWith("Failed to decode: Unrecognized token"); }); + assertThat(result.getValue()).isEmpty(); } @Test - public void makeHttpRequestShouldReturnResponseOnlyWithAudioImp() { + public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProcessingException { // given - final BidRequest bidRequest = BidRequest.builder() - .imp(singletonList(givenImp(impBuilder -> impBuilder.banner(null) - .audio(Audio.builder().build())))) - .build(); - + final BidderCall httpCall = givenHttpCall( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString(null)); // when - final Result>> result = target.makeHttpRequests(bidRequest); - + final Result> result = target.makeBids(httpCall, null); // then - assertThat(result.getErrors()).hasSize(0); - assertThat(result.getValue()) - .extracting(HttpRequest::getPayload) - .flatExtracting(BidRequest::getImp) - .allSatisfy(imp -> { - assertThat(imp.getBanner()).isNull(); - assertThat(imp.getVideo()).isNull(); - assertThat(imp.getAudio()).isNotNull(); - }); + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).isEmpty(); } @Test - public void makeBidsShouldReturnErrorIfResponseBodyCouldNotBeParsed() { + public void makeBidsShouldReturnEmptyListIfBidResponseSeatBidIsNull() throws JsonProcessingException { // given - final BidderCall httpCall = givenHttpCall(null, "invalid"); - + final BidderCall httpCall = givenHttpCall( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString(BidResponse.builder().build())); // when final Result> result = target.makeBids(httpCall, null); - // then - assertThat(result.getErrors()).hasSize(1) - .allSatisfy(error -> { - assertThat(error.getType()).isEqualTo(BidderError.Type.bad_server_response); - assertThat(error.getMessage()).startsWith("Failed to decode: Unrecognized token"); - }); + assertThat(result.getErrors()).isEmpty(); assertThat(result.getValue()).isEmpty(); } @Test - public void makeHttpRequestsShouldConvertCurrencyIfRequestCurrencyDoesNotMatchBidderCurrency() { + public void makeBidsShouldReturnBannerBidByMType() throws JsonProcessingException { // given - given(currencyConversionService.convertCurrency(any(), any(), anyString(), anyString())) - .willReturn(BigDecimal.TEN); - - final BidRequest bidRequest = givenBidRequest( - impBuilder -> impBuilder.bidfloor(BigDecimal.ONE).bidfloorcur("EUR")); - + final BidderCall httpCall = givenHttpCall( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("123").mtype(1)))); // when - final Result>> result = target.makeHttpRequests(bidRequest); - + final Result> result = target.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); assertThat(result.getValue()) - .extracting(HttpRequest::getPayload) - .flatExtracting(BidRequest::getImp) - .extracting(Imp::getBidfloor, Imp::getBidfloorcur) - .containsOnly(tuple(BigDecimal.TEN, "USD")); + .containsExactly(BidderBid.of(Bid.builder().impid("123").mtype(1) + .price(BigDecimal.ONE).build(), BidType.banner, "USD")); } @Test - public void makeHttpRequestsShouldReturnErrorMessageOnFailedCurrencyConversion() { + public void makeBidsShouldReturnVideoBidByMType() throws JsonProcessingException { // given - given(currencyConversionService.convertCurrency(any(), any(), anyString(), anyString())) - .willThrow(PreBidException.class); - - final BidRequest bidRequest = givenBidRequest( - impCustomizer -> impCustomizer.bidfloor(BigDecimal.ONE).bidfloorcur("EUR")); - + final BidderCall httpCall = givenHttpCall( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("123").mtype(2)))); // when - final Result>> result = target.makeHttpRequests(bidRequest); - + final Result> result = target.makeBids(httpCall, null); // then - assertThat(result.getErrors()).allSatisfy(bidderError -> { - assertThat(bidderError.getType()) - .isEqualTo(BidderError.Type.bad_input); - assertThat(bidderError.getMessage()) - .isEqualTo("Unable to convert provided bid floor currency from EUR to USD for imp `123`"); - }); + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()) + .containsExactly(BidderBid.of(Bid.builder().impid("123").mtype(2) + .price(BigDecimal.ONE).build(), BidType.video, "USD")); } @Test - public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProcessingException { + public void makeBidsShouldReturnNativeBidByMType() throws JsonProcessingException { // given - final BidderCall httpCall = givenHttpCall(null, mapper.writeValueAsString(null)); - + final BidderCall httpCall = givenHttpCall( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("123").mtype(4)))); // when final Result> result = target.makeBids(httpCall, null); - // then assertThat(result.getErrors()).isEmpty(); - assertThat(result.getValue()).isEmpty(); + assertThat(result.getValue()) + .containsExactly(BidderBid.of(Bid.builder().impid("123").mtype(4) + .price(BigDecimal.ONE).build(), BidType.xNative, "USD")); } @Test - public void makeBidsShouldReturnEmptyListIfBidResponseSeatBidIsNull() throws JsonProcessingException { + public void makeBidsShouldReturnAudioBidByMType() throws JsonProcessingException { // given - final BidderCall httpCall = givenHttpCall(null, - mapper.writeValueAsString(BidResponse.builder().build())); - + final BidderCall httpCall = givenHttpCall( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("123").mtype(3)))); // when final Result> result = target.makeBids(httpCall, null); - // then assertThat(result.getErrors()).isEmpty(); - assertThat(result.getValue()).isEmpty(); + assertThat(result.getValue()) + .containsExactly(BidderBid.of(Bid.builder().impid("123").mtype(3) + .price(BigDecimal.ONE).build(), BidType.audio, "USD")); } @Test - public void makeBidsShouldReturnBannerBidIfBannerIsPresentInRequestImp() throws JsonProcessingException { + public void makeBidsShouldReturnBannerBidFromImpWhenMTypeIsNull() throws JsonProcessingException { // given final BidderCall httpCall = givenHttpCall( - BidRequest.builder() - .imp(singletonList(Imp.builder().id("123").banner(Banner.builder().build()).build())) - .build(), - mapper.writeValueAsString( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString( givenBidResponse(bidBuilder -> bidBuilder.impid("123")))); - // when final Result> result = target.makeBids(httpCall, null); - // then assertThat(result.getErrors()).isEmpty(); assertThat(result.getValue()) - .containsOnly(BidderBid.of(Bid.builder().impid("123").build(), banner, "USD")); + .containsExactly(BidderBid.of(Bid.builder().impid("123") + .price(BigDecimal.ONE).build(), BidType.banner, "USD")); } @Test - public void makeBidsShouldReturnVideoBidIfVideoIsPresentInRequestImp() throws JsonProcessingException { + public void makeBidsShouldReturnVideoBidFromImpWhenMTypeIsNull() throws JsonProcessingException { // given final BidderCall httpCall = givenHttpCall( - BidRequest.builder() - .imp(singletonList(Imp.builder().id("123").video(Video.builder().build()).build())) - .build(), - mapper.writeValueAsString( + givenBidRequest(impBuilder -> impBuilder.banner(null).video(Video.builder().build())), + jacksonMapper.mapper().writeValueAsString( givenBidResponse(bidBuilder -> bidBuilder.impid("123")))); - // when final Result> result = target.makeBids(httpCall, null); - // then assertThat(result.getErrors()).isEmpty(); assertThat(result.getValue()) - .containsOnly(BidderBid.of(Bid.builder().impid("123").build(), video, "USD")); + .containsExactly(BidderBid.of(Bid.builder().impid("123") + .price(BigDecimal.ONE).build(), BidType.video, "USD")); } @Test - public void makeBidsShouldReturnAudioBidIfAudioIsPresentInRequestImp() throws JsonProcessingException { + public void makeBidsShouldReturnAudioBidFromImpWhenMTypeIsNull() throws JsonProcessingException { // given final BidderCall httpCall = givenHttpCall( - BidRequest.builder() - .imp(singletonList(Imp.builder().id("123").audio(Audio.builder().build()).build())) - .build(), - mapper.writeValueAsString( + givenBidRequest(impBuilder -> impBuilder.banner(null).audio(Audio.builder().build())), + jacksonMapper.mapper().writeValueAsString( givenBidResponse(bidBuilder -> bidBuilder.impid("123")))); - // when final Result> result = target.makeBids(httpCall, null); - // then assertThat(result.getErrors()).isEmpty(); assertThat(result.getValue()) - .containsOnly(BidderBid.of(Bid.builder().impid("123").build(), audio, "USD")); + .containsExactly(BidderBid.of(Bid.builder().impid("123") + .price(BigDecimal.ONE).build(), BidType.audio, "USD")); } @Test - public void makeBidsShouldReturnErrorBidIfBidTypeIsAbsentInRequestImp() throws JsonProcessingException { + public void makeBidsShouldReturnNativeBidFromImpWhenMTypeIsNull() throws JsonProcessingException { // given final BidderCall httpCall = givenHttpCall( - BidRequest.builder() - .imp(singletonList(Imp.builder().id("123").build())) - .build(), - mapper.writeValueAsString( + givenBidRequest(impBuilder -> impBuilder.banner(null).xNative(Native.builder().build())), + jacksonMapper.mapper().writeValueAsString( givenBidResponse(bidBuilder -> bidBuilder.impid("123")))); - // when final Result> result = target.makeBids(httpCall, null); + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()) + .containsExactly(BidderBid.of(Bid.builder().impid("123") + .price(BigDecimal.ONE).build(), BidType.xNative, "USD")); + } + @Test + public void makeBidsShouldFilterOutZeroPriceBids() throws JsonProcessingException { + // given + final BidderCall httpCall = givenHttpCall( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("123").price(BigDecimal.ZERO)))); + // when + final Result> result = target.makeBids(httpCall, null); // then + assertThat(result.getValue()).isEmpty(); assertThat(result.getErrors()).hasSize(1) .extracting(BidderError::getMessage) - .containsExactly("Failed to find banner/video/audio impression 123"); - assertThat(result.getValue()).isEmpty(); + .containsExactly("price 0 <= 0 filtered out"); } @Test - public void makeBidsShouldReturnErrorIfBidCurIsNotUsd() throws JsonProcessingException { + public void makeBidsShouldReturnErrorWhenMTypeIsUnsupported() throws JsonProcessingException { // given final BidderCall httpCall = givenHttpCall( - BidRequest.builder() - .imp(singletonList(Imp.builder().id("123").build())) - .build(), - mapper.writeValueAsString(givenBidResponse(identity()).toBuilder().cur("EUR").build())); - + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("123").mtype(99)))); // when final Result> result = target.makeBids(httpCall, null); - // then + assertThat(result.getValue()).isEmpty(); assertThat(result.getErrors()).hasSize(1) .extracting(BidderError::getMessage) - .containsExactly("Bidder support only USD currency"); - assertThat(result.getValue()).isEmpty(); + .containsExactly("Unsupported MType: 99"); } - private static BidRequest givenBidRequest(UnaryOperator bidRequestCustomizer, - UnaryOperator impCustomizer) { - - return bidRequestCustomizer.apply(BidRequest.builder() - .imp(singletonList(givenImp(impCustomizer)))) - .build(); + @Test + public void makeBidsShouldUseCurrencyFromBidResponse() throws JsonProcessingException { + // given + final BidderCall httpCall = givenHttpCall( + givenBidRequest(identity()), + jacksonMapper.mapper().writeValueAsString( + givenBidResponse(identity()).toBuilder().cur("EUR").build())); + // when + final Result> result = target.makeBids(httpCall, null); + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).hasSize(1) + .extracting(BidderBid::getBidCurrency) + .containsExactly("EUR"); } - private static BidRequest givenBidRequest(UnaryOperator impCustomizer) { - return givenBidRequest(identity(), impCustomizer); + private BidRequest givenBidRequest(UnaryOperator impCustomizer) { + return BidRequest.builder() + .imp(singletonList(givenImp(impCustomizer))) + .build(); } - private static Imp givenImp(UnaryOperator impCustomizer) { + private Imp givenImp(UnaryOperator impCustomizer) { return impCustomizer.apply(Imp.builder() .id("123") - .banner(Banner.builder().w(23).h(25).build())) + .banner(Banner.builder().w(300).h(250).build()) + .ext(jacksonMapper.mapper().createObjectNode() + .set("bidder", jacksonMapper.mapper().createObjectNode() + .put("placement_id", "placementId123")))) .build(); } private static BidResponse givenBidResponse(UnaryOperator bidCustomizer) { return BidResponse.builder() - .seatbid(singletonList(SeatBid.builder().bid(singletonList(bidCustomizer.apply(Bid.builder()).build())) + .seatbid(singletonList(SeatBid.builder() + .bid(singletonList(bidCustomizer.apply(Bid.builder() + .impid("123") + .price(BigDecimal.ONE)).build())) .build())) .cur("USD") .build(); diff --git a/src/test/java/org/prebid/server/floors/BasicPriceFloorAdjusterTest.java b/src/test/java/org/prebid/server/floors/BasicPriceFloorAdjusterTest.java index 20d7308a271..c40588bbce0 100644 --- a/src/test/java/org/prebid/server/floors/BasicPriceFloorAdjusterTest.java +++ b/src/test/java/org/prebid/server/floors/BasicPriceFloorAdjusterTest.java @@ -44,7 +44,7 @@ @ExtendWith(MockitoExtension.class) public class BasicPriceFloorAdjusterTest extends VertxTest { - private static final String RUBICON = "rubicon"; + private static final String MAGNITE = "magnite"; @Mock(strictness = LENIENT) private FloorAdjustmentFactorResolver floorAdjustmentFactorResolver; @@ -74,19 +74,19 @@ public void adjustForImpShouldApplyAllAdjustments() { // when final Price adjustedBidPrice = target.adjustForImp( givenImp(identity()), - RUBICON, + MAGNITE, givenBidRequest, null, new ArrayList<>()); // then assertThat(adjustedBidPrice).isEqualTo(Price.of("UAH", new BigDecimal("117.00"))); - verify(floorAdjustmentFactorResolver).resolve(eq(Set.of(video_instream)), any(), eq(RUBICON)); + verify(floorAdjustmentFactorResolver).resolve(eq(Set.of(video_instream)), any(), eq(MAGNITE)); verify(floorAdjustmentsResolver).resolve( eq(Price.of("USD", new BigDecimal(100))), eq(givenBidRequest), eq(Set.of(video_instream)), - eq(RUBICON)); + eq(MAGNITE)); } @Test @@ -103,7 +103,7 @@ public void adjustForImpShouldNotApplyAdjustmentsWhenAdjustmentDisabledByAccount // when final Price adjustedBidPrice = target.adjustForImp( givenImp(identity()), - RUBICON, + MAGNITE, givenBidRequest(identity()), account, new ArrayList<>()); @@ -121,7 +121,7 @@ public void adjustForImpShouldNotApplyAdjustmentsWhenAdjustmentDisabledByRequest .bidadjustmentfactors(ExtRequestBidAdjustmentFactors.builder() .mediatypes(givenMediaTypes(Map.of( ImpMediaType.video, - Map.of(RUBICON, BigDecimal.valueOf(0.85D))))) + Map.of(MAGNITE, BigDecimal.valueOf(0.85D))))) .build()) .floors(PriceFloorRules.builder() .enforcement(PriceFloorEnforcement.builder() @@ -133,7 +133,7 @@ public void adjustForImpShouldNotApplyAdjustmentsWhenAdjustmentDisabledByRequest // when final Price adjustedBidPrice = target.adjustForImp( givenImp(identity()), - RUBICON, + MAGNITE, bidRequest, null, new ArrayList<>()); @@ -155,7 +155,7 @@ public void adjustForImpShouldApplyNoFactorAdjustmentsWhenBidAdjustmentsFactorIs // when final Price adjustedBidPrice = target.adjustForImp( imp, - RUBICON, + MAGNITE, bidRequest, null, new ArrayList<>()); @@ -167,7 +167,7 @@ public void adjustForImpShouldApplyNoFactorAdjustmentsWhenBidAdjustmentsFactorIs eq(Price.of(imp.getBidfloorcur(), imp.getBidfloor())), eq(bidRequest), eq(Set.of(video_instream)), - eq(RUBICON)); + eq(MAGNITE)); } @Test @@ -178,7 +178,7 @@ public void adjustForImpShouldReturnNullIfImpBidFloorIsNotPresent() { // when final Price adjustedBidPrice = target.adjustForImp( imp, - RUBICON, + MAGNITE, givenBidRequest(identity()), null, new ArrayList<>()); @@ -203,7 +203,7 @@ public void adjustForImpShouldReturnBidFloorNotFactoredByOtherBidder() { // when final Price adjustedBidPrice = target.adjustForImp( givenImp(identity()), - RUBICON, + MAGNITE, bidRequest, null, new ArrayList<>()); @@ -225,7 +225,7 @@ public void adjustForImpShouldReturnFactoredOfOneIfExtBidAdjustmentsFactorMediaT // when final Price adjustedBidPrice = target.adjustForImp( givenImp(identity()), - RUBICON, + MAGNITE, bidRequest, null, new ArrayList<>()); @@ -243,7 +243,7 @@ public void adjustForImpShouldReturnFactorOfOneIfNoMediaTypeInImpression() { // when final Price adjustedBidPrice = target.adjustForImp( imp, - RUBICON, + MAGNITE, bidRequest, null, new ArrayList<>()); @@ -260,14 +260,14 @@ public void adjustForImpShouldSkipMediaTypeIfNoMediaTypesOfImpFound() { .bidadjustmentfactors(ExtRequestBidAdjustmentFactors.builder() .mediatypes(givenMediaTypes(Map.of( ImpMediaType.video_outstream, - Map.of(RUBICON, BigDecimal.valueOf(0.8D))))) + Map.of(MAGNITE, BigDecimal.valueOf(0.8D))))) .build()) .build()))); // when final Price adjustedBidPrice = target.adjustForImp( givenImp(identity()), - RUBICON, + MAGNITE, bidRequest, null, new ArrayList<>()); @@ -287,7 +287,7 @@ public void adjustForImpShouldSkipBidAdjustmentsWhenResolverThrowsException() { // when final Price adjustedBidPrice = target.adjustForImp( givenImp(identity()), - RUBICON, + MAGNITE, givenBidRequest, null, new ArrayList<>()); @@ -303,7 +303,7 @@ private static BidRequest givenBidRequest(UnaryOperator bidderStatuses = - singletonList(BidderUsersyncStatus.builder().bidder("rubicon").build()); + singletonList(BidderUsersyncStatus.builder().bidder("magnite").build()); given(cookieSyncService.processContext(any())) .willAnswer(invocation -> Future.succeededFuture(invocation.getArgument(0))); diff --git a/src/test/java/org/prebid/server/handler/SetuidHandlerTest.java b/src/test/java/org/prebid/server/handler/SetuidHandlerTest.java index 815453e85ea..dab9d1328b9 100644 --- a/src/test/java/org/prebid/server/handler/SetuidHandlerTest.java +++ b/src/test/java/org/prebid/server/handler/SetuidHandlerTest.java @@ -79,10 +79,11 @@ @ExtendWith(MockitoExtension.class) public class SetuidHandlerTest extends VertxTest { - private static final String RUBICON = "rubicon"; + private static final String MAGNITE = "magnite"; + private static final String MAGNITE_COOKIE = "rubicon"; private static final String FACEBOOK = "audienceNetwork"; - private static final String ADNXS = "adnxs"; private static final String APPNEXUS = "appnexus"; + private static final String APPNEXUS_COOKIE = "adnxs"; @Mock(strictness = LENIENT) private UidsCookieService uidsCookieService; @@ -119,7 +120,7 @@ public class SetuidHandlerTest extends VertxTest { @BeforeEach public void setUp() { final Map bidderToGdpr = Map.of( - RUBICON, PrivacyEnforcementAction.allowAll(), + MAGNITE, PrivacyEnforcementAction.allowAll(), APPNEXUS, PrivacyEnforcementAction.allowAll(), FACEBOOK, PrivacyEnforcementAction.allowAll()); @@ -151,20 +152,20 @@ public void setUp() { Base64.getUrlEncoder().encodeToString(((UidsCookie) invocation.getArgument(0)) .toJson().getBytes())))); - given(bidderCatalog.usersyncReadyBidders()).willReturn(Set.of(RUBICON, FACEBOOK, APPNEXUS)); + given(bidderCatalog.usersyncReadyBidders()).willReturn(Set.of(MAGNITE, FACEBOOK, APPNEXUS)); given(bidderCatalog.isAlias(any())).willReturn(false); - given(bidderCatalog.usersyncerByName(eq(RUBICON))).willReturn( - Optional.of(Usersyncer.of(RUBICON, null, redirectMethod(), false, null))); - given(bidderCatalog.cookieFamilyName(eq(RUBICON))).willReturn(Optional.of(RUBICON)); + given(bidderCatalog.usersyncerByName(eq(MAGNITE))).willReturn( + Optional.of(Usersyncer.of(MAGNITE_COOKIE, null, redirectMethod(), false, null))); + given(bidderCatalog.cookieFamilyName(eq(MAGNITE))).willReturn(Optional.of(MAGNITE_COOKIE)); given(bidderCatalog.usersyncerByName(eq(FACEBOOK))).willReturn( Optional.of(Usersyncer.of(FACEBOOK, null, redirectMethod(), false, null))); given(bidderCatalog.cookieFamilyName(eq(FACEBOOK))).willReturn(Optional.of(FACEBOOK)); given(bidderCatalog.usersyncerByName(eq(APPNEXUS))).willReturn( - Optional.of(Usersyncer.of(ADNXS, null, redirectMethod(), false, null))); - given(bidderCatalog.cookieFamilyName(eq(APPNEXUS))).willReturn(Optional.of(ADNXS)); + Optional.of(Usersyncer.of(APPNEXUS_COOKIE, null, redirectMethod(), false, null))); + given(bidderCatalog.cookieFamilyName(eq(APPNEXUS))).willReturn(Optional.of(APPNEXUS_COOKIE)); given(activityInfrastructure.isAllowed(any(), any())) .willReturn(true); @@ -194,7 +195,7 @@ public void shouldRespondWithErrorAndTriggerMetricsAndAnalyticsWhenOptedOut() { given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(new UidsCookie(Uids.builder().uids(emptyMap()).optout(true).build(), jacksonMapper)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); // when setuidHandler.handle(routingContext); @@ -246,7 +247,7 @@ public void shouldRespondWithErrorIfBidderParamIsInvalid() { @Test public void shouldRespondWithBadRequestStatusIfGdprConsentIsInvalid() { // given - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(new UidsCookie(Uids.builder().uids(emptyMap()).build(), jacksonMapper)); @@ -258,7 +259,7 @@ public void shouldRespondWithBadRequestStatusIfGdprConsentIsInvalid() { setuidHandler.handle(routingContext); // then - verify(metrics).updateUserSyncTcfInvalidMetric(RUBICON); + verify(metrics).updateUserSyncTcfInvalidMetric(MAGNITE); verify(httpResponse).setStatusCode(eq(400)); verify(httpResponse).end(eq("Invalid request format: Consent string is invalid")); } @@ -266,7 +267,7 @@ public void shouldRespondWithBadRequestStatusIfGdprConsentIsInvalid() { @Test public void shouldRespondWithUnavailableForLegalReasonsStatusIfDisallowedActivity() { // given - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("account")).willReturn("accountId"); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(emptyUidsCookie()); @@ -287,7 +288,7 @@ public void shouldRespondWithUnavailableForLegalReasonsStatusIfDisallowedActivit @Test public void shouldRespondWithErrorOnInvalidAccountConfigException() { // given - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("account")).willReturn("accountId"); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(emptyUidsCookie()); @@ -311,10 +312,10 @@ public void shouldPassUnsuccessfulEventToAnalyticsReporterIfUidMissingInRequest( final UidsCookie uidsCookie = emptyUidsCookie(); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, null)) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, null)) .willReturn(unaltered(uidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); // when setuidHandler.handle(routingContext); @@ -323,7 +324,7 @@ public void shouldPassUnsuccessfulEventToAnalyticsReporterIfUidMissingInRequest( final SetuidEvent setuidEvent = captureSetuidEvent(); assertThat(setuidEvent).isEqualTo(SetuidEvent.builder() .status(200) - .bidder(RUBICON) + .bidder(MAGNITE_COOKIE) .success(false) .build()); } @@ -334,12 +335,12 @@ public void shouldRespondWithoutCookieIfGdprProcessingPreventsCookieSetting() { final PrivacyEnforcementAction privacyEnforcementAction = PrivacyEnforcementAction.restrictAll(); given(tcfDefinerService.resultForBidderNames(anySet(), any(), any())) .willReturn(Future.succeededFuture( - TcfResponse.of(true, singletonMap(RUBICON, privacyEnforcementAction), null))); + TcfResponse.of(true, singletonMap(MAGNITE, privacyEnforcementAction), null))); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(new UidsCookie(Uids.builder().uids(emptyMap()).build(), jacksonMapper)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpResponse.setStatusMessage(anyString())).willReturn(httpResponse); // when @@ -349,7 +350,7 @@ public void shouldRespondWithoutCookieIfGdprProcessingPreventsCookieSetting() { verify(httpResponse, never()).addCookie(any(Cookie.class)); verify(httpResponse).setStatusCode(eq(451)); verify(httpResponse).end(eq("The gdpr_consent param prevents cookies from being saved")); - verify(metrics).updateUserSyncTcfBlockedMetric(RUBICON); + verify(metrics).updateUserSyncTcfBlockedMetric(MAGNITE); final SetuidEvent setuidEvent = captureSetuidEvent(); assertThat(setuidEvent).isEqualTo(SetuidEvent.builder().status(451).build()); @@ -364,7 +365,7 @@ public void shouldRespondWithBadRequestStatusIfGdprProcessingFailsWithInvalidReq given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(new UidsCookie(Uids.builder().uids(emptyMap()).build(), jacksonMapper)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); // when setuidHandler.handle(routingContext); @@ -387,7 +388,7 @@ public void shouldRespondWithInternalServerErrorStatusIfGdprProcessingFailsWithU given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(new UidsCookie(Uids.builder().uids(emptyMap()).build(), jacksonMapper)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); // when setuidHandler.handle(routingContext); @@ -405,10 +406,10 @@ public void shouldPassAccountToPrivacyEnforcementServiceWhenAccountIsFound() { final UidsCookie uidsCookie = emptyUidsCookie(); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, null)) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, null)) .willReturn(updated(uidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("account")).willReturn("accId"); final AccountGdprConfig accountGdprConfig = AccountGdprConfig.builder() @@ -434,10 +435,10 @@ public void shouldPassAccountToPrivacyEnforcementServiceWhenAccountIsNotFound() final UidsCookie uidsCookie = emptyUidsCookie(); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, null)) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, null)) .willReturn(updated(uidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("account")).willReturn("accId"); given(applicationSettings.getAccountById(any(), any())).willReturn(Future.failedFuture("bad req")); @@ -454,15 +455,15 @@ public void shouldPassAccountToPrivacyEnforcementServiceWhenAccountIsNotFound() public void shouldRespondWithCookieFromRequestParam() throws IOException { // given final UidsCookie uidsCookie = emptyUidsCookie(); - final UidsCookie updatedUidsCookie = uidsCookie.updateUid(RUBICON, "J5VLCWQP-26-CWFT"); + final UidsCookie updatedUidsCookie = uidsCookie.updateUid(MAGNITE_COOKIE, "J5VLCWQP-26-CWFT"); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "J5VLCWQP-26-CWFT")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "J5VLCWQP-26-CWFT")) .willReturn(updated(updatedUidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("uid")).willReturn("J5VLCWQP-26-CWFT"); // when @@ -478,11 +479,11 @@ public void shouldRespondWithCookieFromRequestParamWhenBidderAndCookieFamilyAreD // given final UidsCookie uidsCookie = emptyUidsCookie(); - final UidsCookie updatedUidsCookie = uidsCookie.updateUid(ADNXS, "J5VLCWQP-26-CWFT"); + final UidsCookie updatedUidsCookie = uidsCookie.updateUid(APPNEXUS_COOKIE, "J5VLCWQP-26-CWFT"); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, ADNXS, "J5VLCWQP-26-CWFT")) + given(uidsCookieService.updateUidsCookie(uidsCookie, APPNEXUS_COOKIE, "J5VLCWQP-26-CWFT")) .willReturn(updated(updatedUidsCookie)); given(httpRequest.getParam("bidder")).willReturn(APPNEXUS); @@ -501,11 +502,11 @@ public void shouldRespondWithCookieFromRequestParamWhenBidderCaseInRequestIsDiff // given final UidsCookie uidsCookie = emptyUidsCookie(); - final UidsCookie updatedUidsCookie = uidsCookie.updateUid(ADNXS, "J5VLCWQP-26-CWFT"); + final UidsCookie updatedUidsCookie = uidsCookie.updateUid(APPNEXUS_COOKIE, "J5VLCWQP-26-CWFT"); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, ADNXS, "J5VLCWQP-26-CWFT")) + given(uidsCookieService.updateUidsCookie(uidsCookie, APPNEXUS_COOKIE, "J5VLCWQP-26-CWFT")) .willReturn(updated(updatedUidsCookie)); given(httpRequest.getParam("bidder")).willReturn("ApPnExUs"); @@ -528,7 +529,7 @@ public void shouldSendPixelWhenFParamIsEqualToIWhenTypeIsIframe() throws JsonPro given(uidsCookieService.updateUidsCookie(any(), any(), any())) .willReturn(updated(uidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("f")).willReturn("i"); given(httpRequest.getParam("uid")).willReturn("J5VLCWQP-26-CWFT"); @@ -548,15 +549,15 @@ public void shouldSendEmptyResponseWhenFParamIsEqualToBWhenTypeIsRedirect() thro final UidsCookie uidsCookie = emptyUidsCookie(); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "J5VLCWQP-26-CWFT")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "J5VLCWQP-26-CWFT")) .willReturn(updated(uidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("f")).willReturn("b"); given(httpRequest.getParam("uid")).willReturn("J5VLCWQP-26-CWFT"); - given(bidderCatalog.usersyncReadyBidders()).willReturn(singleton(RUBICON)); + given(bidderCatalog.usersyncReadyBidders()).willReturn(singleton(MAGNITE)); given(bidderCatalog.usersyncerByName(any())) - .willReturn(Optional.of(Usersyncer.of(RUBICON, null, redirectMethod(), false, null))); + .willReturn(Optional.of(Usersyncer.of(MAGNITE_COOKIE, null, redirectMethod(), false, null))); setuidHandler = new SetuidHandler( 2000, @@ -589,13 +590,13 @@ public void shouldSendEmptyResponseWhenFParamNotDefinedAndTypeIsIframe() throws final UidsCookie uidsCookie = emptyUidsCookie(); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "J5VLCWQP-26-CWFT")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "J5VLCWQP-26-CWFT")) .willReturn(updated(uidsCookie)); - given(bidderCatalog.usersyncerByName(eq(RUBICON))).willReturn( - Optional.of(Usersyncer.of(RUBICON, iframeMethod(), null, false, null))); + given(bidderCatalog.usersyncerByName(eq(MAGNITE))).willReturn( + Optional.of(Usersyncer.of(MAGNITE_COOKIE, iframeMethod(), null, false, null))); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("uid")).willReturn("J5VLCWQP-26-CWFT"); setuidHandler = new SetuidHandler( @@ -629,13 +630,13 @@ public void shouldSendPixelWhenFParamNotDefinedAndTypeIsRedirect() throws JsonPr final UidsCookie uidsCookie = emptyUidsCookie(); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "J5VLCWQP-26-CWFT")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "J5VLCWQP-26-CWFT")) .willReturn(updated(uidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); - given(bidderCatalog.usersyncReadyBidders()).willReturn(singleton(RUBICON)); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); + given(bidderCatalog.usersyncReadyBidders()).willReturn(singleton(MAGNITE)); given(bidderCatalog.usersyncerByName(any())) - .willReturn(Optional.of(Usersyncer.of(RUBICON, null, redirectMethod(), false, null))); + .willReturn(Optional.of(Usersyncer.of(MAGNITE_COOKIE, null, redirectMethod(), false, null))); given(httpRequest.getParam("uid")).willReturn("J5VLCWQP-26-CWFT"); setuidHandler = new SetuidHandler( @@ -663,17 +664,17 @@ public void shouldSendPixelWhenFParamNotDefinedAndTypeIsRedirect() throws JsonPr public void shouldInCookieWithRequestValue() throws IOException { // given final Map uids = Map.of( - RUBICON, UidWithExpiry.live("J5VLCWQP-26-CWFT"), - ADNXS, UidWithExpiry.live("12345")); + MAGNITE_COOKIE, UidWithExpiry.live("J5VLCWQP-26-CWFT"), + APPNEXUS_COOKIE, UidWithExpiry.live("12345")); final UidsCookie uidsCookie = new UidsCookie(Uids.builder().uids(uids).build(), jacksonMapper); - final UidsCookie updatedUidsCookie = uidsCookie.updateUid(RUBICON, "updatedUid"); + final UidsCookie updatedUidsCookie = uidsCookie.updateUid(MAGNITE_COOKIE, "updatedUid"); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "updatedUid")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "updatedUid")) .willReturn(updated(updatedUidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("uid")).willReturn("updatedUid"); // when @@ -688,20 +689,20 @@ public void shouldInCookieWithRequestValue() throws IOException { public void shouldReturnMultipleCookies() { // given final Map uids = Map.of( - RUBICON, UidWithExpiry.live("J5VLCWQP-26-CWFT"), - ADNXS, UidWithExpiry.live("12345")); + MAGNITE_COOKIE, UidWithExpiry.live("J5VLCWQP-26-CWFT"), + APPNEXUS_COOKIE, UidWithExpiry.live("12345")); final UidsCookie uidsCookie = new UidsCookie(Uids.builder().uids(uids).build(), jacksonMapper); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); final UidsCookie givenUidsCookie = uidsCookie - .updateUid(RUBICON, "updatedUid") - .updateUid(ADNXS, "12345"); + .updateUid(MAGNITE_COOKIE, "updatedUid") + .updateUid(APPNEXUS_COOKIE, "12345"); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "updatedUid")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "updatedUid")) .willReturn(updated(givenUidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("uid")).willReturn("updatedUid"); // {"tempUIDs":{"adnxs":{"uid":"12345"}, "rubicon":{"uid":"updatedUid"}}} @@ -727,14 +728,14 @@ public void shouldRespondWithCookieIfUserIsNotInGdprScope() throws IOException { .willReturn(Future.succeededFuture(TcfResponse.of(false, emptyMap(), null))); final UidsCookie uidsCookie = emptyUidsCookie(); - final UidsCookie updatedUidsCookie = uidsCookie.updateUid(RUBICON, "J5VLCWQP-26-CWFT"); + final UidsCookie updatedUidsCookie = uidsCookie.updateUid(MAGNITE_COOKIE, "J5VLCWQP-26-CWFT"); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "J5VLCWQP-26-CWFT")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "J5VLCWQP-26-CWFT")) .willReturn(updated(updatedUidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("uid")).willReturn("J5VLCWQP-26-CWFT"); // when @@ -765,14 +766,14 @@ public void shouldSkipTcfChecksAndRespondWithCookieIfHostVendorIdNotDefined() th given(tcfDefinerService.getGdprHostVendorId()).willReturn(null); final UidsCookie uidsCookie = emptyUidsCookie(); - final UidsCookie updatedUidsCookie = uidsCookie.updateUid(RUBICON, "J5VLCWQP-26-CWFT"); + final UidsCookie updatedUidsCookie = uidsCookie.updateUid(MAGNITE_COOKIE, "J5VLCWQP-26-CWFT"); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "J5VLCWQP-26-CWFT")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "J5VLCWQP-26-CWFT")) .willReturn(updated(updatedUidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("uid")).willReturn("J5VLCWQP-26-CWFT"); // when @@ -790,10 +791,10 @@ public void shouldNotSendResponseIfClientClosedConnection() { final UidsCookie uidsCookie = emptyUidsCookie(); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "uid")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "uid")) .willReturn(updated(uidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("uid")).willReturn("uid"); given(routingContext.response().closed()).willReturn(true); @@ -809,15 +810,15 @@ public void shouldNotSendResponseIfClientClosedConnection() { public void shouldPassSuccessfulEventToAnalyticsReporter() { // given final UidsCookie uidsCookie = new UidsCookie( - Uids.builder().uids(singletonMap(RUBICON, UidWithExpiry.live("J5VLCWQP-26-CWFT"))).build(), + Uids.builder().uids(singletonMap(MAGNITE_COOKIE, UidWithExpiry.live("J5VLCWQP-26-CWFT"))).build(), jacksonMapper); given(uidsCookieService.parseFromRequest(any(RoutingContext.class))) .willReturn(uidsCookie); - given(uidsCookieService.updateUidsCookie(uidsCookie, RUBICON, "updatedUid")) + given(uidsCookieService.updateUidsCookie(uidsCookie, MAGNITE_COOKIE, "updatedUid")) .willReturn(updated(uidsCookie)); - given(httpRequest.getParam("bidder")).willReturn(RUBICON); + given(httpRequest.getParam("bidder")).willReturn(MAGNITE); given(httpRequest.getParam("uid")).willReturn("updatedUid"); // when @@ -827,7 +828,7 @@ public void shouldPassSuccessfulEventToAnalyticsReporter() { final SetuidEvent setuidEvent = captureSetuidEvent(); assertThat(setuidEvent).isEqualTo(SetuidEvent.builder() .status(200) - .bidder(RUBICON) + .bidder(MAGNITE_COOKIE) .uid("updatedUid") .success(true) .build()); diff --git a/src/test/java/org/prebid/server/it/ApplicationTest.java b/src/test/java/org/prebid/server/it/ApplicationTest.java index 001737f9fba..0e9c1d61864 100644 --- a/src/test/java/org/prebid/server/it/ApplicationTest.java +++ b/src/test/java/org/prebid/server/it/ApplicationTest.java @@ -66,9 +66,10 @@ public class ApplicationTest extends IntegrationTest { private static final String APPNEXUS = "appnexus"; - private static final String RUBICON = "rubicon"; + private static final String MAGNITE = "magnite"; private static final String GENERIC = "generic"; private static final String GENERIC_ALIAS = "genericAlias"; + private static final String MAGNITE_COOKIE = "rubicon"; private static final int ADMIN_PORT = 8060; @@ -295,7 +296,7 @@ public void cookieSyncShouldReturnBidderStatusWithExpectedUsersyncInfo() { final CookieSyncResponse cookieSyncResponse = given(SPEC) .cookies("host-cookie-name", "host-cookie-uid") .body(CookieSyncRequest.builder() - .bidders(Set.of(RUBICON, APPNEXUS)) + .bidders(Set.of(MAGNITE, APPNEXUS)) .gdpr(1) .gdprConsent(gdprConsent) .usPrivacy("1YNN") @@ -312,10 +313,10 @@ public void cookieSyncShouldReturnBidderStatusWithExpectedUsersyncInfo() { assertThat(cookieSyncResponse.getStatus()).isEqualTo(CookieSyncStatus.OK); assertThat(cookieSyncResponse.getBidderStatus()).containsExactlyInAnyOrder( BidderUsersyncStatus.builder() - .bidder(RUBICON) + .bidder(MAGNITE) .noCookie(true) .usersync(UsersyncInfo.of( - "http://localhost:8080/setuid?bidder=rubicon" + "http://localhost:8080/setuid?bidder=magnite" + "&gdpr=1&gdpr_consent=" + gdprConsent + "&us_privacy=1YNN" + "&gpp=" @@ -348,7 +349,7 @@ public void setuidShouldUpdateRubiconUidInUidCookie() throws IOException { .cookie("uids", "eyAidGVtcFVJRHMiOnsgInJ1Ymljb24iOnsgInVpZCI6Iko1VkxDV1FQ" + "LTI2LUNXRlQiLCAiZXhwaXJlcyI6IjIwMjMtMTItMDVUMTk6MDA6MDUuMTAzMzI5LTAzOjAwIiB9IH0gfQ==") // this constant is ok to use as long as it coincides with family name - .queryParam("bidder", RUBICON) + .queryParam("bidder", MAGNITE) .queryParam("uid", "updatedUid") .queryParam("gdpr", "1") .queryParam("gdpr_consent", "CPBCKiyPBCKiyAAAAAENA0CAAIAAAAAAACiQAaQAwAAgAgABoAAAAAA") @@ -369,9 +370,9 @@ public void setuidShouldUpdateRubiconUidInUidCookie() throws IOException { .extracting(Map::keySet) .extracting(ArrayList::new) .asList() - .containsExactly(RUBICON); - assertThat(uids.getUids().get(RUBICON).getUid()).isEqualTo("updatedUid"); - assertThat(uids.getUids().get(RUBICON).getExpires().toInstant()) + .containsExactly(MAGNITE_COOKIE); + assertThat(uids.getUids().get(MAGNITE_COOKIE).getUid()).isEqualTo("updatedUid"); + assertThat(uids.getUids().get(MAGNITE_COOKIE).getExpires().toInstant()) .isCloseTo(Instant.now().plus(14, ChronoUnit.DAYS), within(10, ChronoUnit.SECONDS)); } @@ -660,7 +661,7 @@ public void traceHandlerShouldReturn200Ok() { .param("level", "error") .param("duration", "1000") .param("account", "1001") - .param("bidderCode", "rubicon") + .param("bidderCode", MAGNITE) .post("/pbs-admin/tracelog") .then() .assertThat() diff --git a/src/test/java/org/prebid/server/it/BidAgencyTest.java b/src/test/java/org/prebid/server/it/BidGencyTest.java similarity index 53% rename from src/test/java/org/prebid/server/it/BidAgencyTest.java rename to src/test/java/org/prebid/server/it/BidGencyTest.java index 18acc48d730..310af3530d4 100644 --- a/src/test/java/org/prebid/server/it/BidAgencyTest.java +++ b/src/test/java/org/prebid/server/it/BidGencyTest.java @@ -13,23 +13,23 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static java.util.Collections.singletonList; -public class BidAgencyTest extends IntegrationTest { +public class BidGencyTest extends IntegrationTest { @Test - public void openrtb2AuctionShouldRespondWithBidsFromBidAgency() throws IOException, JSONException { + public void openrtb2AuctionShouldRespondWithBidsFromBidGency() throws IOException, JSONException { // given - WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/bidagency-exchange")) + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/bidgency-exchange")) .withRequestBody(equalToJson( - jsonFrom("openrtb2/bidagency/test-bidagency-bid-request.json"))) + jsonFrom("openrtb2/bidgency/test-bidgency-bid-request.json"))) .willReturn(aResponse().withBody( - jsonFrom("openrtb2/bidagency/test-bidagency-bid-response.json")))); + jsonFrom("openrtb2/bidgency/test-bidgency-bid-response.json")))); // when - final Response response = responseFor("openrtb2/bidagency/test-auction-bidagency-request.json", + final Response response = responseFor("openrtb2/bidgency/test-auction-bidgency-request.json", Endpoint.openrtb2_auction); // then - assertJsonEquals("openrtb2/bidagency/test-auction-bidagency-response.json", response, - singletonList("bidagency")); + assertJsonEquals("openrtb2/bidgency/test-auction-bidgency-response.json", response, + singletonList("bidgency")); } } diff --git a/src/test/java/org/prebid/server/it/RadianfusionTest.java b/src/test/java/org/prebid/server/it/RadiantfusionTest.java similarity index 54% rename from src/test/java/org/prebid/server/it/RadianfusionTest.java rename to src/test/java/org/prebid/server/it/RadiantfusionTest.java index d38369431e3..0410df61053 100644 --- a/src/test/java/org/prebid/server/it/RadianfusionTest.java +++ b/src/test/java/org/prebid/server/it/RadiantfusionTest.java @@ -13,22 +13,22 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static java.util.Collections.singletonList; -public class RadianfusionTest extends IntegrationTest { +public class RadiantfusionTest extends IntegrationTest { @Test - public void openrtb2AuctionShouldRespondWithBidsFromRadianfusion() throws IOException, JSONException { + public void openrtb2AuctionShouldRespondWithBidsFromRadiantfusion() throws IOException, JSONException { // given - WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/radianfusion-exchange")) - .withRequestBody(equalToJson(jsonFrom("openrtb2/radianfusion/test-radianfusion-bid-request.json"))) + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/radiantfusion-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/radiantfusion/test-radiantfusion-bid-request.json"))) .willReturn(aResponse().withBody( - jsonFrom("openrtb2/radianfusion/test-radianfusion-bid-response.json")))); + jsonFrom("openrtb2/radiantfusion/test-radiantfusion-bid-response.json")))); // when - final Response response = responseFor("openrtb2/radianfusion/test-auction-radianfusion-request.json", + final Response response = responseFor("openrtb2/radiantfusion/test-auction-radiantfusion-request.json", Endpoint.openrtb2_auction); // then - assertJsonEquals("openrtb2/radianfusion/test-auction-radianfusion-response.json", - response, singletonList("radianfusion")); + assertJsonEquals("openrtb2/radiantfusion/test-auction-radiantfusion-response.json", + response, singletonList("radiantfusion")); } } diff --git a/src/test/java/org/prebid/server/log/CriteriaManagerTest.java b/src/test/java/org/prebid/server/log/CriteriaManagerTest.java index 0ddf1ded8bc..21e82e353be 100644 --- a/src/test/java/org/prebid/server/log/CriteriaManagerTest.java +++ b/src/test/java/org/prebid/server/log/CriteriaManagerTest.java @@ -31,14 +31,14 @@ public void setUp() { @Test public void addCriteriaShouldThrowIllegalArgumentExceptionWhenLoggerLevelHasInvalidValue() { assertThatIllegalArgumentException() - .isThrownBy(() -> criteriaManager.addCriteria("1001", "rubicon", "invalid", 800)) + .isThrownBy(() -> criteriaManager.addCriteria("1001", "magnite", "invalid", 800)) .withMessage("Invalid LoggingLevel: invalid"); } @Test public void addCriteriaShouldAddVertxTimerWithLimitedDurationInMillis() { // given and when - criteriaManager.addCriteria("1001", "rubicon", "error", 800000); + criteriaManager.addCriteria("1001", "magnite", "error", 800000); // then verify(vertx).setTimer(eq(300000L), any()); @@ -47,7 +47,7 @@ public void addCriteriaShouldAddVertxTimerWithLimitedDurationInMillis() { @Test public void addCriteriaShouldAddVertxTimerWithDefaultDurationInMillis() { // given and when - criteriaManager.addCriteria("1001", "rubicon", "error", 200000); + criteriaManager.addCriteria("1001", "magnite", "error", 200000); // then verify(vertx).setTimer(eq(200000L), any()); diff --git a/src/test/java/org/prebid/server/metric/CookieSyncMetricsTest.java b/src/test/java/org/prebid/server/metric/CookieSyncMetricsTest.java index a869c27f5b0..8091a1f72d1 100644 --- a/src/test/java/org/prebid/server/metric/CookieSyncMetricsTest.java +++ b/src/test/java/org/prebid/server/metric/CookieSyncMetricsTest.java @@ -13,6 +13,6 @@ public void forBidderShouldReturnSameBidderCookieSyncMetricsOnSuccessiveCalls() final CookieSyncMetrics cookieSyncMetrics = new CookieSyncMetrics(new MetricRegistry(), CounterType.counter); // when and then - assertThat(cookieSyncMetrics.forBidder("rubicon")).isSameAs(cookieSyncMetrics.forBidder("rubicon")); + assertThat(cookieSyncMetrics.forBidder("magnite")).isSameAs(cookieSyncMetrics.forBidder("magnite")); } } diff --git a/src/test/java/org/prebid/server/metric/MetricsTest.java b/src/test/java/org/prebid/server/metric/MetricsTest.java index eb0af781a7d..0eed97eab2d 100644 --- a/src/test/java/org/prebid/server/metric/MetricsTest.java +++ b/src/test/java/org/prebid/server/metric/MetricsTest.java @@ -45,7 +45,7 @@ @ExtendWith(MockitoExtension.class) public class MetricsTest { - private static final String RUBICON = "rubicon"; + private static final String MAGNITE = "magnite"; private static final String CONVERSANT = "conversant"; private static final String ACCOUNT_ID = "accountId"; private static final String ACCOUNT_ID_1 = "accountId1"; @@ -94,34 +94,34 @@ public void forAccountShouldReturnAccountMetricsConfiguredWithAccount() { @Test public void forAdapterShouldReturnSameAdapterMetricsOnSuccessiveCalls() { - assertThat(metrics.forAdapter(RUBICON)).isSameAs(metrics.forAdapter(RUBICON)); + assertThat(metrics.forAdapter(MAGNITE)).isSameAs(metrics.forAdapter(MAGNITE)); } @Test public void forAdapterShouldReturnAdapterMetricsConfiguredWithCounterType() { verifyCreatesConfiguredCounterType( - metrics -> metrics.forAdapter(RUBICON).incCounter(MetricName.bids_received)); + metrics -> metrics.forAdapter(MAGNITE).incCounter(MetricName.bids_received)); } @Test public void forAdapterShouldReturnAdapterMetricsConfiguredWithAdapterType() { // when - metrics.forAdapter(RUBICON).incCounter(MetricName.bids_received); + metrics.forAdapter(MAGNITE).incCounter(MetricName.bids_received); // then - assertThat(metricRegistry.counter("adapter.rubicon.bids_received").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.bids_received").getCount()).isOne(); } @Test public void shouldReturnSameAdapterRequestTypeMetricsOnSuccessiveCalls() { - assertThat(metrics.forAdapter(RUBICON).requestType(MetricName.amp)) - .isSameAs(metrics.forAdapter(RUBICON).requestType(MetricName.amp)); + assertThat(metrics.forAdapter(MAGNITE).requestType(MetricName.amp)) + .isSameAs(metrics.forAdapter(MAGNITE).requestType(MetricName.amp)); } @Test public void shouldReturnAdapterRequestTypeMetricsConfiguredWithCounterType() { verifyCreatesConfiguredCounterType(metrics -> metrics - .forAdapter(RUBICON) + .forAdapter(MAGNITE) .requestType(MetricName.openrtb2app) .incCounter(MetricName.requests)); } @@ -129,22 +129,22 @@ public void shouldReturnAdapterRequestTypeMetricsConfiguredWithCounterType() { @Test public void shouldReturnAdapterRequestTypeMetricsConfiguredWithAdapterType() { // when - metrics.forAdapter(RUBICON).requestType(MetricName.openrtb2web).incCounter(MetricName.requests); + metrics.forAdapter(MAGNITE).requestType(MetricName.openrtb2web).incCounter(MetricName.requests); // then - assertThat(metricRegistry.counter("adapter.rubicon.requests.type.openrtb2-web").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.requests.type.openrtb2-web").getCount()).isOne(); } @Test public void shouldReturnSameAdapterRequestMetricsOnSuccessiveCalls() { - assertThat(metrics.forAdapter(RUBICON).request()) - .isSameAs(metrics.forAdapter(RUBICON).request()); + assertThat(metrics.forAdapter(MAGNITE).request()) + .isSameAs(metrics.forAdapter(MAGNITE).request()); } @Test public void shouldReturnAdapterRequestMetricsConfiguredWithCounterType() { verifyCreatesConfiguredCounterType(metrics -> metrics - .forAdapter(RUBICON) + .forAdapter(MAGNITE) .request() .incCounter(MetricName.gotbids)); } @@ -152,16 +152,16 @@ public void shouldReturnAdapterRequestMetricsConfiguredWithCounterType() { @Test public void shouldReturnAdapterRequestMetricsConfiguredWithAdapterType() { // when - metrics.forAdapter(RUBICON).request().incCounter(MetricName.gotbids); + metrics.forAdapter(MAGNITE).request().incCounter(MetricName.gotbids); // then - assertThat(metricRegistry.counter("adapter.rubicon.requests.gotbids").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.requests.gotbids").getCount()).isOne(); } @Test public void shouldReturnSameAccountAdapterMetricsOnSuccessiveCalls() { - assertThat(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter("rUbIcOn")) - .isSameAs(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON)); + assertThat(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter("mAgNiTe")) + .isSameAs(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(MAGNITE)); } @Test @@ -169,23 +169,23 @@ public void shouldReturnAccountAdapterMetricsConfiguredWithCounterType() { verifyCreatesConfiguredCounterType(metrics -> metrics .forAccount(ACCOUNT_ID) .adapter() - .forAdapter(RUBICON) + .forAdapter(MAGNITE) .incCounter(MetricName.bids_received)); } @Test public void shouldReturnAccountAdapterMetricsConfiguredWithAccountAndAdapterType() { // when - metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON).incCounter(MetricName.bids_received); + metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(MAGNITE).incCounter(MetricName.bids_received); // then - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.bids_received").getCount()).isOne(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.bids_received").getCount()).isOne(); } @Test public void shouldReturnSameAccountAdapterRequestMetricsOnSuccessiveCalls() { - assertThat(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON).request()) - .isSameAs(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON).request()); + assertThat(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(MAGNITE).request()) + .isSameAs(metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(MAGNITE).request()); } @Test @@ -193,7 +193,7 @@ public void shouldReturnAccountAdapterRequestMetricsConfiguredWithCounterType() verifyCreatesConfiguredCounterType(metrics -> metrics .forAccount(ACCOUNT_ID) .adapter() - .forAdapter(RUBICON) + .forAdapter(MAGNITE) .request() .incCounter(MetricName.gotbids)); } @@ -201,10 +201,10 @@ public void shouldReturnAccountAdapterRequestMetricsConfiguredWithCounterType() @Test public void shouldReturnAccountAdapterRequestMetricsConfiguredWithAccountAndAdapterType() { // when - metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(RUBICON).request().incCounter(MetricName.gotbids); + metrics.forAccount(ACCOUNT_ID).adapter().forAdapter(MAGNITE).request().incCounter(MetricName.gotbids); // then - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.gotbids").getCount()) + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.gotbids").getCount()) .isOne(); } @@ -253,24 +253,24 @@ public void userSyncShouldReturnUserSyncMetricsConfiguredWithPrefix() { @Test public void shouldReturnSameBidderUserSyncMetricsOnSuccessiveCalls() { - assertThat(metrics.userSync().forBidder(RUBICON)).isSameAs(metrics.userSync().forBidder(RUBICON)); + assertThat(metrics.userSync().forBidder(MAGNITE)).isSameAs(metrics.userSync().forBidder(MAGNITE)); } @Test public void shouldReturnBidderUserSyncMetricsConfiguredWithCounterType() { verifyCreatesConfiguredCounterType(metrics -> metrics .userSync() - .forBidder(RUBICON) + .forBidder(MAGNITE) .incCounter(MetricName.sets)); } @Test public void shouldReturnBidderUserSyncMetricsConfiguredWithBidder() { // when - metrics.userSync().forBidder(RUBICON).incCounter(MetricName.sets); + metrics.userSync().forBidder(MAGNITE).incCounter(MetricName.sets); // then - assertThat(metricRegistry.counter("usersync.rubicon.sets").getCount()).isOne(); + assertThat(metricRegistry.counter("usersync.magnite.sets").getCount()).isOne(); } @Test @@ -280,7 +280,7 @@ public void cookieSyncShouldReturnSameCookieSyncMetricsOnSuccessiveCalls() { @Test public void shouldReturnSameBidderCookieSyncMetricsOnSuccessiveCalls() { - assertThat(metrics.cookieSync().forBidder(RUBICON)).isSameAs(metrics.cookieSync().forBidder(RUBICON)); + assertThat(metrics.cookieSync().forBidder(MAGNITE)).isSameAs(metrics.cookieSync().forBidder(MAGNITE)); } @Test @@ -461,13 +461,13 @@ public void updateAccountDebugRequestMetricsShouldIncrementMetrics() { public void updateAdapterRequestTypeAndNoCookieMetricsShouldUpdateMetricsAsExpected() { // when - metrics.updateAdapterRequestTypeAndNoCookieMetrics("rUbIcON", MetricName.openrtb2app, true); - metrics.updateAdapterRequestTypeAndNoCookieMetrics(RUBICON, MetricName.amp, false); + metrics.updateAdapterRequestTypeAndNoCookieMetrics("mAgNiTe", MetricName.openrtb2app, true); + metrics.updateAdapterRequestTypeAndNoCookieMetrics(MAGNITE, MetricName.amp, false); // then - assertThat(metricRegistry.counter("adapter.rubicon.requests.type.openrtb2-app").getCount()).isEqualTo(1); - assertThat(metricRegistry.counter("adapter.rubicon.no_cookie_requests").getCount()).isOne(); - assertThat(metricRegistry.counter("adapter.rubicon.requests.type.amp").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.requests.type.openrtb2-app").getCount()).isEqualTo(1); + assertThat(metricRegistry.counter("adapter.magnite.no_cookie_requests").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.requests.type.amp").getCount()).isOne(); } @Test @@ -537,13 +537,13 @@ public void updateAlertsConfigMetricsShouldCreateMetricsAsExpected() { @Test public void updateAdapterResponseTimeShouldUpdateMetrics() { // when - metrics.updateAdapterResponseTime(RUBICON, Account.empty(ACCOUNT_ID), 500); + metrics.updateAdapterResponseTime(MAGNITE, Account.empty(ACCOUNT_ID), 500); metrics.updateAdapterResponseTime(CONVERSANT, Account.empty(ACCOUNT_ID), 500); metrics.updateAdapterResponseTime(CONVERSANT, Account.empty(ACCOUNT_ID), 500); // then - assertThat(metricRegistry.timer("adapter.rubicon.request_time").getCount()).isOne(); - assertThat(metricRegistry.timer("account.accountId.adapter.rubicon.request_time").getCount()).isOne(); + assertThat(metricRegistry.timer("adapter.magnite.request_time").getCount()).isOne(); + assertThat(metricRegistry.timer("account.accountId.adapter.magnite.request_time").getCount()).isOne(); assertThat(metricRegistry.timer("adapter.conversant.request_time").getCount()).isEqualTo(2); assertThat(metricRegistry.timer("account.accountId.adapter.conversant.request_time").getCount()).isEqualTo(2); } @@ -551,15 +551,15 @@ public void updateAdapterResponseTimeShouldUpdateMetrics() { @Test public void updateAdapterRequestBuyerUidScrubbedMetricsShouldIncrementMetrics() { // when - metrics.updateAdapterRequestBuyerUidScrubbedMetrics(RUBICON, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterRequestBuyerUidScrubbedMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); metrics.updateAdapterRequestBuyerUidScrubbedMetrics(CONVERSANT, Account.empty(ACCOUNT_ID)); metrics.updateAdapterRequestBuyerUidScrubbedMetrics(CONVERSANT, Account.empty(ACCOUNT_ID)); // then - assertThat(metricRegistry.counter("adapter.rubicon.requests.buyeruid_scrubbed") + assertThat(metricRegistry.counter("adapter.magnite.requests.buyeruid_scrubbed") .getCount()) .isOne(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.buyeruid_scrubbed") + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.buyeruid_scrubbed") .getCount()) .isOne(); assertThat(metricRegistry.counter("adapter.conversant.requests.buyeruid_scrubbed") @@ -573,13 +573,13 @@ public void updateAdapterRequestBuyerUidScrubbedMetricsShouldIncrementMetrics() @Test public void updateAdapterRequestNobidMetricsShouldIncrementMetrics() { // when - metrics.updateAdapterRequestNobidMetrics(RUBICON, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterRequestNobidMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); metrics.updateAdapterRequestNobidMetrics(CONVERSANT, Account.empty(ACCOUNT_ID)); metrics.updateAdapterRequestNobidMetrics(CONVERSANT, Account.empty(ACCOUNT_ID)); // then - assertThat(metricRegistry.counter("adapter.rubicon.requests.nobid").getCount()).isOne(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.nobid").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.requests.nobid").getCount()).isOne(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.nobid").getCount()).isOne(); assertThat(metricRegistry.counter("adapter.conversant.requests.nobid").getCount()).isEqualTo(2); assertThat(metricRegistry.counter("account.accountId.adapter.conversant.requests.nobid").getCount()) .isEqualTo(2); @@ -588,13 +588,13 @@ public void updateAdapterRequestNobidMetricsShouldIncrementMetrics() { @Test public void updateAdapterRequestGotbidsMetricsShouldIncrementMetrics() { // when - metrics.updateAdapterRequestGotbidsMetrics(RUBICON, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterRequestGotbidsMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); metrics.updateAdapterRequestGotbidsMetrics(CONVERSANT, Account.empty(ACCOUNT_ID)); metrics.updateAdapterRequestGotbidsMetrics(CONVERSANT, Account.empty(ACCOUNT_ID)); // then - assertThat(metricRegistry.counter("adapter.rubicon.requests.gotbids").getCount()).isOne(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.gotbids").getCount()) + assertThat(metricRegistry.counter("adapter.magnite.requests.gotbids").getCount()).isOne(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.gotbids").getCount()) .isOne(); assertThat(metricRegistry.counter("adapter.conversant.requests.gotbids").getCount()).isEqualTo(2); assertThat(metricRegistry.counter("account.accountId.adapter.conversant.requests.gotbids").getCount()) @@ -604,18 +604,18 @@ public void updateAdapterRequestGotbidsMetricsShouldIncrementMetrics() { @Test public void updateAdapterBidMetricsShouldUpdateMetrics() { // when - metrics.updateAdapterBidMetrics(RUBICON, Account.empty(ACCOUNT_ID), 1234L, true, "banner"); - metrics.updateAdapterBidMetrics(RUBICON, Account.empty(ACCOUNT_ID), 1234L, false, "video"); + metrics.updateAdapterBidMetrics(MAGNITE, Account.empty(ACCOUNT_ID), 1234L, true, "banner"); + metrics.updateAdapterBidMetrics(MAGNITE, Account.empty(ACCOUNT_ID), 1234L, false, "video"); metrics.updateAdapterBidMetrics(CONVERSANT, Account.empty(ACCOUNT_ID), 1234L, false, "banner"); metrics.updateAdapterBidMetrics(CONVERSANT, Account.empty(ACCOUNT_ID), 1234L, false, "banner"); // then - assertThat(metricRegistry.histogram("adapter.rubicon.prices").getCount()).isEqualTo(2); - assertThat(metricRegistry.histogram("account.accountId.adapter.rubicon.prices").getCount()).isEqualTo(2); - assertThat(metricRegistry.counter("adapter.rubicon.bids_received").getCount()).isEqualTo(2); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.bids_received").getCount()).isEqualTo(2); - assertThat(metricRegistry.counter("adapter.rubicon.banner.adm_bids_received").getCount()).isOne(); - assertThat(metricRegistry.counter("adapter.rubicon.video.nurl_bids_received").getCount()).isOne(); + assertThat(metricRegistry.histogram("adapter.magnite.prices").getCount()).isEqualTo(2); + assertThat(metricRegistry.histogram("account.accountId.adapter.magnite.prices").getCount()).isEqualTo(2); + assertThat(metricRegistry.counter("adapter.magnite.bids_received").getCount()).isEqualTo(2); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.bids_received").getCount()).isEqualTo(2); + assertThat(metricRegistry.counter("adapter.magnite.banner.adm_bids_received").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.video.nurl_bids_received").getCount()).isOne(); assertThat(metricRegistry.histogram("adapter.conversant.prices").getCount()).isEqualTo(2); assertThat(metricRegistry.histogram("account.accountId.adapter.conversant.prices").getCount()).isEqualTo(2); assertThat(metricRegistry.counter("adapter.conversant.bids_received").getCount()).isEqualTo(2); @@ -658,23 +658,23 @@ public void updateDisabledBidderMetricsShouldIncrementMetrics() { @Test public void updateAdapterRequestErrorMetricShouldIncrementMetrics() { // when - metrics.updateAdapterRequestErrorMetric(RUBICON, MetricName.badinput); + metrics.updateAdapterRequestErrorMetric(MAGNITE, MetricName.badinput); metrics.updateAdapterRequestErrorMetric(CONVERSANT, MetricName.badinput); metrics.updateAdapterRequestErrorMetric(CONVERSANT, MetricName.badinput); // then - assertThat(metricRegistry.counter("adapter.rubicon.requests.badinput").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.requests.badinput").getCount()).isOne(); assertThat(metricRegistry.counter("adapter.conversant.requests.badinput").getCount()).isEqualTo(2); } @Test public void updateSizeValidationMetricsShouldIncrementMetrics() { // when - metrics.updateSizeValidationMetrics(RUBICON, ACCOUNT_ID, MetricName.err); + metrics.updateSizeValidationMetrics(MAGNITE, ACCOUNT_ID, MetricName.err); metrics.updateSizeValidationMetrics(CONVERSANT, ACCOUNT_ID, MetricName.err); // then - assertThat(metricRegistry.counter("adapter.rubicon.response.validation.size.err").getCount()).isEqualTo(1); + assertThat(metricRegistry.counter("adapter.magnite.response.validation.size.err").getCount()).isEqualTo(1); assertThat(metricRegistry.counter("adapter.conversant.response.validation.size.err").getCount()).isEqualTo(1); assertThat(metricRegistry.counter("account.accountId.response.validation.size.err").getCount()).isEqualTo(2); } @@ -682,11 +682,11 @@ public void updateSizeValidationMetricsShouldIncrementMetrics() { @Test public void updateSecureValidationMetricsShouldIncrementMetrics() { // when - metrics.updateSecureValidationMetrics(RUBICON, ACCOUNT_ID, MetricName.err); + metrics.updateSecureValidationMetrics(MAGNITE, ACCOUNT_ID, MetricName.err); metrics.updateSecureValidationMetrics(CONVERSANT, ACCOUNT_ID, MetricName.err); // then - assertThat(metricRegistry.counter("adapter.rubicon.response.validation.secure.err").getCount()).isEqualTo(1); + assertThat(metricRegistry.counter("adapter.magnite.response.validation.secure.err").getCount()).isEqualTo(1); assertThat(metricRegistry.counter("adapter.conversant.response.validation.secure.err").getCount()).isEqualTo(1); assertThat(metricRegistry.counter("account.accountId.response.validation.secure.err").getCount()).isEqualTo(2); } @@ -694,11 +694,11 @@ public void updateSecureValidationMetricsShouldIncrementMetrics() { @Test public void updateSeatValidationMetricsShouldIncrementMetrics() { // when - metrics.updateSeatValidationMetrics(RUBICON); + metrics.updateSeatValidationMetrics(MAGNITE); metrics.updateSeatValidationMetrics(CONVERSANT); // then - assertThat(metricRegistry.counter("adapter.rubicon.response.validation.seat").getCount()).isEqualTo(1); + assertThat(metricRegistry.counter("adapter.magnite.response.validation.seat").getCount()).isEqualTo(1); assertThat(metricRegistry.counter("adapter.conversant.response.validation.seat").getCount()).isEqualTo(1); } @@ -732,42 +732,42 @@ public void updateUserSyncBadRequestMetricShouldIncrementMetric() { @Test public void updateUserSyncSetsMetricShouldIncrementMetric() { // when - metrics.updateUserSyncSetsMetric("RUBICON"); + metrics.updateUserSyncSetsMetric("MAGNITE"); // then - assertThat(metricRegistry.counter("usersync.rubicon.sets").getCount()).isOne(); + assertThat(metricRegistry.counter("usersync.magnite.sets").getCount()).isOne(); } @Test public void updateUserSyncTcfBlockedMetricShouldIncrementMetric() { // when - metrics.updateUserSyncTcfBlockedMetric(RUBICON); + metrics.updateUserSyncTcfBlockedMetric(MAGNITE); // then - assertThat(metricRegistry.counter("usersync.rubicon.tcf.blocked").getCount()).isOne(); + assertThat(metricRegistry.counter("usersync.magnite.tcf.blocked").getCount()).isOne(); } @Test public void updateCookieSyncTcfBlockedMetricShouldIncrementMetric() { // when - metrics.updateCookieSyncTcfBlockedMetric(RUBICON); + metrics.updateCookieSyncTcfBlockedMetric(MAGNITE); metrics.updateCookieSyncTcfBlockedMetric(CONVERSANT); metrics.updateCookieSyncTcfBlockedMetric(CONVERSANT); // then - assertThat(metricRegistry.counter("cookie_sync.rubicon.tcf.blocked").getCount()).isOne(); + assertThat(metricRegistry.counter("cookie_sync.magnite.tcf.blocked").getCount()).isOne(); assertThat(metricRegistry.counter("cookie_sync.conversant.tcf.blocked").getCount()).isEqualTo(2); } @Test public void updateCookieSyncFilteredMetricShouldIncrementMetric() { // when - metrics.updateCookieSyncFilteredMetric(RUBICON); + metrics.updateCookieSyncFilteredMetric(MAGNITE); metrics.updateCookieSyncFilteredMetric("CONVERSANT"); metrics.updateCookieSyncFilteredMetric(CONVERSANT); // then - assertThat(metricRegistry.counter("cookie_sync.rubicon.filtered").getCount()).isOne(); + assertThat(metricRegistry.counter("cookie_sync.magnite.filtered").getCount()).isOne(); assertThat(metricRegistry.counter("cookie_sync.conversant.filtered").getCount()).isEqualTo(2); } @@ -776,7 +776,7 @@ public void updateAuctionTcfMetricsShouldIncrementMetrics() { // when metrics.updateAuctionTcfAndLmtMetrics( activityInfrastructure, - RUBICON, + MAGNITE, MetricName.openrtb2web, true, true, true, true, true, false); metrics.updateAuctionTcfAndLmtMetrics( @@ -791,11 +791,11 @@ public void updateAuctionTcfMetricsShouldIncrementMetrics() { false, true, false, true, false, false); // then - assertThat(metricRegistry.counter("adapter.rubicon.openrtb2-web.tcf.userfpd_masked").getCount()).isOne(); - assertThat(metricRegistry.counter("adapter.rubicon.openrtb2-web.tcf.userid_removed").getCount()).isOne(); - assertThat(metricRegistry.counter("adapter.rubicon.openrtb2-web.tcf.geo_masked").getCount()).isOne(); - assertThat(metricRegistry.counter("adapter.rubicon.openrtb2-web.tcf.analytics_blocked").getCount()).isOne(); - assertThat(metricRegistry.counter("adapter.rubicon.openrtb2-web.tcf.request_blocked").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.openrtb2-web.tcf.userfpd_masked").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.openrtb2-web.tcf.userid_removed").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.openrtb2-web.tcf.geo_masked").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.openrtb2-web.tcf.analytics_blocked").getCount()).isOne(); + assertThat(metricRegistry.counter("adapter.magnite.openrtb2-web.tcf.request_blocked").getCount()).isOne(); assertThat(metricRegistry.counter("adapter.conversant.openrtb2-web.tcf.userfpd_masked").getCount()).isOne(); assertThat(metricRegistry.counter("adapter.conversant.openrtb2-app.tcf.userid_removed").getCount()).isOne(); assertThat(metricRegistry.counter("adapter.conversant.openrtb2-web.tcf.geo_masked").getCount()).isOne(); @@ -808,12 +808,12 @@ public void updateAuctionTcfMetricsShouldUpdateTransitUfpdActivityMetricWhenUser // when metrics.updateAuctionTcfAndLmtMetrics( activityInfrastructure, - RUBICON, + MAGNITE, MetricName.openrtb2web, true, false, false, false, false, false); // then - verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_UFPD, ComponentType.BIDDER, RUBICON); + verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_UFPD, ComponentType.BIDDER, MAGNITE); verifyNoMoreInteractions(activityInfrastructure); } @@ -822,12 +822,12 @@ public void updateAuctionTcfMetricsShouldUpdateTransitGeoActivityMetricWhenGeoMa // when metrics.updateAuctionTcfAndLmtMetrics( activityInfrastructure, - RUBICON, + MAGNITE, MetricName.openrtb2web, false, false, true, false, false, false); // then - verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_GEO, ComponentType.BIDDER, RUBICON); + verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_GEO, ComponentType.BIDDER, MAGNITE); verifyNoMoreInteractions(activityInfrastructure); } @@ -836,12 +836,12 @@ public void updateAuctionTcfMetricsShouldUpdateTransitEidsActivityMetricWhenGeoM // when metrics.updateAuctionTcfAndLmtMetrics( activityInfrastructure, - RUBICON, + MAGNITE, MetricName.openrtb2web, false, true, false, false, false, false); // then - verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_EIDS, ComponentType.BIDDER, RUBICON); + verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_EIDS, ComponentType.BIDDER, MAGNITE); verifyNoMoreInteractions(activityInfrastructure); } @@ -850,12 +850,12 @@ public void updateAuctionTcfMetricsShouldUpdateCallBidderActivityMetricWhenReque // when metrics.updateAuctionTcfAndLmtMetrics( activityInfrastructure, - RUBICON, + MAGNITE, MetricName.openrtb2web, false, false, false, false, true, false); // then - verify(activityInfrastructure).updateActivityMetrics(Activity.CALL_BIDDER, ComponentType.BIDDER, RUBICON); + verify(activityInfrastructure).updateActivityMetrics(Activity.CALL_BIDDER, ComponentType.BIDDER, MAGNITE); verifyNoMoreInteractions(activityInfrastructure); } @@ -864,14 +864,14 @@ public void updateAuctionTcfMetricsShouldUpdateTransmitUfpdEidsAndGeoActivityMet // when metrics.updateAuctionTcfAndLmtMetrics( activityInfrastructure, - RUBICON, + MAGNITE, MetricName.openrtb2web, false, false, false, false, false, true); // then - verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_EIDS, ComponentType.BIDDER, RUBICON); - verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_GEO, ComponentType.BIDDER, RUBICON); - verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_UFPD, ComponentType.BIDDER, RUBICON); + verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_EIDS, ComponentType.BIDDER, MAGNITE); + verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_GEO, ComponentType.BIDDER, MAGNITE); + verify(activityInfrastructure).updateActivityMetrics(Activity.TRANSMIT_UFPD, ComponentType.BIDDER, MAGNITE); verifyNoMoreInteractions(activityInfrastructure); } @@ -910,7 +910,7 @@ public void updatePrivacyLmtMetricShouldIncrementMetric() { // when metrics.updateAuctionTcfAndLmtMetrics( activityInfrastructure, - RUBICON, + MAGNITE, MetricName.openrtb2web, false, false, false, false, false, true); @@ -1031,10 +1031,10 @@ public void shouldNotUpdateAccountMetricsIfVerbosityIsNone() { metrics.updateAccountDebugRequestMetrics(Account.empty(ACCOUNT_ID), false); metrics.updateAccountDebugRequestMetrics(Account.empty(ACCOUNT_ID), true); metrics.updateAccountRequestMetrics(Account.empty(ACCOUNT_ID), MetricName.openrtb2web); - metrics.updateAdapterResponseTime(RUBICON, Account.empty(ACCOUNT_ID), 500); - metrics.updateAdapterRequestNobidMetrics(RUBICON, Account.empty(ACCOUNT_ID)); - metrics.updateAdapterRequestGotbidsMetrics(RUBICON, Account.empty(ACCOUNT_ID)); - metrics.updateAdapterBidMetrics(RUBICON, Account.empty(ACCOUNT_ID), 1234L, true, "banner"); + metrics.updateAdapterResponseTime(MAGNITE, Account.empty(ACCOUNT_ID), 500); + metrics.updateAdapterRequestNobidMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterRequestGotbidsMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterBidMetrics(MAGNITE, Account.empty(ACCOUNT_ID), 1234L, true, "banner"); metrics.updateDisabledBidderMetric(Account.empty(ACCOUNT_ID)); metrics.updateUnknownBidderMetric(Account.empty(ACCOUNT_ID)); @@ -1042,15 +1042,15 @@ public void shouldNotUpdateAccountMetricsIfVerbosityIsNone() { assertThat(metricRegistry.counter("account.accountId.requests").getCount()).isZero(); assertThat(metricRegistry.counter("account.accountId.debug_requests").getCount()).isZero(); assertThat(metricRegistry.counter("account.accountId.requests.type.openrtb2-web").getCount()).isZero(); - assertThat(metricRegistry.timer("account.accountId.adapter.rubicon.request_time").getCount()).isZero(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.nobid").getCount()).isZero(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.gotbids").getCount()).isZero(); - assertThat(metricRegistry.histogram("account.accountId.adapter.rubicon.prices").getCount()).isZero(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.bids_received").getCount()).isZero(); + assertThat(metricRegistry.timer("account.accountId.adapter.magnite.request_time").getCount()).isZero(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.nobid").getCount()).isZero(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.gotbids").getCount()).isZero(); + assertThat(metricRegistry.histogram("account.accountId.adapter.magnite.prices").getCount()).isZero(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.bids_received").getCount()).isZero(); assertThat(metricRegistry.counter( - "account.accountId.adapter.rubicon.requests.unknown_bidder").getCount()).isZero(); + "account.accountId.adapter.magnite.requests.unknown_bidder").getCount()).isZero(); assertThat(metricRegistry.counter( - "account.accountId.adapter.rubicon.requests.disabled_bidder").getCount()).isZero(); + "account.accountId.adapter.magnite.requests.disabled_bidder").getCount()).isZero(); } @Test @@ -1062,10 +1062,10 @@ public void shouldUpdateAccountRequestsMetricOnlyIfVerbosityIsBasic() { metrics.updateAccountRequestMetrics(Account.empty(ACCOUNT_ID), MetricName.openrtb2web); metrics.updateAccountDebugRequestMetrics(Account.empty(ACCOUNT_ID), false); metrics.updateAccountDebugRequestMetrics(Account.empty(ACCOUNT_ID), true); - metrics.updateAdapterResponseTime(RUBICON, Account.empty(ACCOUNT_ID), 500); - metrics.updateAdapterRequestNobidMetrics(RUBICON, Account.empty(ACCOUNT_ID)); - metrics.updateAdapterRequestGotbidsMetrics(RUBICON, Account.empty(ACCOUNT_ID)); - metrics.updateAdapterBidMetrics(RUBICON, Account.empty(ACCOUNT_ID), 1234L, true, "banner"); + metrics.updateAdapterResponseTime(MAGNITE, Account.empty(ACCOUNT_ID), 500); + metrics.updateAdapterRequestNobidMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterRequestGotbidsMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterBidMetrics(MAGNITE, Account.empty(ACCOUNT_ID), 1234L, true, "banner"); metrics.updateDisabledBidderMetric(Account.empty(ACCOUNT_ID)); metrics.updateUnknownBidderMetric(Account.empty(ACCOUNT_ID)); @@ -1073,15 +1073,15 @@ public void shouldUpdateAccountRequestsMetricOnlyIfVerbosityIsBasic() { assertThat(metricRegistry.counter("account.accountId.requests").getCount()).isOne(); assertThat(metricRegistry.counter("account.accountId.debug_requests").getCount()).isZero(); assertThat(metricRegistry.counter("account.accountId.requests.type.openrtb2-web").getCount()).isZero(); - assertThat(metricRegistry.timer("account.accountId.rubicon.request_time").getCount()).isZero(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.nobid").getCount()).isZero(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.gotbids").getCount()).isZero(); - assertThat(metricRegistry.histogram("account.accountId.adapter.rubicon.prices").getCount()).isZero(); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.bids_received").getCount()).isZero(); + assertThat(metricRegistry.timer("account.accountId.magnite.request_time").getCount()).isZero(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.nobid").getCount()).isZero(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.gotbids").getCount()).isZero(); + assertThat(metricRegistry.histogram("account.accountId.adapter.magnite.prices").getCount()).isZero(); + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.bids_received").getCount()).isZero(); assertThat(metricRegistry.counter( - "account.accountId.adapter.rubicon.requests.unknown_bidder").getCount()).isZero(); + "account.accountId.adapter.magnite.requests.unknown_bidder").getCount()).isZero(); assertThat(metricRegistry.counter( - "account.accountId.adapter.rubicon.requests.disabled_bidder").getCount()).isZero(); + "account.accountId.adapter.magnite.requests.disabled_bidder").getCount()).isZero(); } @Test @@ -1093,10 +1093,10 @@ public void shouldUpdateAccountRequestsMetricOnlyIfVerbosityIsDetailed() { metrics.updateAccountRequestMetrics(Account.empty(ACCOUNT_ID), MetricName.openrtb2web); metrics.updateAccountDebugRequestMetrics(Account.empty(ACCOUNT_ID), false); metrics.updateAccountDebugRequestMetrics(Account.empty(ACCOUNT_ID), true); - metrics.updateAdapterResponseTime(RUBICON, Account.empty(ACCOUNT_ID), 500); - metrics.updateAdapterRequestNobidMetrics(RUBICON, Account.empty(ACCOUNT_ID)); - metrics.updateAdapterRequestGotbidsMetrics(RUBICON, Account.empty(ACCOUNT_ID)); - metrics.updateAdapterBidMetrics(RUBICON, Account.empty(ACCOUNT_ID), 1234L, true, "banner"); + metrics.updateAdapterResponseTime(MAGNITE, Account.empty(ACCOUNT_ID), 500); + metrics.updateAdapterRequestNobidMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterRequestGotbidsMetrics(MAGNITE, Account.empty(ACCOUNT_ID)); + metrics.updateAdapterBidMetrics(MAGNITE, Account.empty(ACCOUNT_ID), 1234L, true, "banner"); metrics.updateDisabledBidderMetric(Account.empty(ACCOUNT_ID)); metrics.updateUnknownBidderMetric(Account.empty(ACCOUNT_ID)); @@ -1106,13 +1106,13 @@ public void shouldUpdateAccountRequestsMetricOnlyIfVerbosityIsDetailed() { .isEqualTo(1); assertThat(metricRegistry.counter("account.accountId.requests.type.openrtb2-web").getCount()) .isEqualTo(1); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.nobid").getCount()) + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.nobid").getCount()) .isEqualTo(1); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.requests.gotbids").getCount()) + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.requests.gotbids").getCount()) .isEqualTo(1); - assertThat(metricRegistry.histogram("account.accountId.adapter.rubicon.prices").getCount()) + assertThat(metricRegistry.histogram("account.accountId.adapter.magnite.prices").getCount()) .isEqualTo(1); - assertThat(metricRegistry.counter("account.accountId.adapter.rubicon.bids_received").getCount()) + assertThat(metricRegistry.counter("account.accountId.adapter.magnite.bids_received").getCount()) .isEqualTo(1); assertThat(metricRegistry.counter( "unknown_bidder").getCount()).isEqualTo(1); diff --git a/src/test/java/org/prebid/server/metric/UserSyncMetricsTest.java b/src/test/java/org/prebid/server/metric/UserSyncMetricsTest.java index 83e4ffb284a..e9b0a32aec3 100644 --- a/src/test/java/org/prebid/server/metric/UserSyncMetricsTest.java +++ b/src/test/java/org/prebid/server/metric/UserSyncMetricsTest.java @@ -13,6 +13,6 @@ public void forBidderShouldReturnSameBidderCookieSyncMetricsOnSuccessiveCalls() final UserSyncMetrics userSyncMetrics = new UserSyncMetrics(new MetricRegistry(), CounterType.counter); // when and then - assertThat(userSyncMetrics.forBidder("rubicon")).isSameAs(userSyncMetrics.forBidder("rubicon")); + assertThat(userSyncMetrics.forBidder("magnite")).isSameAs(userSyncMetrics.forBidder("magnite")); } } diff --git a/src/test/java/org/prebid/server/privacy/gdpr/Tcf2ServiceTest.java b/src/test/java/org/prebid/server/privacy/gdpr/Tcf2ServiceTest.java index bc99140d6db..79eff191ae1 100644 --- a/src/test/java/org/prebid/server/privacy/gdpr/Tcf2ServiceTest.java +++ b/src/test/java/org/prebid/server/privacy/gdpr/Tcf2ServiceTest.java @@ -171,13 +171,13 @@ private void initGdpr(PurposeOneTreatmentInterpretation p1TI) { @Test public void permissionsForShouldReturnByGdprPurpose() { // given - given(bidderCatalog.nameByVendorId(any())).willReturn("rubicon"); + given(bidderCatalog.nameByVendorId(any())).willReturn("magnite"); // when final Future> result = target.permissionsFor(singleton(1), tcString); // then - final VendorPermission expectedVendorPermission = VendorPermission.of(1, "rubicon", restrictAll()); + final VendorPermission expectedVendorPermission = VendorPermission.of(1, "magnite", restrictAll()); assertThat(result).succeededWith(singletonList(expectedVendorPermission)); verifyEachPurposeStrategyReceive(singletonList(withGvl(expectedVendorPermission, 1))); @@ -190,13 +190,13 @@ public void permissionsForShouldReturnByGdprPurpose() { public void permissionsForShouldReturnByGdprPurposeAndDowngradeToBasicTypeWhenVendorListServiceFailed() { // given given(vendorListService.forConsent(any())).willReturn(Future.failedFuture("Bad version")); - given(bidderCatalog.nameByVendorId(any())).willReturn("rubicon"); + given(bidderCatalog.nameByVendorId(any())).willReturn("magnite"); // when final Future> result = target.permissionsFor(singleton(1), tcString); // then - final VendorPermission expectedVendorPermission = VendorPermission.of(1, "rubicon", restrictAll()); + final VendorPermission expectedVendorPermission = VendorPermission.of(1, "magnite", restrictAll()); assertThat(result).succeededWith(singletonList(expectedVendorPermission)); final Purpose downgradedPurpose7 = Purpose.of( @@ -336,7 +336,7 @@ public void permissionsForShouldReturnVendorIdsResult() { @Test public void permissionsForShouldReturnAllDeniedWhenP1TIIsNoAccessAllowed() { // given - given(bidderCatalog.nameByVendorId(any())).willReturn("rubicon"); + given(bidderCatalog.nameByVendorId(any())).willReturn("magnite"); given(tcString.getPurposeOneTreatment()).willReturn(true); initTcf2Service(PurposeOneTreatmentInterpretation.noAccessAllowed); @@ -344,7 +344,7 @@ public void permissionsForShouldReturnAllDeniedWhenP1TIIsNoAccessAllowed() { final Future> result = target.permissionsFor(singleton(1), tcString); // then - final VendorPermission expectedVendorPermission = VendorPermission.of(1, "rubicon", restrictAll()); + final VendorPermission expectedVendorPermission = VendorPermission.of(1, "magnite", restrictAll()); assertThat(result).succeededWith(singletonList(expectedVendorPermission)); final List permissions = singletonList(withGvl(expectedVendorPermission, 1)); @@ -364,7 +364,7 @@ public void permissionsForShouldReturnAllDeniedWhenP1TIIsNoAccessAllowed() { @Test public void permissionsForShouldAllowAllWhenP1TIIsAccessAllowed() { // given - given(bidderCatalog.nameByVendorId(any())).willReturn("rubicon"); + given(bidderCatalog.nameByVendorId(any())).willReturn("magnite"); given(tcString.getPurposeOneTreatment()).willReturn(true); initTcf2Service(PurposeOneTreatmentInterpretation.accessAllowed); @@ -372,7 +372,7 @@ public void permissionsForShouldAllowAllWhenP1TIIsAccessAllowed() { final Future> result = target.permissionsFor(singleton(1), tcString); // then - final VendorPermission expectedVendorPermission = VendorPermission.of(1, "rubicon", restrictAll()); + final VendorPermission expectedVendorPermission = VendorPermission.of(1, "magnite", restrictAll()); assertThat(result).succeededWith(singletonList(expectedVendorPermission)); final List permissions = singletonList(withGvl(expectedVendorPermission, 1)); @@ -393,7 +393,7 @@ public void permissionsForShouldAllowAllWhenP1TIIsAccessAllowed() { @Test public void permissionsForShouldNotAllowAllWhenP1TIsFalseAndP1TIIsAccessAllowed() { // given - given(bidderCatalog.nameByVendorId(any())).willReturn("rubicon"); + given(bidderCatalog.nameByVendorId(any())).willReturn("magnite"); given(tcString.getPurposeOneTreatment()).willReturn(false); initTcf2Service(PurposeOneTreatmentInterpretation.accessAllowed); @@ -401,7 +401,7 @@ public void permissionsForShouldNotAllowAllWhenP1TIsFalseAndP1TIIsAccessAllowed( final Future> result = target.permissionsFor(singleton(1), tcString); // then - final VendorPermission expectedVendorPermission = VendorPermission.of(1, "rubicon", restrictAll()); + final VendorPermission expectedVendorPermission = VendorPermission.of(1, "magnite", restrictAll()); assertThat(result).succeededWith(singletonList(expectedVendorPermission)); final List standardPermissions = singletonList(withGvl(expectedVendorPermission, 1)); diff --git a/src/test/java/org/prebid/server/settings/FileApplicationSettingsTest.java b/src/test/java/org/prebid/server/settings/FileApplicationSettingsTest.java index 5c4bd81dff9..dd8bab98d16 100644 --- a/src/test/java/org/prebid/server/settings/FileApplicationSettingsTest.java +++ b/src/test/java/org/prebid/server/settings/FileApplicationSettingsTest.java @@ -133,7 +133,7 @@ public void getAccountByIdShouldReturnPresentAccount() { p1: { enforce-purpose: basic, enforce-vendors: false, - vendor-exceptions: [rubicon, appnexus] + vendor-exceptions: [magnite, appnexus] }, p2: { enforce-purpose: full, @@ -144,7 +144,7 @@ public void getAccountByIdShouldReturnPresentAccount() { special-features: { sf1: { enforce: true, - vendor-exceptions: [rubicon, appnexus] + vendor-exceptions: [magnite, appnexus] }, sf2: { enforce: false, @@ -210,12 +210,12 @@ public void getAccountByIdShouldReturnPresentAccount() { .p1(Purpose.of( EnforcePurpose.basic, false, - asList("rubicon", "appnexus"), + asList("magnite", "appnexus"), null)) .p2(Purpose.of(EnforcePurpose.full, true, singletonList("openx"), null)) .build()) .specialFeatures(SpecialFeatures.builder() - .sf1(SpecialFeature.of(true, asList("rubicon", "appnexus"))) + .sf1(SpecialFeature.of(true, asList("magnite", "appnexus"))) .sf2(SpecialFeature.of(false, singletonList("openx"))) .build()) .purposeOneTreatmentInterpretation(PurposeOneTreatmentInterpretation.accessAllowed) diff --git a/src/test/java/org/prebid/server/validation/ImpValidatorTest.java b/src/test/java/org/prebid/server/validation/ImpValidatorTest.java index fa109dc8f58..bbc329fbd07 100644 --- a/src/test/java/org/prebid/server/validation/ImpValidatorTest.java +++ b/src/test/java/org/prebid/server/validation/ImpValidatorTest.java @@ -54,7 +54,7 @@ @ExtendWith(MockitoExtension.class) public class ImpValidatorTest extends VertxTest { - private static final String RUBICON = "rubicon"; + private static final String MAGNITE = "magnite"; @Mock private BidderParamValidator bidderParamValidator; @@ -67,8 +67,8 @@ public class ImpValidatorTest extends VertxTest { public void setUp() { target = new ImpValidator(bidderParamValidator, bidderCatalog, jacksonMapper); - given(bidderCatalog.isValidName(RUBICON)).willReturn(true); - given(bidderCatalog.isActive(RUBICON)).willReturn(true); + given(bidderCatalog.isValidName(MAGNITE)).willReturn(true); + given(bidderCatalog.isActive(MAGNITE)).willReturn(true); } @Test @@ -146,7 +146,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasNullFormatAndN .format(null) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -169,7 +169,7 @@ public void validateImpsShouldReturnEmptyValidationMessagesWhenBannerHasNullForm .format(null) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -185,7 +185,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasEmptyFormatAnd .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -205,7 +205,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasEmptyFormatAnd .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -225,7 +225,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasEmptyFormatAnd .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -246,7 +246,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasEmptyFormatAnd .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -267,7 +267,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasZeroHeight() { .format(singletonList(Format.builder().build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -288,7 +288,7 @@ public void validateImpsShouldNotReturnValidationMessageForSizesIfImpIsInterstit .format(singletonList(Format.builder().w(1).h(1).build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -306,7 +306,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasEmptyFormatAnd .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -327,7 +327,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasZeroWidth() { .format(singletonList(Format.builder().build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -347,7 +347,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasEmptyFormatAnd .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -368,7 +368,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasNegativeWidth( .format(singletonList(Format.builder().build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -387,7 +387,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasEmptyFormatAnd .w(600) .format(emptyList()) .build()) - .ext(mapper.valueToTree(singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + .ext(mapper.valueToTree(singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -408,7 +408,7 @@ public void validateImpsShouldReturnValidationMessageWhenBannerHasNegativeHeight .format(singletonList(Format.builder().build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build()); // when & then @@ -1367,7 +1367,7 @@ public void validateImpsShouldReturnValidationMessageWhenStoredBidResponseBidder // given final ObjectNode prebid = mapper.valueToTree(ExtImpPrebid.builder() .storedBidResponse(singletonList(ExtStoredBidResponse.of(null, "id"))) - .bidder(mapper.createObjectNode().put("rubicon", 1)) + .bidder(mapper.createObjectNode().put("magnite", 1)) .build()); final List givenImps = singletonList(validImpBuilder() @@ -1384,7 +1384,7 @@ public void validateImpsShouldReturnValidationMessageWhenStoredBidResponseIdMiss // given final ObjectNode prebid = mapper.valueToTree(ExtImpPrebid.builder() .storedBidResponse(singletonList(ExtStoredBidResponse.of("bidder", null))) - .bidder(mapper.createObjectNode().put("rubicon", 1)) + .bidder(mapper.createObjectNode().put("magnite", 1)) .build()); final List givenImps = singletonList(validImpBuilder() @@ -1402,7 +1402,7 @@ public void validateImpsShouldReturnValidationMessageWhenStoredBidResponseBidder // given final ObjectNode prebid = mapper.valueToTree(ExtImpPrebid.builder() .storedBidResponse(singletonList(ExtStoredBidResponse.of("bidder", "id"))) - .bidder(mapper.createObjectNode().put("rubicon", 1)) + .bidder(mapper.createObjectNode().put("magnite", 1)) .build()); given(bidderCatalog.isValidName(eq("bidder"))).willReturn(false); @@ -1421,7 +1421,7 @@ public void validateImpsShouldReturnValidationMessageWhenStoredBidResponseBidder // given final ObjectNode prebid = mapper.valueToTree(ExtImpPrebid.builder() .storedBidResponse(singletonList(ExtStoredBidResponse.of("bidder", "id"))) - .bidder(mapper.createObjectNode().put("rubicon", 1)) + .bidder(mapper.createObjectNode().put("magnite", 1)) .build()); given(bidderCatalog.isValidName(eq("bidder"))).willReturn(true); @@ -1468,7 +1468,7 @@ public void validateImpsShouldReturnWarningAndDropBidderWhenImpExtPrebidBidderIs // given final List givenImps = givenValidImps(); - given(bidderCatalog.isValidName(eq(RUBICON))).willReturn(false); + given(bidderCatalog.isValidName(eq(MAGNITE))).willReturn(false); final List debugMessages = new ArrayList<>(); @@ -1477,8 +1477,8 @@ public void validateImpsShouldReturnWarningAndDropBidderWhenImpExtPrebidBidderIs // then assertThat(debugMessages) - .containsExactly("WARNING: request.imp[0].ext.prebid.bidder.rubicon was dropped with a reason: " - + "request.imp[0].ext.prebid.bidder contains unknown bidder: rubicon", + .containsExactly("WARNING: request.imp[0].ext.prebid.bidder.magnite was dropped with a reason: " + + "request.imp[0].ext.prebid.bidder contains unknown bidder: magnite", "WARNING: request.imp[0].ext must contain at least one valid bidder"); assertThat(givenImps) @@ -1504,8 +1504,8 @@ public void validateImpsShouldReturnWarningMessageAndDropBidderWhenBidderExtIsIn assertThat(debugMessages) .containsExactly( """ - WARNING: request.imp[0].ext.prebid.bidder.rubicon was dropped with a reason: \ - request.imp[0].ext.prebid.bidder.rubicon failed validation. + WARNING: request.imp[0].ext.prebid.bidder.magnite was dropped with a reason: \ + request.imp[0].ext.prebid.bidder.magnite failed validation. errorMessage1 errorMessage2""", "WARNING: request.imp[0].ext must contain at least one valid bidder"); @@ -1532,7 +1532,7 @@ public void validateImpsShouldReturnWarningMessageAndDropBidderWhenBidderExtIsIn final List debugMessages = new ArrayList<>(); // when - target.validateImps(givenImps, Map.of("someAlias", "rubicon"), debugMessages); + target.validateImps(givenImps, Map.of("someAlias", "magnite"), debugMessages); // then assertThat(debugMessages) @@ -1560,7 +1560,7 @@ public void validateImpsShouldReturnWarningMessageAndDropBidderWhenImpExtPrebidI // given final List givenImps = singletonList(validImpBuilder() .ext(mapper.valueToTree(singletonMap("prebid", - Map.of("imp", singletonMap("unknownBidder", 0), "bidder", singletonMap("rubicon", 0))))) + Map.of("imp", singletonMap("unknownBidder", 0), "bidder", singletonMap("magnite", 0))))) .build()); given(bidderCatalog.isValidName(eq("unknownBidder"))).willReturn(false); @@ -1588,13 +1588,13 @@ public void validateImpsShouldReturnNoMessageWhenImpExtPrebidImpBidderIsAlias() // given final List givenImps = singletonList(validImpBuilder() .ext(mapper.valueToTree(singletonMap("prebid", - Map.of("imp", singletonMap("rubiconAlias", 0), "bidder", singletonMap("rubicon", 0))))) + Map.of("imp", singletonMap("magniteAlias", 0), "bidder", singletonMap("magnite", 0))))) .build()); final List debugMessages = new ArrayList<>(); // when - target.validateImps(givenImps, Map.of("rubiconAlias", "rubicon"), debugMessages); + target.validateImps(givenImps, Map.of("magniteAlias", "magnite"), debugMessages); // then assertThat(debugMessages).isEmpty(); @@ -1603,7 +1603,7 @@ public void validateImpsShouldReturnNoMessageWhenImpExtPrebidImpBidderIsAlias() .extracting(Imp::getExt) .extracting(impExt -> impExt.get("prebid")) .extracting(prebid -> prebid.get("imp")) - .containsOnly(mapper.createObjectNode().put("rubiconAlias", 0)); + .containsOnly(mapper.createObjectNode().put("magniteAlias", 0)); } @Test @@ -1682,7 +1682,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasEmptyFormatAndN .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1702,7 +1702,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasEmptyFormatAndZ .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1722,7 +1722,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasZeroHeight() { .format(singletonList(Format.builder().build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1795,7 +1795,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasNullFormatAndNo .format(null) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1817,7 +1817,7 @@ public void validateImpShouldReturnEmptyValidationMessagesWhenBannerHasNullForma .format(null) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1833,7 +1833,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasEmptyFormatAndN .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1852,7 +1852,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasEmptyFormatAndN .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1873,7 +1873,7 @@ public void validateImpShouldNotReturnValidationMessageForSizesIfImpIsInterstiti .format(singletonList(Format.builder().w(1).h(1).build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1891,7 +1891,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasEmptyFormatAndZ .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1911,7 +1911,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasZeroWidth() { .format(singletonList(Format.builder().build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1931,7 +1931,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasEmptyFormatAndN .format(emptyList()) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1951,7 +1951,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasNegativeWidth() .format(singletonList(Format.builder().build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1970,7 +1970,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasEmptyFormatAndN .w(600) .format(emptyList()) .build()) - .ext(mapper.valueToTree(singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + .ext(mapper.valueToTree(singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -1990,7 +1990,7 @@ public void validateImpShouldReturnValidationMessageWhenBannerHasNegativeHeight( .format(singletonList(Format.builder().build())) .build()) .ext(mapper.valueToTree( - singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))) + singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))) .build(); // when & then @@ -2426,7 +2426,7 @@ private static Imp.ImpBuilder validImpBuilder() { .format(singletonList(Format.builder().wmin(1).wratio(5).hratio(1).build())) .build()) .pmp(Pmp.builder().deals(singletonList(Deal.builder().id("1").build())).build()) - .ext(mapper.valueToTree(singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))); + .ext(mapper.valueToTree(singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))); } } diff --git a/src/test/java/org/prebid/server/validation/RequestValidatorTest.java b/src/test/java/org/prebid/server/validation/RequestValidatorTest.java index 653b7bf6a1d..09cbe564002 100644 --- a/src/test/java/org/prebid/server/validation/RequestValidatorTest.java +++ b/src/test/java/org/prebid/server/validation/RequestValidatorTest.java @@ -71,7 +71,7 @@ @ExtendWith(MockitoExtension.class) public class RequestValidatorTest extends VertxTest { - private static final String RUBICON = "rubicon"; + private static final String MAGNITE = "magnite"; private static final String ACCOUNT_ID = "accountId"; @Mock(strictness = LENIENT) @@ -85,8 +85,8 @@ public class RequestValidatorTest extends VertxTest { @BeforeEach public void setUp() { - given(bidderCatalog.isValidName(eq(RUBICON))).willReturn(true); - given(bidderCatalog.isActive(eq(RUBICON))).willReturn(true); + given(bidderCatalog.isValidName(eq(MAGNITE))).willReturn(true); + given(bidderCatalog.isActive(eq(MAGNITE))).willReturn(true); target = new RequestValidator(bidderCatalog, impValidator, metrics, jacksonMapper, 0.01, false, true, true); } @@ -187,7 +187,7 @@ public void validateShouldReturnValidationMessageWhenAliasesKeyDoesntContainAlia // given final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of(ExtRequestPrebid.builder() - .aliases(singletonMap("pubmatic", "rubicon")) + .aliases(singletonMap("pubmatic", "magnite")) .aliasgvlids(singletonMap("between", 2)) .build())) .build(); @@ -205,7 +205,7 @@ public void validateShouldReturnValidationMessageWhenAliasgvlidsValueLowerThatOn // given final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of(ExtRequestPrebid.builder() - .aliases(singletonMap("pubmatic", "rubicon")) + .aliases(singletonMap("pubmatic", "magnite")) .aliasgvlids(singletonMap("pubmatic", 0)) .build())) .build(); @@ -1125,7 +1125,7 @@ public void validateShouldNotReturnAnyErrorInValidationResultWhenPrebidBuyerIdIs // given final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of(ExtRequestPrebid.builder() - .aliases(singletonMap("unknown-bidder", "rubicon")) + .aliases(singletonMap("unknown-bidder", "magnite")) .build())) .user(User.builder() .ext(ExtUser.builder() @@ -1147,7 +1147,7 @@ public void validateShouldNotReturnAnyErrorInValidationResultWhenPrebidBuyerIdIs final BidRequest bidRequest = validBidRequestBuilder() .user(User.builder() .ext(ExtUser.builder() - .prebid(ExtUserPrebid.of(singletonMap("rubicon", "42"))) + .prebid(ExtUserPrebid.of(singletonMap("magnite", "42"))) .build()) .build()) .build(); @@ -1196,7 +1196,7 @@ public void validateShouldReturnValidationMessageWhenEidHasEmptySource() { public void validateShouldReturnValidationMessageWhenAliasNameEqualsToBidderItPointsOn() { // given final ExtRequest ext = ExtRequest.of(ExtRequestPrebid.builder() - .aliases(singletonMap("rubicon", "rubicon")) + .aliases(singletonMap("magnite", "magnite")) .build()); final BidRequest bidRequest = validBidRequestBuilder().ext(ext).build(); @@ -1206,7 +1206,7 @@ public void validateShouldReturnValidationMessageWhenAliasNameEqualsToBidderItPo // then assertThat(result.getErrors()).hasSize(1) .containsOnly(""" - request.ext.prebid.aliases.rubicon defines a no-op alias. \ + request.ext.prebid.aliases.magnite defines a no-op alias. \ Choose a different alias, or remove this entry"""); } @@ -1284,7 +1284,7 @@ public void validateShouldReturnValidationWarningMessageWhenAliasPointOnDisabled public void validateShouldReturnEmptyValidationMessagesWhenAliasesWasUsed() { // given final ExtRequest ext = ExtRequest.of(ExtRequestPrebid.builder() - .aliases(singletonMap("alias", "rubicon")) + .aliases(singletonMap("alias", "magnite")) .build()); final BidRequest bidRequest = validBidRequestBuilder().ext(ext).build(); @@ -1314,7 +1314,7 @@ public void validateShouldReturnValidationResultWithErrorsWhenGdprIsNotOneOrZero public void validateShouldReturnValidationMessageWhenAdjustmentFactorNegative() { // given final ExtRequestBidAdjustmentFactors givenAdjustments = ExtRequestBidAdjustmentFactors.builder().build(); - givenAdjustments.addFactor("rubicon", BigDecimal.valueOf(-1.1)); + givenAdjustments.addFactor("magnite", BigDecimal.valueOf(-1.1)); final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of( ExtRequestPrebid.builder() @@ -1327,7 +1327,7 @@ public void validateShouldReturnValidationMessageWhenAdjustmentFactorNegative() // then assertThat(result.getErrors()).hasSize(1) .containsOnly( - "request.ext.prebid.bidadjustmentfactors.rubicon must be a positive number. Got -1.100000"); + "request.ext.prebid.bidadjustmentfactors.magnite must be a positive number. Got -1.100000"); } @Test @@ -1335,7 +1335,7 @@ public void validateShouldReturnValidationMessageWhenAdjustmentMediaFactorNegati // given final ExtRequestBidAdjustmentFactors givenAdjustments = ExtRequestBidAdjustmentFactors.builder() .mediatypes(new EnumMap<>(Collections.singletonMap(ImpMediaType.banner, - Collections.singletonMap("rubicon", BigDecimal.valueOf(-1.1))))) + Collections.singletonMap("magnite", BigDecimal.valueOf(-1.1))))) .build(); final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of( @@ -1349,7 +1349,7 @@ public void validateShouldReturnValidationMessageWhenAdjustmentMediaFactorNegati // then assertThat(result.getErrors()).hasSize(1) .containsOnly( - "request.ext.prebid.bidadjustmentfactors.banner.rubicon " + "request.ext.prebid.bidadjustmentfactors.banner.magnite " + "must be a positive number. Got -1.100000"); } @@ -1400,7 +1400,7 @@ public void validateShouldNotFailWhenBidderIsKnownAsAlternativeBidderCode() { final ExtRequestBidAdjustmentFactors givenAdjustments = ExtRequestBidAdjustmentFactors.builder().build(); givenAdjustments.addFactor("unknownBidder", BigDecimal.valueOf(1.1F)); final ExtRequestPrebidAlternateBidderCodes givenAlternativeBidderCodes = - ExtRequestPrebidAlternateBidderCodes.of(true, Map.of("rubicon", + ExtRequestPrebidAlternateBidderCodes.of(true, Map.of("magnite", ExtRequestPrebidAlternateBidderCodesBidder.of(true, Set.of("unknownBidder")))); final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of( @@ -1448,7 +1448,7 @@ public void validateShouldNotFailWhenMediaBidderIsKnownAsAlternativeBidderCode() .build(); givenAdjustments.addFactor("unknownBidder", BigDecimal.valueOf(1.1F)); final ExtRequestPrebidAlternateBidderCodes givenAlternativeBidderCodes = - ExtRequestPrebidAlternateBidderCodes.of(true, Map.of("rubicon", + ExtRequestPrebidAlternateBidderCodes.of(true, Map.of("magnite", ExtRequestPrebidAlternateBidderCodesBidder.of(true, Set.of("unknownBidder")))); final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of( @@ -1470,9 +1470,9 @@ public void validateShouldReturnEmptyValidationMessagesWhenBidderIsKnownAndAdjus // given final ExtRequestBidAdjustmentFactors givenAdjustments = ExtRequestBidAdjustmentFactors.builder() .mediatypes(new EnumMap<>(Collections.singletonMap(ImpMediaType.xNative, - Collections.singletonMap("rubicon", BigDecimal.valueOf(2.1))))) + Collections.singletonMap("magnite", BigDecimal.valueOf(2.1))))) .build(); - givenAdjustments.addFactor("rubicon", BigDecimal.valueOf(1.1)); + givenAdjustments.addFactor("magnite", BigDecimal.valueOf(1.1)); final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of( ExtRequestPrebid.builder() @@ -1490,16 +1490,16 @@ public void validateShouldReturnEmptyValidationMessagesWhenBidderIsKnownAndAdjus @Test public void validateShouldReturnEmptyValidationMessagesWhenBidderIsKnownAliasForCoreBidderAndAdjustmentIsValid() { // given - final String rubiconAlias = "rubicon_alias"; + final String magniteAlias = "magnite_alias"; final ExtRequestBidAdjustmentFactors givenAdjustments = ExtRequestBidAdjustmentFactors.builder() .mediatypes(new EnumMap<>(Collections.singletonMap(ImpMediaType.xNative, - Collections.singletonMap("rubicon_alias", BigDecimal.valueOf(2.1))))) + Collections.singletonMap("magnite_alias", BigDecimal.valueOf(2.1))))) .build(); - givenAdjustments.addFactor(rubiconAlias, BigDecimal.valueOf(1.1)); + givenAdjustments.addFactor(magniteAlias, BigDecimal.valueOf(1.1)); final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of( ExtRequestPrebid.builder() - .aliases(singletonMap(rubiconAlias, "rubicon")) + .aliases(singletonMap(magniteAlias, "magnite")) .bidadjustmentfactors(givenAdjustments) .build())) .build(); @@ -1514,13 +1514,13 @@ public void validateShouldReturnEmptyValidationMessagesWhenBidderIsKnownAliasFor @Test public void validateShouldReturnEmptyValidationMessagesWhenBidderIsKnownBidderConfigAliasAndAdjustmentIsValid() { // given - final String rubiconAlias = "rubicon_alias"; + final String magniteAlias = "magnite_alias"; final ExtRequestBidAdjustmentFactors givenAdjustments = ExtRequestBidAdjustmentFactors.builder().build(); - givenAdjustments.addFactor(rubiconAlias, BigDecimal.valueOf(1.1)); + givenAdjustments.addFactor(magniteAlias, BigDecimal.valueOf(1.1)); final BidRequest bidRequest = validBidRequestBuilder() .ext(ExtRequest.of( ExtRequestPrebid.builder() - .aliases(singletonMap(rubiconAlias, "rubicon")) + .aliases(singletonMap(magniteAlias, "magnite")) .bidadjustmentfactors(givenAdjustments) .build())) .build(); @@ -1529,7 +1529,7 @@ public void validateShouldReturnEmptyValidationMessagesWhenBidderIsKnownBidderCo final ValidationResult result = target.validate(Account.empty(ACCOUNT_ID), bidRequest, null, null); // then - verify(bidderCatalog).isValidName(rubiconAlias); + verify(bidderCatalog).isValidName(magniteAlias); assertThat(result.getErrors()).isEmpty(); } @@ -1600,7 +1600,7 @@ private static Imp.ImpBuilder validImpBuilder() { .format(singletonList(Format.builder().wmin(1).wratio(5).hratio(1).build())) .build()) .pmp(Pmp.builder().deals(singletonList(Deal.builder().id("1").build())).build()) - .ext(mapper.valueToTree(singletonMap("prebid", singletonMap("bidder", singletonMap("rubicon", 0))))); + .ext(mapper.valueToTree(singletonMap("prebid", singletonMap("bidder", singletonMap("magnite", 0))))); } } diff --git a/src/test/java/org/prebid/server/vertx/http/ParametrizedDecompressionHandlerTest.java b/src/test/java/org/prebid/server/vertx/http/ParametrizedDecompressionHandlerTest.java new file mode 100644 index 00000000000..198d838dc73 --- /dev/null +++ b/src/test/java/org/prebid/server/vertx/http/ParametrizedDecompressionHandlerTest.java @@ -0,0 +1,130 @@ +package org.prebid.server.vertx.http; + +import io.netty.handler.codec.http.HttpResponseStatus; +import io.vertx.core.buffer.Buffer; +import io.vertx.core.http.HttpServerRequest; +import io.vertx.core.http.HttpServerResponse; +import io.vertx.ext.web.RequestBody; +import io.vertx.ext.web.impl.RoutingContextInternal; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.zip.GZIPOutputStream; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mock.Strictness.LENIENT; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +@ExtendWith(MockitoExtension.class) +public class ParametrizedDecompressionHandlerTest { + + @Mock(strictness = LENIENT) + private RoutingContextInternal routingContext; + @Mock(strictness = LENIENT) + private HttpServerRequest request; + @Mock(strictness = LENIENT) + private HttpServerResponse response; + @Mock(strictness = LENIENT) + private RequestBody requestBody; + + private final ParametrizedDecompressionHandler target = new ParametrizedDecompressionHandler(1024); + + @BeforeEach + public void setUp() { + given(routingContext.request()).willReturn(request); + given(routingContext.response()).willReturn(response); + given(routingContext.body()).willReturn(requestBody); + + given(response.setStatusCode(anyInt())).willReturn(response); + } + + @Test + public void handleShouldPassRequestToNextHandlerWhenGzipNotSet() { + // given and when + target.handle(routingContext); + + // then + verify(routingContext).next(); + verify(routingContext, times(0)).setBody(any()); + } + + @Test + public void handleShouldDecompressRequestAndSetBodyWhenGzipParamIsSetToOne() { + // given + final byte[] body = "decompressed body".getBytes(StandardCharsets.UTF_8); + + given(request.getParam(eq("gzip"))).willReturn("1"); + given(requestBody.buffer()).willReturn(Buffer.buffer(gzip(body))); + + // when + target.handle(routingContext); + + // then + verify(routingContext, times(1)).setBody(eq(Buffer.buffer(body))); + verify(routingContext).next(); + } + + @Test + public void handleShouldDecompressRequestAndSetBodyWhenGzipParamIsSetToTrue() { + // given + final byte[] body = "decompressed body".getBytes(StandardCharsets.UTF_8); + + given(request.getParam(eq("gzip"))).willReturn("true"); + given(requestBody.buffer()).willReturn(Buffer.buffer(gzip(body))); + + // when + target.handle(routingContext); + + // then + verify(routingContext, times(1)).setBody(eq(Buffer.buffer(body))); + verify(routingContext).next(); + } + + @Test + public void handleShouldRespondWithBadRequestWhenCompressedBodyIsCorrupted() { + // given + final byte[] body = new byte[]{1, 2, 3, 4}; + + given(request.getParam(eq("gzip"))).willReturn("true"); + given(requestBody.buffer()).willReturn(Buffer.buffer(body)); + + // when + target.handle(routingContext); + + // then + verify(response).setStatusCode(HttpResponseStatus.BAD_REQUEST.code()); + + final ArgumentCaptor responseBodyCaptor = ArgumentCaptor.forClass(String.class); + verify(response).end(responseBodyCaptor.capture()); + assertThat(responseBodyCaptor.getValue()).asString().startsWith("Invalid body: "); + + verify(routingContext, times(0)).setBody(any()); + verify(routingContext, times(0)).next(); + } + + private static byte[] gzip(byte[] input) { + try ( + ByteArrayOutputStream obj = new ByteArrayOutputStream(); + GZIPOutputStream gzip = new GZIPOutputStream(obj)) { + + gzip.write(input); + gzip.finish(); + + return obj.toByteArray(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/src/test/resources/org/prebid/server/functional/floor-rules.json b/src/test/resources/org/prebid/server/functional/floor-rules.json index 194c83ebc91..1bbc5446706 100644 --- a/src/test/resources/org/prebid/server/functional/floor-rules.json +++ b/src/test/resources/org/prebid/server/functional/floor-rules.json @@ -1,5 +1,5 @@ { - "floorProvider": "rubicon", + "floorProvider": "magnite", "modelGroups": [ { "modelWeight": 10, diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-auction-bidagency-request.json b/src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-auction-bidgency-request.json similarity index 91% rename from src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-auction-bidagency-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-auction-bidgency-request.json index 5ad79b5e2fe..03b942cc803 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-auction-bidagency-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-auction-bidgency-request.json @@ -8,7 +8,7 @@ "h": 250 }, "ext": { - "bidagency": { + "bidgency": { "zone" : 1 } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-auction-bidagency-response.json b/src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-auction-bidgency-response.json similarity index 83% rename from src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-auction-bidagency-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-auction-bidgency-response.json index 0f9f64d5403..106dcc191e2 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-auction-bidagency-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-auction-bidgency-response.json @@ -15,21 +15,21 @@ "prebid": { "type": "banner", "meta": { - "adaptercode": "bidagency" + "adaptercode": "bidgency" } }, "origbidcpm": 4.7 } } ], - "seat": "bidagency", + "seat": "bidgency", "group": 0 } ], "cur": "USD", "ext": { "responsetimemillis": { - "bidagency": "{{ bidagency.response_time_ms }}" + "bidgency": "{{ bidgency.response_time_ms }}" }, "prebid": { "auctiontimestamp": 0 diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-bidagency-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-bidgency-bid-request.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-bidagency-bid-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-bidgency-bid-request.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-bidagency-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-bidgency-bid-response.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/bidagency/test-bidagency-bid-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/bidgency/test-bidgency-bid-response.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-auction-radianfusion-request.json b/src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-auction-radiantfusion-request.json similarity index 92% rename from src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-auction-radianfusion-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-auction-radiantfusion-request.json index c4c23330095..722e47ce8ba 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-auction-radianfusion-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-auction-radiantfusion-request.json @@ -8,7 +8,7 @@ "h": 250 }, "ext": { - "radianfusion": { + "radiantfusion": { "partnerName": "someUniquePartnerName", "seat": "someSeat", "token": "someToken" diff --git a/src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-auction-radianfusion-response.json b/src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-auction-radiantfusion-response.json similarity index 83% rename from src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-auction-radianfusion-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-auction-radiantfusion-response.json index 701a84c994b..0ce9380e1f8 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-auction-radianfusion-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-auction-radiantfusion-response.json @@ -20,20 +20,20 @@ "prebid": { "type": "video", "meta": { - "adaptercode": "radianfusion" + "adaptercode": "radiantfusion" } } } } ], - "seat": "radianfusion", + "seat": "radiantfusion", "group": 0 } ], "cur": "USD", "ext": { "responsetimemillis": { - "radianfusion": "{{ radianfusion.response_time_ms }}" + "radiantfusion": "{{ radiantfusion.response_time_ms }}" }, "prebid": { "auctiontimestamp": 0 diff --git a/src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-radianfusion-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-radiantfusion-bid-request.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-radianfusion-bid-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-radiantfusion-bid-request.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-radianfusion-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-radiantfusion-bid-response.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/radianfusion/test-radianfusion-bid-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/radiantfusion/test-radiantfusion-bid-response.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/resetdigital/test-auction-resetdigital-request.json b/src/test/resources/org/prebid/server/it/openrtb2/resetdigital/test-auction-resetdigital-request.json index 9ee75999128..99e50554443 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/resetdigital/test-auction-resetdigital-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/resetdigital/test-auction-resetdigital-request.json @@ -9,8 +9,7 @@ }, "ext": { "resetdigital": { - "pubId": "lb.ads", - "zoneId": "publisherTestID" + "placement_id": "publisherTestID" } } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/resetdigital/test-resetdigital-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/resetdigital/test-resetdigital-bid-request.json index 593e78d7d5b..f9d55ad225d 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/resetdigital/test-resetdigital-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/resetdigital/test-resetdigital-bid-request.json @@ -8,11 +8,11 @@ "w": 300, "h": 250 }, + "tagid": "publisherTestID", "ext": { "tid": "${json-unit.any-string}", "bidder": { - "pubId": "lb.ads", - "zoneId": "publisherTestID" + "placement_id": "publisherTestID" } } } diff --git a/src/test/resources/org/prebid/server/it/storedimps/test-generic-stored-imp-cache-update.json b/src/test/resources/org/prebid/server/it/storedimps/test-generic-stored-imp-cache-update.json index 373d0646dea..038b749af92 100644 --- a/src/test/resources/org/prebid/server/it/storedimps/test-generic-stored-imp-cache-update.json +++ b/src/test/resources/org/prebid/server/it/storedimps/test-generic-stored-imp-cache-update.json @@ -11,10 +11,10 @@ "h": 600 }, "ext": { - "rubicon": { + "magnite": { "accountId": 5001, "siteId": 6001, "zoneId": 7001 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/storedimps/test-rubicon-stored-request-2.json b/src/test/resources/org/prebid/server/it/storedimps/test-magnite-stored-request-2.json similarity index 93% rename from src/test/resources/org/prebid/server/it/storedimps/test-rubicon-stored-request-2.json rename to src/test/resources/org/prebid/server/it/storedimps/test-magnite-stored-request-2.json index b3ae9bfe3bd..24d53945bdd 100644 --- a/src/test/resources/org/prebid/server/it/storedimps/test-rubicon-stored-request-2.json +++ b/src/test/resources/org/prebid/server/it/storedimps/test-magnite-stored-request-2.json @@ -12,7 +12,7 @@ }, "ext": { "tid": "tid", - "rubicon": { + "magnite": { "accountId": 5001, "siteId": 6001, "zoneId": 7001 diff --git a/src/test/resources/org/prebid/server/it/storedresponses/test-stored-auction-response.json b/src/test/resources/org/prebid/server/it/storedresponses/test-stored-auction-response.json index bf02cc1bd3e..335e5feab1d 100644 --- a/src/test/resources/org/prebid/server/it/storedresponses/test-stored-auction-response.json +++ b/src/test/resources/org/prebid/server/it/storedresponses/test-stored-auction-response.json @@ -8,7 +8,7 @@ "price": 0.8 } ], - "seat": "rubicon", + "seat": "magnite", "group": 0 }, { diff --git a/src/test/resources/org/prebid/server/it/storedresponses/test-stored-bid-response.json b/src/test/resources/org/prebid/server/it/storedresponses/test-stored-bid-response.json index 3a3e7f5ba1a..175fe5f6a8c 100644 --- a/src/test/resources/org/prebid/server/it/storedresponses/test-stored-bid-response.json +++ b/src/test/resources/org/prebid/server/it/storedresponses/test-stored-bid-response.json @@ -13,8 +13,8 @@ "h": 250 } ], - "seat": "rubicon", + "seat": "magnite", "group": 0 } ] -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/test-application.properties b/src/test/resources/org/prebid/server/it/test-application.properties index 780fa391f0f..c8dc5ef74fa 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -142,8 +142,8 @@ adapters.aso.enabled=true adapters.aso.endpoint=http://localhost:8090/aso-exchange adapters.aso.aliases.bcmint.enabled=true adapters.aso.aliases.bcmint.endpoint=http://localhost:8090/bcmint-exchange -adapters.aso.aliases.bidagency.enabled=true -adapters.aso.aliases.bidagency.endpoint=http://localhost:8090/bidagency-exchange +adapters.aso.aliases.bidgency.enabled=true +adapters.aso.aliases.bidgency.endpoint=http://localhost:8090/bidgency-exchange adapters.aso.aliases.kuantyx.enabled=true adapters.aso.aliases.kuantyx.endpoint=http://localhost:8090/kuantyx-exchange adapters.automatad.enabled=true @@ -496,7 +496,7 @@ adapters.magnite.aliases.rubicon.enabled=true adapters.magnite.aliases.rubicon.endpoint=http://localhost:8090/rubicon-exchange adapters.magnite.XAPI.Username=magnite_user adapters.magnite.XAPI.Password=magnite_password -adapters.magnite.usersync.redirect.url=http://localhost:8090/rubicon-usersync?gdpr={gdpr}&gdpr_consent={gdpr_consent} +adapters.magnite.usersync.redirect.url=http://localhost:8090/magnite-usersync?gdpr={gdpr}&gdpr_consent={gdpr_consent} adapters.magnite.usersync.redirect.uid-macro=magnite-macro adapters.salunamedia.enabled=true adapters.salunamedia.endpoint=http://localhost:8090/salunamedia-exchange @@ -538,8 +538,8 @@ adapters.smarthub.aliases.addigi.enabled=true adapters.smarthub.aliases.addigi.endpoint=http://localhost:8090/addigi-exchange adapters.smarthub.aliases.artechnology.enabled=true adapters.smarthub.aliases.artechnology.endpoint=http://localhost:8090/artechnology-exchange -adapters.smarthub.aliases.radianfusion.enabled=true -adapters.smarthub.aliases.radianfusion.endpoint=http://localhost:8090/radianfusion-exchange +adapters.smarthub.aliases.radiantfusion.enabled=true +adapters.smarthub.aliases.radiantfusion.endpoint=http://localhost:8090/radiantfusion-exchange adapters.smartyads.enabled=true adapters.smartyads.endpoint=http://localhost:8090/smartyads-exchange adapters.smilewanted.enabled=true @@ -710,7 +710,7 @@ auction.category-mapping-enabled=true video.enable-deprecated-endpoint=true currency-converter.external-rates.enabled=true currency-converter.external-rates.url=http://localhost:8090/currency-rates -amp.custom-targeting=rubicon +amp.custom-targeting=magnite cache.scheme=http cache.host=localhost:8090 cache.path=/cache diff --git a/src/test/resources/org/prebid/server/it/uid/test-uid-response.json b/src/test/resources/org/prebid/server/it/uid/test-uid-response.json index 85c3341ce56..25260d5e4be 100644 --- a/src/test/resources/org/prebid/server/it/uid/test-uid-response.json +++ b/src/test/resources/org/prebid/server/it/uid/test-uid-response.json @@ -3,4 +3,4 @@ "rubicon": "J5VLCWQP-26-CWFT", "adnxs": "12345" } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/changed-put-bid-request.json b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/changed-put-bid-request.json index ab4b4d39252..0f001683eba 100644 --- a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/changed-put-bid-request.json +++ b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/changed-put-bid-request.json @@ -17,7 +17,7 @@ "impid": "impIdWasChanged", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -27,7 +27,7 @@ "impid": "impStoredBidResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -40,7 +40,7 @@ "crid": "crid1", "w": 300, "h": 250, - "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs", + "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs", "ext": { "rp": { "targeting": [ @@ -124,12 +124,12 @@ "crid": "crid2", "w": 300, "h": 600, - "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { "type": "xml", - "value": "", + "value": "", "expiry": 120 } ] diff --git a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/missing-put-bid-request.json b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/missing-put-bid-request.json index d72ed026ec2..58b572e1819 100644 --- a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/missing-put-bid-request.json +++ b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/missing-put-bid-request.json @@ -10,7 +10,7 @@ "crid": "crid2", "w": 300, "h": 600, - "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -51,7 +51,7 @@ "crid": "crid1", "w": 300, "h": 250, - "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs", + "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs", "ext": { "rp": { "targeting": [ @@ -112,7 +112,7 @@ "impid": "impStoredAuctionResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -122,12 +122,12 @@ "impid": "impStoredBidResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { "type": "xml", - "value": "", + "value": "", "expiry": 120 } ] diff --git a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/original-bid-request.json b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/original-bid-request.json index 10550f10900..c8889e1fc93 100644 --- a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/original-bid-request.json +++ b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/original-bid-request.json @@ -45,7 +45,7 @@ "impid": "impStoredAuctionResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -55,7 +55,7 @@ "impid": "impStoredBidResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -68,7 +68,7 @@ "crid": "crid1", "w": 300, "h": 250, - "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs", + "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs", "ext": { "rp": { "targeting": [ @@ -152,12 +152,12 @@ "crid": "crid2", "w": 300, "h": 600, - "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { "type": "xml", - "value": "", + "value": "", "expiry": 120 } ] diff --git a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/redundant-put-bid-request.json b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/redundant-put-bid-request.json index 6bc682d5835..7c1ca23ae8d 100644 --- a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/redundant-put-bid-request.json +++ b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/redundant-put-bid-request.json @@ -20,7 +20,7 @@ "crid": "crid2", "w": 300, "h": 600, - "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -91,7 +91,7 @@ "crid": "crid1", "w": 300, "h": 250, - "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs", + "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs", "ext": { "rp": { "targeting": [ @@ -152,7 +152,7 @@ "impid": "impStoredAuctionResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -162,12 +162,12 @@ "impid": "impStoredBidResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { "type": "xml", - "value": "", + "value": "", "expiry": 120 } ] diff --git a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/unordered-bid-request.json b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/unordered-bid-request.json index fdacf300534..f41b05cc7a2 100644 --- a/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/unordered-bid-request.json +++ b/src/test/resources/org/prebid/server/it/util/bidcacherequestpattern/unordered-bid-request.json @@ -10,7 +10,7 @@ "crid": "crid2", "w": 300, "h": 600, - "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=466223845&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -81,7 +81,7 @@ "crid": "crid1", "w": 300, "h": 250, - "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs", + "wurl": "http://localhost:8080/event?t=win&b=880290288&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs", "ext": { "rp": { "targeting": [ @@ -142,7 +142,7 @@ "impid": "impStoredAuctionResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c180&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { @@ -152,12 +152,12 @@ "impid": "impStoredBidResponse", "crid": "crid1", "price": 0.8, - "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=rubicon&f=i&int=dmbjs" + "wurl": "http://localhost:8080/event?t=win&b=f227a07f-1579-4465-bc5e-5c5b02a0c181&a=5001&ts=1000&bidder=magnite&f=i&int=dmbjs" } }, { "type": "xml", - "value": "", + "value": "", "expiry": 120 } ] diff --git a/src/test/resources/org/prebid/server/it/vtrack/test-cache-request.json b/src/test/resources/org/prebid/server/it/vtrack/test-cache-request.json index ca96583ef8c..03ff96937d4 100644 --- a/src/test/resources/org/prebid/server/it/vtrack/test-cache-request.json +++ b/src/test/resources/org/prebid/server/it/vtrack/test-cache-request.json @@ -2,7 +2,7 @@ "puts": [ { "type": "xml", - "value": "prebid.org wrapper", + "value": "prebid.org wrapper", "ttlseconds": 3600 } ] diff --git a/src/test/resources/org/prebid/server/it/vtrack/test-vtrack-request.json b/src/test/resources/org/prebid/server/it/vtrack/test-vtrack-request.json index 1be8338394a..11a8c631836 100644 --- a/src/test/resources/org/prebid/server/it/vtrack/test-vtrack-request.json +++ b/src/test/resources/org/prebid/server/it/vtrack/test-vtrack-request.json @@ -5,7 +5,7 @@ "value": "prebid.org wrapper", "ttlseconds": 3600, "bidid": "bidid", - "bidder": "rubicon", + "bidder": "magnite", "timestamp": 1000 } ] diff --git a/src/test/resources/org/prebid/server/it/vtrack/test-vtrack-response.xml b/src/test/resources/org/prebid/server/it/vtrack/test-vtrack-response.xml index 19e3ace7ba3..66f9475d9b7 100644 --- a/src/test/resources/org/prebid/server/it/vtrack/test-vtrack-response.xml +++ b/src/test/resources/org/prebid/server/it/vtrack/test-vtrack-response.xml @@ -5,7 +5,7 @@ - +