From 7ac95104a89d2e63d50435643356e3b23651c282 Mon Sep 17 00:00:00 2001 From: Danylo Date: Tue, 26 Mar 2024 02:51:19 +0200 Subject: [PATCH] Update whole logic of bidder. Refactor small things. --- .../bidder/adnuntius/AdnuntiusBidder.java | 341 +++++++++--------- .../model/request/AdnuntiusMetaData.java | 2 - .../adnuntius/model/response/AdnuntiusAd.java | 6 +- .../model/util/AdsUnitWithImpId.java | 16 - .../bidder/adnuntius/AdnuntiusBidderTest.java | 6 +- 5 files changed, 169 insertions(+), 202 deletions(-) delete mode 100644 src/main/java/org/prebid/server/bidder/adnuntius/model/util/AdsUnitWithImpId.java diff --git a/src/main/java/org/prebid/server/bidder/adnuntius/AdnuntiusBidder.java b/src/main/java/org/prebid/server/bidder/adnuntius/AdnuntiusBidder.java index 9ce8fe73496..3399e575653 100644 --- a/src/main/java/org/prebid/server/bidder/adnuntius/AdnuntiusBidder.java +++ b/src/main/java/org/prebid/server/bidder/adnuntius/AdnuntiusBidder.java @@ -17,6 +17,7 @@ import io.vertx.core.MultiMap; import io.vertx.core.http.HttpMethod; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.client.utils.URIBuilder; @@ -27,10 +28,9 @@ import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusAd; import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusAdsUnit; import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusBid; -import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusResponse; import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusGrossBid; import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusNetBid; -import org.prebid.server.bidder.adnuntius.model.util.AdsUnitWithImpId; +import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusResponse; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderCall; import org.prebid.server.bidder.model.BidderError; @@ -60,8 +60,8 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import java.util.stream.IntStream; -import java.util.stream.Stream; +import java.util.function.Function; +import java.util.stream.Collectors; public class AdnuntiusBidder implements Bidder { @@ -72,7 +72,6 @@ public class AdnuntiusBidder implements Bidder { private static final String TARGET_ID_DELIMITER = "-"; private static final String DEFAULT_PAGE = "unknown"; private static final String DEFAULT_NETWORK = "default"; - private static final String URL_NO_COOKIES_PARAMETER = "noCookies"; private static final BigDecimal PRICE_MULTIPLIER = BigDecimal.valueOf(1000); private final String endpointUrl; @@ -89,78 +88,24 @@ public AdnuntiusBidder(String endpointUrl, Clock clock, JacksonMapper mapper) { public Result>> makeHttpRequests(BidRequest request) { final Map> networkToAdUnits = new HashMap<>(); boolean noCookies = false; - final ExtUser extUser; - final ObjectNode siteExtData; - try { - extUser = extractUserExt(request.getUser()); - siteExtData = extractData(request.getSite()); - for (Imp imp : request.getImp()) { - final ExtImpAdnuntius extImpAdnuntius; + for (Imp imp : request.getImp()) { + final ExtImpAdnuntius extImpAdnuntius; + try { validateImp(imp); extImpAdnuntius = parseImpExt(imp); - - noCookies = resolveIsNoCookies(extImpAdnuntius); - final String network = resolveNetwork(extImpAdnuntius); - - networkToAdUnits.computeIfAbsent(network, n -> new ArrayList<>()) - .add(makeAdnuntiusAdUnit(imp, extImpAdnuntius)); + } catch (PreBidException e) { + return Result.withError(BidderError.badInput(e.getMessage())); } - } catch (PreBidException e) { - return Result.withError(BidderError.badInput(e.getMessage())); - } - return Result.withValues(createHttpRequests(networkToAdUnits, request, noCookies, extUser, siteExtData)); - } + noCookies = noCookies || resolveIsNoCookies(extImpAdnuntius); + final String network = resolveNetwork(extImpAdnuntius); - private static ExtUser extractUserExt(User user) { - return Optional.ofNullable(user) - .map(User::getExt) - .orElseThrow(() -> new PreBidException("Failed to parse user.ext")); - } - - private static ObjectNode extractData(Site site) { - return Optional.ofNullable(site) - .map(Site::getExt) - .map(ExtSite::getData) - .orElseThrow(() -> new PreBidException("Failed to parse site.ext.data")); - } - - private static AdnuntiusAdUnit makeAdnuntiusAdUnit(Imp imp, ExtImpAdnuntius extImpAdnuntius) { - final String auId = extImpAdnuntius.getAuId(); - return AdnuntiusAdUnit.builder() - .auId(auId) - .targetId(auId + TARGET_ID_DELIMITER + imp.getId()) - .dimensions(createDimensions(imp)) - .maxDeals(resolveMaxDeals(extImpAdnuntius)) - .build(); - } - - private static List> createDimensions(Imp imp) { - final Banner banner = imp.getBanner(); - - if (CollectionUtils.isNotEmpty(banner.getFormat())) { - final List> formats = new ArrayList<>(); - for (Format format : banner.getFormat()) { - if (format.getW() != null && format.getH() != null) { - formats.add(List.of(format.getW(), format.getH())); - } - } - return formats; + networkToAdUnits.computeIfAbsent(network, ignored -> new ArrayList<>()) + .add(makeAdUnit(imp, extImpAdnuntius)); } - if (banner.getW() != null && banner.getH() != null) { - return Collections.singletonList(List.of(banner.getW(), banner.getH())); - } - - return null; - } - - private static Integer resolveMaxDeals(ExtImpAdnuntius extImpAdnuntius) { - if (extImpAdnuntius.getMaxDeals() != null && extImpAdnuntius.getMaxDeals() > 0) { - return extImpAdnuntius.getMaxDeals(); - } - return null; + return Result.withValues(createHttpRequests(networkToAdUnits, request, noCookies)); } private static void validateImp(Imp imp) { @@ -180,64 +125,86 @@ private ExtImpAdnuntius parseImpExt(Imp imp) { private static boolean resolveIsNoCookies(ExtImpAdnuntius extImpAdnuntius) { return Optional.of(extImpAdnuntius) .map(ExtImpAdnuntius::getNoCookies) - .filter(BooleanUtils::isTrue) - .isPresent(); + .map(BooleanUtils::isTrue) + .orElse(false); } private static String resolveNetwork(ExtImpAdnuntius extImpAdnuntius) { return Optional.of(extImpAdnuntius) .map(ExtImpAdnuntius::getNetwork) - .filter(StringUtils::isNoneEmpty) + .filter(StringUtils::isNotEmpty) .orElse(DEFAULT_NETWORK); } - private List> createHttpRequests(Map> networkToAdUnits, - BidRequest request, Boolean noCookies, - ExtUser extUser, ObjectNode data) { + private static AdnuntiusAdUnit makeAdUnit(Imp imp, ExtImpAdnuntius extImpAdnuntius) { + final String auId = StringUtils.defaultString(extImpAdnuntius.getAuId()); + return AdnuntiusAdUnit.builder() + .auId(auId) + .targetId(targetId(auId, imp.getId())) + .dimensions(createDimensions(imp.getBanner())) + .maxDeals(resolveMaxDeals(extImpAdnuntius)) + .build(); + } - final List> adnuntiusRequests = new ArrayList<>(); + private static String targetId(String auId, String impId) { + return auId + TARGET_ID_DELIMITER + impId; + } + + private static List> createDimensions(Banner banner) { + final List> formats = new ArrayList<>(); + + final List bannerFormat = ListUtils.emptyIfNull(banner.getFormat()); + for (Format format : bannerFormat) { + final Integer w = format.getW(); + final Integer h = format.getH(); + if (w != null && h != null) { + formats.add(List.of(w, h)); + } + } + if (!formats.isEmpty()) { + return formats; + } + + final Integer w = banner.getW(); + final Integer h = banner.getH(); + if (w != null && h != null) { + formats.add(List.of(w, h)); + } + + return formats.isEmpty() ? null : formats; + } + + private static Integer resolveMaxDeals(ExtImpAdnuntius extImpAdnuntius) { + final Integer maxDeals = extImpAdnuntius.getMaxDeals(); + return maxDeals != null && maxDeals > 0 ? maxDeals : null; + } + + private List> createHttpRequests(Map> networkToAdUnits, + BidRequest request, + boolean noCookies) { - final String uidId = extractUidId(extUser); - final String metaData = createMetaData(request.getUser()); final Site site = request.getSite(); - final String page = extractPage(site); + final String uri = createUri(request, noCookies); - final Device device = request.getDevice(); + final String page = extractPage(site); + final ObjectNode data = extractData(site); + final AdnuntiusMetaData metaData = createMetaData(request.getUser()); + + final List> adnuntiusRequests = new ArrayList<>(); for (List adUnits : networkToAdUnits.values()) { final AdnuntiusRequest adnuntiusRequest = AdnuntiusRequest.builder() .adUnits(adUnits) .context(page) - .metaData(updateMetaData(uidId, metaData)) .keyValue(data) + .metaData(metaData) .build(); - adnuntiusRequests.add(createHttpRequest(adnuntiusRequest, uri, device)); + adnuntiusRequests.add(createHttpRequest(adnuntiusRequest, uri, request.getDevice())); } return adnuntiusRequests; } - private static String extractUidId(ExtUser extUser) { - return Optional.of(extUser) - .map(ExtUser::getEids) - .filter(CollectionUtils::isNotEmpty) - .map(a -> a.get(0)) - .map(Eid::getUids) - .filter(CollectionUtils::isNotEmpty) - .map(a -> a.get(0)) - .map(Uid::getId) - .orElse(null); - } - - private static String createMetaData(User user) { - final String userId = ObjectUtil.getIfNotNull(user, User::getId); - return StringUtils.isNotBlank(userId) ? userId : null; - } - - private static String extractPage(Site site) { - return StringUtils.defaultIfBlank(ObjectUtil.getIfNotNull(site, Site::getPage), DEFAULT_PAGE); - } - private String createUri(BidRequest bidRequest, Boolean noCookies) { try { final URIBuilder uriBuilder = new URIBuilder(endpointUrl) @@ -245,14 +212,17 @@ private String createUri(BidRequest bidRequest, Boolean noCookies) { .addParameter("tzo", getTimeZoneOffset()); final String gdpr = extractGdpr(bidRequest.getRegs()); - final String consent = extractConsent(bidRequest.getUser()); - if (StringUtils.isNoneEmpty(gdpr, consent)) { + if (StringUtils.isNotEmpty(gdpr)) { uriBuilder.addParameter("gdpr", gdpr); + } + + final String consent = extractConsent(bidRequest.getUser()); + if (StringUtils.isNotEmpty(consent)) { uriBuilder.addParameter("consentString", consent); } if (noCookies || extractNoCookies(bidRequest.getDevice())) { - uriBuilder.addParameter(URL_NO_COOKIES_PARAMETER, "true"); + uriBuilder.addParameter("noCookies", "true"); } return uriBuilder.build().toString(); @@ -261,51 +231,81 @@ private String createUri(BidRequest bidRequest, Boolean noCookies) { } } - private AdnuntiusMetaData updateMetaData(String eidsId, String metaData) { - if (metaData != null) { - return AdnuntiusMetaData.of(metaData); - } - if (eidsId != null) { - return AdnuntiusMetaData.of(eidsId); - } - return null; - } - private String getTimeZoneOffset() { return String.valueOf(-OffsetDateTime.now(clock).getOffset().getTotalSeconds() / SECONDS_IN_MINUTE); } private static String extractGdpr(Regs regs) { - final Integer gdpr = ObjectUtil.getIfNotNull(ObjectUtil.getIfNotNull(regs, Regs::getExt), ExtRegs::getGdpr); - return gdpr != null ? gdpr.toString() : null; + return Optional.ofNullable(regs) + .map(Regs::getExt) + .map(ExtRegs::getGdpr) + .map(Objects::toString) + .orElse(null); } private static String extractConsent(User user) { - return ObjectUtil.getIfNotNull(ObjectUtil.getIfNotNull(user, User::getExt), ExtUser::getConsent); + return Optional.ofNullable(user) + .map(User::getExt) + .map(ExtUser::getConsent) + .orElse(null); } - private static Boolean extractNoCookies(Device device) { + private static boolean extractNoCookies(Device device) { return Optional.ofNullable(device) .map(Device::getExt) .map(FlexibleExtension::getProperties) - .map(properties -> properties.get(URL_NO_COOKIES_PARAMETER)) + .map(properties -> properties.get("noCookies")) .filter(JsonNode::isBoolean) - .map(JsonNode::asBoolean) + .map(JsonNode::booleanValue) .orElse(false); } - private HttpRequest createHttpRequest(AdnuntiusRequest adnuntiusRequest, String uri, + private static String extractPage(Site site) { + return Optional.ofNullable(site) + .map(Site::getPage) + .filter(StringUtils::isNotEmpty) + .orElse(DEFAULT_PAGE); + } + + private static ObjectNode extractData(Site site) { + return Optional.ofNullable(site) + .map(Site::getExt) + .map(ExtSite::getData) + .orElse(null); + } + + private static AdnuntiusMetaData createMetaData(User user) { + final Optional userOptional = Optional.ofNullable(user); + return userOptional + .map(User::getId) + .filter(StringUtils::isNotEmpty) + .or(() -> userOptional + .map(User::getExt) + .map(ExtUser::getEids) + .filter(CollectionUtils::isNotEmpty) + .map(eids -> eids.get(0)) + .map(Eid::getUids) + .filter(CollectionUtils::isNotEmpty) + .map(uids -> uids.get(0)) + .map(Uid::getId)) + .map(AdnuntiusMetaData::of) + .orElse(null); + } + + private HttpRequest createHttpRequest(AdnuntiusRequest adnuntiusRequest, + String uri, Device device) { + return HttpRequest.builder() .method(HttpMethod.POST) - .headers(getHeaders(device)) + .headers(headers(device)) .uri(uri) .body(mapper.encodeToBytes(adnuntiusRequest)) .payload(adnuntiusRequest) .build(); } - private MultiMap getHeaders(Device device) { + private MultiMap headers(Device device) { final MultiMap headers = HttpUtil.headers(); if (device != null) { @@ -332,76 +332,59 @@ private List extractBids(BidRequest bidRequest, AdnuntiusResponse adn return Collections.emptyList(); } - final List adsUnits = adnuntiusResponse.getAdsUnits(); - final List imps = bidRequest.getImp(); - if (adsUnits.size() > imps.size()) { - throw new PreBidException("Impressions count is less then ads units count."); - } + final Map targetIdToAdsUnit = adnuntiusResponse.getAdsUnits().stream() + .filter(AdnuntiusBidder::validateAdsUnit) + .collect(Collectors.toMap(AdnuntiusAdsUnit::getTargetId, Function.identity())); - final List validAdsUnitToImp = IntStream.range(0, adsUnits.size()) - .mapToObj(i -> AdsUnitWithImpId.of(adsUnits.get(i), imps.get(i), parseImpExt(imps.get(i)))) - .filter(adsUnitWithImpId -> validateAdsUnit(adsUnitWithImpId.getAdsUnit())) - .toList(); + String currency = null; + final List bids = new ArrayList<>(); - if (validAdsUnitToImp.isEmpty()) { - return Collections.emptyList(); - } + for (Imp imp : bidRequest.getImp()) { + final ExtImpAdnuntius extImpAdnuntius = parseImpExt(imp); + final String targetId = targetId(StringUtils.defaultString(extImpAdnuntius.getAuId()), imp.getId()); - final String currency = extractCurrency(validAdsUnitToImp); - final Stream generalBids = validAdsUnitToImp.stream() - .map(adsUnitWithImpId -> makeGeneralBid(adsUnitWithImpId, currency)); + final AdnuntiusAdsUnit adsUnit = targetIdToAdsUnit.get(targetId); + if (adsUnit == null) { + continue; + } - final Stream dealBids = validAdsUnitToImp.stream() - .filter(adsUnitWithImpId -> CollectionUtils.isNotEmpty(adsUnitWithImpId.getAdsUnit().getDeals())) - .map(adsUnitWithImpId -> makeDealsBid(adsUnitWithImpId, currency)) - .filter(Objects::nonNull); + final AdnuntiusAd ad = adsUnit.getAds().get(0); + final String impId = imp.getId(); + final String bidType = extImpAdnuntius.getBidType(); + currency = ObjectUtil.getIfNotNull(ad.getBid(), AdnuntiusBid::getCurrency); - return Stream.concat(generalBids, dealBids).toList(); - } + bids.add(createBid(ad, adsUnit.getHtml(), impId, bidType)); - private static boolean validateAdsUnit(AdnuntiusAdsUnit adsUnit) { - final List ads = ObjectUtil.getIfNotNull(adsUnit, AdnuntiusAdsUnit::getAds); - return CollectionUtils.isNotEmpty(ads) && ads.get(0) != null; - } - - private static String extractCurrency(List adsUnits) { - final AdnuntiusBid bid = adsUnits.get(adsUnits.size() - 1).getAdsUnit().getAds().get(0).getBid(); - return ObjectUtil.getIfNotNull(bid, AdnuntiusBid::getCurrency); - } + for (AdnuntiusAd deal : ListUtils.emptyIfNull(adsUnit.getDeals())) { + bids.add(createBid(deal, deal.getHtml(), impId, bidType)); + } + } - private BidderBid makeGeneralBid(AdsUnitWithImpId adsUnitWithImpId, String currency) { - final AdnuntiusAdsUnit adsUnit = adsUnitWithImpId.getAdsUnit(); - final AdnuntiusAd ad = adsUnit.getAds().get(0); - final Bid bid = createBid(adsUnit, adsUnitWithImpId.getImp(), adsUnitWithImpId.getExtImpAdnuntius(), ad); - return BidderBid.of(bid, BidType.banner, currency); + final String lastCurrency = currency; + return bids.stream() + .map(bid -> BidderBid.of(bid, BidType.banner, lastCurrency)) + .toList(); } - private BidderBid makeDealsBid(AdsUnitWithImpId adsUnitWithImpId, String currency) { - final AdnuntiusAdsUnit adsUnit = adsUnitWithImpId.getAdsUnit(); - return adsUnit.getDeals().stream() - .map(adnuntiusAd -> - createBid(adsUnit, - adsUnitWithImpId.getImp(), - adsUnitWithImpId.getExtImpAdnuntius(), - adnuntiusAd)) - .map(bid -> BidderBid.of(bid, BidType.banner, currency)) - .findAny() - .orElse(null); + private static boolean validateAdsUnit(AdnuntiusAdsUnit adsUnit) { + final List ads = adsUnit != null ? adsUnit.getAds() : null; + return CollectionUtils.isNotEmpty(ads) && ads.get(0) != null; } - private static Bid createBid(AdnuntiusAdsUnit adsUnit, Imp imp, ExtImpAdnuntius extImpAdnuntius, AdnuntiusAd ad) { + private static Bid createBid(AdnuntiusAd ad, String adm, String impId, String bidType) { final String adId = ad.getAdId(); + return Bid.builder() .id(adId) - .impid(imp.getId()) + .impid(impId) .w(parseMeasure(ad.getCreativeWidth())) .h(parseMeasure(ad.getCreativeHeight())) .adid(adId) + .dealid(ad.getDealId()) .cid(ad.getLineItemId()) .crid(ad.getCreativeId()) - .price(resolvePrice(ad, extImpAdnuntius.getBidType())) - .dealid(ad.getDealId()) - .adm(adsUnit.getHtml()) + .price(resolvePrice(ad, bidType)) + .adm(adm) .adomain(extractDomain(ad.getDestinationUrls())) .build(); } @@ -421,10 +404,10 @@ private static BigDecimal resolvePrice(AdnuntiusAd ad, String bidType) { amount = ObjectUtil.getIfNotNull(ad.getBid(), AdnuntiusBid::getAmount); } if (StringUtils.endsWithIgnoreCase(bidType, "net")) { - amount = ObjectUtil.getIfNotNull(ad.getAdnuntiusNetBid(), AdnuntiusNetBid::getAmount); + amount = ObjectUtil.getIfNotNull(ad.getNetBid(), AdnuntiusNetBid::getAmount); } if (StringUtils.endsWithIgnoreCase(bidType, "gross")) { - amount = ObjectUtil.getIfNotNull(ad.getAdnuntiusGrossBid(), AdnuntiusGrossBid::getAmount); + amount = ObjectUtil.getIfNotNull(ad.getGrossBid(), AdnuntiusGrossBid::getAmount); } return amount != null ? amount.multiply(PRICE_MULTIPLIER) : BigDecimal.ZERO; @@ -435,7 +418,7 @@ private static List extractDomain(Map destinationUrls) { .filter(Objects::nonNull) .map(url -> url.split("/")) .filter(splintedUrl -> splintedUrl.length >= 2) - .map(splintedUrl -> splintedUrl[2].replaceAll("www\\.", "")) + .map(splintedUrl -> StringUtils.replace(splintedUrl[2], "www.", "")) .toList(); } } diff --git a/src/main/java/org/prebid/server/bidder/adnuntius/model/request/AdnuntiusMetaData.java b/src/main/java/org/prebid/server/bidder/adnuntius/model/request/AdnuntiusMetaData.java index d02557c690d..b077a3dce5f 100644 --- a/src/main/java/org/prebid/server/bidder/adnuntius/model/request/AdnuntiusMetaData.java +++ b/src/main/java/org/prebid/server/bidder/adnuntius/model/request/AdnuntiusMetaData.java @@ -1,11 +1,9 @@ package org.prebid.server.bidder.adnuntius.model.request; -import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Value; @Value(staticConstructor = "of") public class AdnuntiusMetaData { - @JsonInclude(JsonInclude.Include.NON_EMPTY) String usi; } diff --git a/src/main/java/org/prebid/server/bidder/adnuntius/model/response/AdnuntiusAd.java b/src/main/java/org/prebid/server/bidder/adnuntius/model/response/AdnuntiusAd.java index 59a61a06579..47ff2c30f04 100644 --- a/src/main/java/org/prebid/server/bidder/adnuntius/model/response/AdnuntiusAd.java +++ b/src/main/java/org/prebid/server/bidder/adnuntius/model/response/AdnuntiusAd.java @@ -13,10 +13,10 @@ public class AdnuntiusAd { AdnuntiusBid bid; @JsonProperty("netBid") - AdnuntiusNetBid adnuntiusNetBid; + AdnuntiusNetBid netBid; @JsonProperty("grossBid") - AdnuntiusGrossBid adnuntiusGrossBid; + AdnuntiusGrossBid grossBid; @JsonProperty("dealId") String dealId; @@ -36,6 +36,8 @@ public class AdnuntiusAd { @JsonProperty("lineItemId") String lineItemId; + String html; + @JsonProperty("destinationUrls") Map destinationUrls; } diff --git a/src/main/java/org/prebid/server/bidder/adnuntius/model/util/AdsUnitWithImpId.java b/src/main/java/org/prebid/server/bidder/adnuntius/model/util/AdsUnitWithImpId.java deleted file mode 100644 index 339df114d43..00000000000 --- a/src/main/java/org/prebid/server/bidder/adnuntius/model/util/AdsUnitWithImpId.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.prebid.server.bidder.adnuntius.model.util; - -import com.iab.openrtb.request.Imp; -import lombok.Value; -import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusAdsUnit; -import org.prebid.server.proto.openrtb.ext.request.adnuntius.ExtImpAdnuntius; - -@Value(staticConstructor = "of") -public class AdsUnitWithImpId { - - AdnuntiusAdsUnit adsUnit; - - Imp imp; - - ExtImpAdnuntius extImpAdnuntius; -} diff --git a/src/test/java/org/prebid/server/bidder/adnuntius/AdnuntiusBidderTest.java b/src/test/java/org/prebid/server/bidder/adnuntius/AdnuntiusBidderTest.java index 7e74e112f4f..19a2f6c76b4 100644 --- a/src/test/java/org/prebid/server/bidder/adnuntius/AdnuntiusBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/adnuntius/AdnuntiusBidderTest.java @@ -26,9 +26,9 @@ import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusAd; import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusAdsUnit; import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusBid; -import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusResponse; import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusGrossBid; import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusNetBid; +import org.prebid.server.bidder.adnuntius.model.response.AdnuntiusResponse; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderCall; import org.prebid.server.bidder.model.BidderError; @@ -685,7 +685,7 @@ public void makeBidsShouldUseCurrencyOfFirstBidOfLastAdsUnit() throws JsonProces public void makeBidsShouldPopulateGrossBidPriceWhenGrossBidSpecified() throws JsonProcessingException { // given final BidderCall httpCall = givenHttpCall(givenAdsUnitWithAds( - givenAd(ad -> ad.adnuntiusGrossBid(AdnuntiusGrossBid.of(BigDecimal.ONE))))); + givenAd(ad -> ad.grossBid(AdnuntiusGrossBid.of(BigDecimal.ONE))))); final BidRequest bidRequest = givenBidRequest( givenImp(ExtImpAdnuntius.builder().bidType("gross").build(), identity())); @@ -704,7 +704,7 @@ public void makeBidsShouldPopulateGrossBidPriceWhenGrossBidSpecified() throws Js public void makeBidsShouldPopulateNetBidPriceWhenGrossBidSpecified() throws JsonProcessingException { // given final BidderCall httpCall = givenHttpCall(givenAdsUnitWithAds( - givenAd(ad -> ad.adnuntiusNetBid(AdnuntiusNetBid.of(BigDecimal.ONE))))); + givenAd(ad -> ad.netBid(AdnuntiusNetBid.of(BigDecimal.ONE))))); final BidRequest bidRequest = givenBidRequest( givenImp(ExtImpAdnuntius.builder().bidType("net").build(), identity()));