From c431768b8a600be376087c85667c726acf5d658e Mon Sep 17 00:00:00 2001 From: antonbabak Date: Wed, 21 Aug 2024 10:35:53 +0200 Subject: [PATCH] Adtarget and Adtelligent Bidders: Change Aid Type --- .../bidder/adtarget/AdtargetBidder.java | 20 +++++++++--- .../bidder/adtarget/proto/AdtargetImpExt.java | 7 ++--- .../proto/ExtImpAdtargetBidRequest.java | 31 +++++++++++++++++++ .../bidder/adtelligent/AdtelligentBidder.java | 19 +++++++++--- .../adtelligent/proto/AdtelligentImpExt.java | 7 ++--- .../proto/ExtImpAdtelligentBidRequest.java | 31 +++++++++++++++++++ .../ext/request/adtarget/ExtImpAdtarget.java | 21 ++----------- .../adtelligent/ExtImpAdtelligent.java | 21 ++----------- .../static/bidder-params/adtelligent.json | 6 ++-- .../bidder/adtarget/AdtargetBidderTest.java | 17 +++++----- .../adtelligent/AdtelligentBidderTest.java | 19 ++++++------ .../validation/BidderParamValidatorTest.java | 2 +- 12 files changed, 124 insertions(+), 77 deletions(-) create mode 100644 src/main/java/org/prebid/server/bidder/adtarget/proto/ExtImpAdtargetBidRequest.java create mode 100644 src/main/java/org/prebid/server/bidder/adtelligent/proto/ExtImpAdtelligentBidRequest.java diff --git a/src/main/java/org/prebid/server/bidder/adtarget/AdtargetBidder.java b/src/main/java/org/prebid/server/bidder/adtarget/AdtargetBidder.java index 606fc880894..76e716325f4 100644 --- a/src/main/java/org/prebid/server/bidder/adtarget/AdtargetBidder.java +++ b/src/main/java/org/prebid/server/bidder/adtarget/AdtargetBidder.java @@ -11,6 +11,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.prebid.server.bidder.Bidder; import org.prebid.server.bidder.adtarget.proto.AdtargetImpExt; +import org.prebid.server.bidder.adtarget.proto.ExtImpAdtargetBidRequest; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderCall; import org.prebid.server.bidder.model.BidderError; @@ -67,16 +68,16 @@ private Result>> mapSourceIdToImp(List imps) { final Map> sourceToImps = new HashMap<>(); for (Imp imp : imps) { final ExtImpAdtarget extImpAdtarget; + final Integer sourceId; try { validateImpression(imp); extImpAdtarget = parseImpAdtarget(imp); + sourceId = resolveSourceId(imp.getId(), extImpAdtarget.getSourceId()); } catch (PreBidException e) { errors.add(BidderError.badInput(e.getMessage())); continue; } - final Imp updatedImp = updateImp(imp, extImpAdtarget); - - final Integer sourceId = extImpAdtarget.getSourceId(); + final Imp updatedImp = updateImp(imp, sourceId, extImpAdtarget); sourceToImps.computeIfAbsent(sourceId, ignored -> new ArrayList<>()).add(updatedImp); } return Result.of(sourceToImps, errors); @@ -103,8 +104,9 @@ private static void validateImpression(Imp imp) { } } - private Imp updateImp(Imp imp, ExtImpAdtarget extImpAdtarget) { - final AdtargetImpExt adtargetImpExt = AdtargetImpExt.of(extImpAdtarget); + private Imp updateImp(Imp imp, Integer sourceId, ExtImpAdtarget extImpAdtarget) { + final AdtargetImpExt adtargetImpExt = AdtargetImpExt.of( + ExtImpAdtargetBidRequest.from(sourceId, extImpAdtarget)); final BigDecimal bidFloor = extImpAdtarget.getBidFloor(); return imp.toBuilder() .bidfloor(BidderUtil.isValidPrice(bidFloor) ? bidFloor : imp.getBidfloor()) @@ -112,6 +114,14 @@ private Imp updateImp(Imp imp, ExtImpAdtarget extImpAdtarget) { .build(); } + private static Integer resolveSourceId(String impId, String sourceId) { + try { + return sourceId == null ? 0 : Integer.parseInt(sourceId); + } catch (NumberFormatException e) { + throw new PreBidException("ignoring imp id=%s, aid parsing err: %s".formatted(impId, e.getMessage())); + } + } + @Override public Result> makeBids(BidderCall httpCall, BidRequest bidRequest) { final List errors = new ArrayList<>(); diff --git a/src/main/java/org/prebid/server/bidder/adtarget/proto/AdtargetImpExt.java b/src/main/java/org/prebid/server/bidder/adtarget/proto/AdtargetImpExt.java index 4fc2177fbf0..3a2ec0278f4 100644 --- a/src/main/java/org/prebid/server/bidder/adtarget/proto/AdtargetImpExt.java +++ b/src/main/java/org/prebid/server/bidder/adtarget/proto/AdtargetImpExt.java @@ -1,14 +1,11 @@ package org.prebid.server.bidder.adtarget.proto; import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; import lombok.Value; -import org.prebid.server.proto.openrtb.ext.request.adtarget.ExtImpAdtarget; -@AllArgsConstructor(staticName = "of") -@Value +@Value(staticConstructor = "of") public class AdtargetImpExt { @JsonProperty("adtarget") - ExtImpAdtarget extImpAdtarget; + ExtImpAdtargetBidRequest extImp; } diff --git a/src/main/java/org/prebid/server/bidder/adtarget/proto/ExtImpAdtargetBidRequest.java b/src/main/java/org/prebid/server/bidder/adtarget/proto/ExtImpAdtargetBidRequest.java new file mode 100644 index 00000000000..0abfc880e74 --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/adtarget/proto/ExtImpAdtargetBidRequest.java @@ -0,0 +1,31 @@ +package org.prebid.server.bidder.adtarget.proto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Value; +import org.prebid.server.proto.openrtb.ext.request.adtarget.ExtImpAdtarget; + +import java.math.BigDecimal; + +@Value(staticConstructor = "of") +public class ExtImpAdtargetBidRequest { + + @JsonProperty("aid") + Integer sourceId; + + @JsonProperty("placementId") + Integer placementId; + + @JsonProperty("siteId") + Integer siteId; + + @JsonProperty("bidFloor") + BigDecimal bidFloor; + + public static ExtImpAdtargetBidRequest from(Integer sourceId, ExtImpAdtarget impExt) { + return ExtImpAdtargetBidRequest.of( + sourceId, + impExt.getPlacementId(), + impExt.getSiteId(), + impExt.getBidFloor()); + } +} diff --git a/src/main/java/org/prebid/server/bidder/adtelligent/AdtelligentBidder.java b/src/main/java/org/prebid/server/bidder/adtelligent/AdtelligentBidder.java index 1c88bed9005..404d83b9052 100644 --- a/src/main/java/org/prebid/server/bidder/adtelligent/AdtelligentBidder.java +++ b/src/main/java/org/prebid/server/bidder/adtelligent/AdtelligentBidder.java @@ -13,6 +13,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.prebid.server.bidder.Bidder; import org.prebid.server.bidder.adtelligent.proto.AdtelligentImpExt; +import org.prebid.server.bidder.adtelligent.proto.ExtImpAdtelligentBidRequest; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderCall; import org.prebid.server.bidder.model.BidderError; @@ -86,16 +87,17 @@ private Result>> mapSourceIdToImp(List imps) { final Map> sourceToImps = new HashMap<>(); for (final Imp imp : imps) { final ExtImpAdtelligent extImpAdtelligent; + final Integer sourceId; try { validateImpression(imp); extImpAdtelligent = getExtImpAdtelligent(imp); + sourceId = resolveSourceId(imp.getId(), extImpAdtelligent.getSourceId()); } catch (PreBidException e) { errors.add(BidderError.badInput(e.getMessage())); continue; } - final Imp updatedImp = updateImp(imp, extImpAdtelligent); + final Imp updatedImp = updateImp(imp, sourceId, extImpAdtelligent); - final Integer sourceId = extImpAdtelligent.getSourceId(); final List sourceIdImps = sourceToImps.get(sourceId); if (sourceIdImps == null) { sourceToImps.put(sourceId, new ArrayList<>(Collections.singleton(updatedImp))); @@ -164,8 +166,9 @@ private void validateImpression(Imp imp) { /** * Updates {@link Imp} with bidfloor if it is present in imp.ext.bidder */ - private Imp updateImp(Imp imp, ExtImpAdtelligent extImpAdtelligent) { - final AdtelligentImpExt adtelligentImpExt = AdtelligentImpExt.of(extImpAdtelligent); + private Imp updateImp(Imp imp, Integer sourceId, ExtImpAdtelligent extImpAdtelligent) { + final AdtelligentImpExt adtelligentImpExt = AdtelligentImpExt.of( + ExtImpAdtelligentBidRequest.from(sourceId, extImpAdtelligent)); final BigDecimal bidFloor = extImpAdtelligent.getBidFloor(); return imp.toBuilder() .bidfloor(BidderUtil.isValidPrice(bidFloor) ? bidFloor : imp.getBidfloor()) @@ -173,6 +176,14 @@ private Imp updateImp(Imp imp, ExtImpAdtelligent extImpAdtelligent) { .build(); } + private static Integer resolveSourceId(String impId, String sourceId) { + try { + return sourceId == null ? 0 : Integer.parseInt(sourceId); + } catch (NumberFormatException e) { + throw new PreBidException("ignoring imp id=%s, aid parsing err: %s".formatted(impId, e.getMessage())); + } + } + /** * Extracts {@link Bid}s from response. */ diff --git a/src/main/java/org/prebid/server/bidder/adtelligent/proto/AdtelligentImpExt.java b/src/main/java/org/prebid/server/bidder/adtelligent/proto/AdtelligentImpExt.java index ac23f7dd218..fc0bdd642a7 100644 --- a/src/main/java/org/prebid/server/bidder/adtelligent/proto/AdtelligentImpExt.java +++ b/src/main/java/org/prebid/server/bidder/adtelligent/proto/AdtelligentImpExt.java @@ -1,14 +1,11 @@ package org.prebid.server.bidder.adtelligent.proto; import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; import lombok.Value; -import org.prebid.server.proto.openrtb.ext.request.adtelligent.ExtImpAdtelligent; -@AllArgsConstructor(staticName = "of") -@Value +@Value(staticConstructor = "of") public class AdtelligentImpExt { @JsonProperty("adtelligent") - ExtImpAdtelligent extImpAdtelligent; + ExtImpAdtelligentBidRequest extImp; } diff --git a/src/main/java/org/prebid/server/bidder/adtelligent/proto/ExtImpAdtelligentBidRequest.java b/src/main/java/org/prebid/server/bidder/adtelligent/proto/ExtImpAdtelligentBidRequest.java new file mode 100644 index 00000000000..e543e6a8e39 --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/adtelligent/proto/ExtImpAdtelligentBidRequest.java @@ -0,0 +1,31 @@ +package org.prebid.server.bidder.adtelligent.proto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Value; +import org.prebid.server.proto.openrtb.ext.request.adtelligent.ExtImpAdtelligent; + +import java.math.BigDecimal; + +@Value(staticConstructor = "of") +public class ExtImpAdtelligentBidRequest { + + @JsonProperty("aid") + Integer sourceId; + + @JsonProperty("placementId") + Integer placementId; + + @JsonProperty("siteId") + Integer siteId; + + @JsonProperty("bidFloor") + BigDecimal bidFloor; + + public static ExtImpAdtelligentBidRequest from(Integer sourceId, ExtImpAdtelligent impExt) { + return ExtImpAdtelligentBidRequest.of( + sourceId, + impExt.getPlacementId(), + impExt.getSiteId(), + impExt.getBidFloor()); + } +} diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/adtarget/ExtImpAdtarget.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/adtarget/ExtImpAdtarget.java index 04105dd73d8..268ccd077ec 100644 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/adtarget/ExtImpAdtarget.java +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/adtarget/ExtImpAdtarget.java @@ -1,39 +1,22 @@ package org.prebid.server.proto.openrtb.ext.request.adtarget; import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; import lombok.Value; import java.math.BigDecimal; -/** - * Defines the contract for bidrequest.imp[i].ext.adtarget - */ -@AllArgsConstructor(staticName = "of") -@Value +@Value(staticConstructor = "of") public class ExtImpAdtarget { - /** - * Defines the contract for bidrequest.imp[i].ext.adtarget.aid - */ @JsonProperty("aid") - Integer sourceId; + String sourceId; - /** - * Defines the contract for bidrequest.imp[i].ext.adtarget.placementId - */ @JsonProperty("placementId") Integer placementId; - /** - * Defines the contract for bidrequest.imp[i].ext.adtarget.siteId - */ @JsonProperty("siteId") Integer siteId; - /** - * Defines the contract for bidrequest.imp[i].ext.adtarget.bidFloor - */ @JsonProperty("bidFloor") BigDecimal bidFloor; } diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/adtelligent/ExtImpAdtelligent.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/adtelligent/ExtImpAdtelligent.java index 907932dd44b..00df38b9533 100644 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/adtelligent/ExtImpAdtelligent.java +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/adtelligent/ExtImpAdtelligent.java @@ -1,39 +1,22 @@ package org.prebid.server.proto.openrtb.ext.request.adtelligent; import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; import lombok.Value; import java.math.BigDecimal; -/** - * Defines the contract for bidrequest.imp[i].ext.adtelligent - */ -@AllArgsConstructor(staticName = "of") -@Value +@Value(staticConstructor = "of") public class ExtImpAdtelligent { - /** - * Defines the contract for bidrequest.imp[i].ext.adtelligent.aid - */ @JsonProperty("aid") - Integer sourceId; + String sourceId; - /** - * Defines the contract for bidrequest.imp[i].ext.adtelligent.placementId - */ @JsonProperty("placementId") Integer placementId; - /** - * Defines the contract for bidrequest.imp[i].ext.adtelligent.siteId - */ @JsonProperty("siteId") Integer siteId; - /** - * Defines the contract for bidrequest.imp[i].ext.adtelligent.bidFloor - */ @JsonProperty("bidFloor") BigDecimal bidFloor; } diff --git a/src/main/resources/static/bidder-params/adtelligent.json b/src/main/resources/static/bidder-params/adtelligent.json index db7931e1ec0..e8dedf33690 100644 --- a/src/main/resources/static/bidder-params/adtelligent.json +++ b/src/main/resources/static/bidder-params/adtelligent.json @@ -2,7 +2,6 @@ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Adtelligent Adapter Params", "description": "A schema which validates params accepted by the Adtelligent adapter", - "type": "object", "properties": { "placementId": { @@ -14,7 +13,10 @@ "description": "An ID which identifies the site selling the impression" }, "aid": { - "type": "integer", + "type": [ + "integer", + "string" + ], "description": "An ID which identifies the channel" }, "bidFloor": { diff --git a/src/test/java/org/prebid/server/bidder/adtarget/AdtargetBidderTest.java b/src/test/java/org/prebid/server/bidder/adtarget/AdtargetBidderTest.java index acf7fdc44df..5ff7e138eed 100644 --- a/src/test/java/org/prebid/server/bidder/adtarget/AdtargetBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/adtarget/AdtargetBidderTest.java @@ -15,6 +15,7 @@ import org.junit.jupiter.api.Test; import org.prebid.server.VertxTest; import org.prebid.server.bidder.adtarget.proto.AdtargetImpExt; +import org.prebid.server.bidder.adtarget.proto.ExtImpAdtargetBidRequest; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderCall; import org.prebid.server.bidder.model.BidderError; @@ -59,7 +60,7 @@ public void makeHttpRequestsShouldReturnHttpRequestWithCorrectBodyHeadersAndMeth .imp(singletonList(bidRequest.getImp().getFirst().toBuilder() .bidfloor(BigDecimal.valueOf(3)) .ext(mapper.valueToTree(AdtargetImpExt.of( - ExtImpAdtarget.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtImpAdtargetBidRequest.of(15, 1, 2, BigDecimal.valueOf(3))))) .build())) .build(); assertThat(result.getErrors()).isEmpty(); @@ -133,7 +134,7 @@ public void makeHttpRequestShouldReturnHttpRequestWithErrorMessage() { .id("impId2") .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtarget.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtarget.of("15", 1, 2, BigDecimal.valueOf(3))))) .build())) .build(); @@ -157,7 +158,7 @@ public void makeHttpRequestShouldReturnWithBidFloorPopulatedFromImpWhenIsMissedI .imp(singletonList(Imp.builder() .banner(Banner.builder().build()) .bidfloor(BigDecimal.valueOf(16)) - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpAdtarget.of(15, 1, 2, null)))) + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpAdtarget.of("15", 1, 2, null)))) .build())) .build(); @@ -179,12 +180,12 @@ public void makeHttpRequestShouldReturnTwoHttpRequestsWhenTwoImpsHasDifferentSou .imp(asList(Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtarget.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtarget.of("15", 1, 2, BigDecimal.valueOf(3))))) .build(), Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtarget.of(16, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtarget.of("16", 1, 2, BigDecimal.valueOf(3))))) .build())) .build(); @@ -224,12 +225,12 @@ public void makeHttpRequestShouldReturnOneHttpRequestForTowImpsWhenImpsHasSameSo .imp(asList(Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtarget.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtarget.of("15", 1, 2, BigDecimal.valueOf(3))))) .build(), Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtarget.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtarget.of("15", 1, 2, BigDecimal.valueOf(3))))) .build())) .build(); @@ -409,7 +410,7 @@ private static Imp givenImp(Function impCustomiz .id("impId") .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtarget.of(15, 1, 2, BigDecimal.valueOf(3)))))) + ExtPrebid.of(null, ExtImpAdtarget.of("15", 1, 2, BigDecimal.valueOf(3)))))) .build(); } diff --git a/src/test/java/org/prebid/server/bidder/adtelligent/AdtelligentBidderTest.java b/src/test/java/org/prebid/server/bidder/adtelligent/AdtelligentBidderTest.java index 7b313298441..863d94806e1 100644 --- a/src/test/java/org/prebid/server/bidder/adtelligent/AdtelligentBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/adtelligent/AdtelligentBidderTest.java @@ -15,6 +15,7 @@ import org.junit.jupiter.api.Test; import org.prebid.server.VertxTest; import org.prebid.server.bidder.adtelligent.proto.AdtelligentImpExt; +import org.prebid.server.bidder.adtelligent.proto.ExtImpAdtelligentBidRequest; import org.prebid.server.bidder.model.BidderBid; import org.prebid.server.bidder.model.BidderCall; import org.prebid.server.bidder.model.BidderError; @@ -51,7 +52,7 @@ public void makeHttpRequestsShouldReturnHttpRequestWithCorrectBodyHeadersAndMeth .imp(singletonList(Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtelligent.of(15, 1, 2, BigDecimal.valueOf(3))))).build())) + ExtPrebid.of(null, ExtImpAdtelligent.of("15", 1, 2, BigDecimal.valueOf(3))))).build())) .user(User.builder() .ext(ExtUser.builder().consent("consent").build()) .build()) @@ -77,7 +78,7 @@ public void makeHttpRequestsShouldReturnHttpRequestWithCorrectBodyHeadersAndMeth .banner(Banner.builder().build()) .bidfloor(BigDecimal.valueOf(3)) .ext(mapper.valueToTree(AdtelligentImpExt.of( - ExtImpAdtelligent.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtImpAdtelligentBidRequest.of(15, 1, 2, BigDecimal.valueOf(3))))) .build())) .user(User.builder() .ext(ExtUser.builder().consent("consent").build()) @@ -93,7 +94,7 @@ public void makeHttpRequestShouldReturnErrorMessageWhenMediaTypeWasNotDefined() .imp(singletonList(Imp.builder() .id("impId") .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtelligent.of(15, 1, 2, BigDecimal.valueOf(3))))).build())) + ExtPrebid.of(null, ExtImpAdtelligent.of("15", 1, 2, BigDecimal.valueOf(3))))).build())) .build(); // when @@ -136,7 +137,7 @@ public void makeHttpRequestShouldReturnHttpRequestWithErrorMessage() { .id("impId2") .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtelligent.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtelligent.of("15", 1, 2, BigDecimal.valueOf(3))))) .build())) .build(); @@ -160,7 +161,7 @@ public void makeHttpRequestShouldReturnWithBidFloorPopulatedFromImpWhenIsMissedI .imp(singletonList(Imp.builder() .banner(Banner.builder().build()) .bidfloor(BigDecimal.valueOf(16)) - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpAdtelligent.of(15, 1, 2, null)))) + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpAdtelligent.of("15", 1, 2, null)))) .build())) .build(); @@ -182,12 +183,12 @@ public void makeHttpRequestShouldReturnTwoHttpRequestsWhenTwoImpsHasDifferentSou .imp(asList(Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtelligent.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtelligent.of("15", 1, 2, BigDecimal.valueOf(3))))) .build(), Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtelligent.of(16, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtelligent.of("16", 1, 2, BigDecimal.valueOf(3))))) .build())) .build(); @@ -206,12 +207,12 @@ public void makeHttpRequestShouldReturnOneHttpRequestForTowImpsWhenImpsHasSameSo .imp(asList(Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtelligent.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtelligent.of("15", 1, 2, BigDecimal.valueOf(3))))) .build(), Imp.builder() .banner(Banner.builder().build()) .ext(mapper.valueToTree( - ExtPrebid.of(null, ExtImpAdtelligent.of(15, 1, 2, BigDecimal.valueOf(3))))) + ExtPrebid.of(null, ExtImpAdtelligent.of("15", 1, 2, BigDecimal.valueOf(3))))) .build())) .build(); diff --git a/src/test/java/org/prebid/server/validation/BidderParamValidatorTest.java b/src/test/java/org/prebid/server/validation/BidderParamValidatorTest.java index 1c9c609932c..863ce3bb53b 100644 --- a/src/test/java/org/prebid/server/validation/BidderParamValidatorTest.java +++ b/src/test/java/org/prebid/server/validation/BidderParamValidatorTest.java @@ -203,7 +203,7 @@ public void validateShouldReturnValidationMessagesWhenSovrnExtNotValid() { @Test public void validateShouldNotReturnValidationMessagesWhenAdtelligentImpExtIsOk() { // given - final ExtImpAdtelligent ext = ExtImpAdtelligent.of(15, 1, 2, BigDecimal.valueOf(3)); + final ExtImpAdtelligent ext = ExtImpAdtelligent.of("15", 1, 2, BigDecimal.valueOf(3)); final JsonNode node = mapper.convertValue(ext, JsonNode.class);