From 5e22d2d92f20325b6bcd950712bd3416100cdbfd Mon Sep 17 00:00:00 2001 From: oath-jac Date: Tue, 27 Jun 2023 13:11:36 +0300 Subject: [PATCH 1/5] YahooAdvertising rebranding to Yahoo Ads. --- .../YahooAdsBidder.java} | 42 ++++++------- .../ext/request/yahooads/ExtImpYahooAds.java | 16 +++++ .../ExtImpYahooAdvertising.java | 16 ----- ...ration.java => YahooAdsConfiguration.java} | 18 +++--- .../{yahooAdvertising.yaml => yahooAds.yaml} | 8 ++- .../{yahooAdvertising.json => yahooAds.json} | 0 .../YahooAdsBidderTest.java} | 62 +++++++++---------- ...AdvertisingTest.java => YahooAdsTest.java} | 16 ++--- .../test-auction-yahooads-request.json} | 2 +- .../test-auction-yahooads-response.json} | 4 +- .../test-yahooads-bid-request.json} | 0 .../test-yahooads-bid-response.json} | 0 .../server/it/test-application.properties | 4 +- 13 files changed, 95 insertions(+), 93 deletions(-) rename src/main/java/org/prebid/server/bidder/{yahooadvertising/YahooAdvertisingBidder.java => yahooads/YahooAdsBidder.java} (88%) create mode 100644 src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java delete mode 100644 src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooadvertising/ExtImpYahooAdvertising.java rename src/main/java/org/prebid/server/spring/config/bidder/{YahooAdvertisingConfiguration.java => YahooAdsConfiguration.java} (66%) rename src/main/resources/bidder-config/{yahooAdvertising.yaml => yahooAds.yaml} (78%) rename src/main/resources/static/bidder-params/{yahooAdvertising.json => yahooAds.json} (100%) rename src/test/java/org/prebid/server/bidder/{yahooadvertising/YahooAdvertisingBidderTest.java => yahooads/YahooAdsBidderTest.java} (90%) rename src/test/java/org/prebid/server/it/{YahooAdvertisingTest.java => YahooAdsTest.java} (54%) rename src/test/resources/org/prebid/server/it/openrtb2/{yahooadvertising/test-auction-yahooadvertising-request.json => yahooads/test-auction-yahooads-request.json} (91%) rename src/test/resources/org/prebid/server/it/openrtb2/{yahooadvertising/test-auction-yahooadvertising-response.json => yahooads/test-auction-yahooads-response.json} (84%) rename src/test/resources/org/prebid/server/it/openrtb2/{yahooadvertising/test-yahooadvertising-bid-request.json => yahooads/test-yahooads-bid-request.json} (100%) rename src/test/resources/org/prebid/server/it/openrtb2/{yahooadvertising/test-yahooadvertising-bid-response.json => yahooads/test-yahooads-bid-response.json} (100%) diff --git a/src/main/java/org/prebid/server/bidder/yahooadvertising/YahooAdvertisingBidder.java b/src/main/java/org/prebid/server/bidder/yahooads/YahooAdsBidder.java similarity index 88% rename from src/main/java/org/prebid/server/bidder/yahooadvertising/YahooAdvertisingBidder.java rename to src/main/java/org/prebid/server/bidder/yahooads/YahooAdsBidder.java index f76e7218753..e01a18cdfbf 100644 --- a/src/main/java/org/prebid/server/bidder/yahooadvertising/YahooAdvertisingBidder.java +++ b/src/main/java/org/prebid/server/bidder/yahooads/YahooAdsBidder.java @@ -1,4 +1,4 @@ -package org.prebid.server.bidder.yahooadvertising; +package org.prebid.server.bidder.yahooads; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.node.ArrayNode; @@ -34,7 +34,7 @@ import org.prebid.server.proto.openrtb.ext.ExtPrebid; import org.prebid.server.proto.openrtb.ext.FlexibleExtension; import org.prebid.server.proto.openrtb.ext.request.ExtRegs; -import org.prebid.server.proto.openrtb.ext.request.yahooadvertising.ExtImpYahooAdvertising; +import org.prebid.server.proto.openrtb.ext.request.yahooads.ExtImpYahooAds; import org.prebid.server.proto.openrtb.ext.response.BidType; import org.prebid.server.util.HttpUtil; @@ -45,9 +45,9 @@ import java.util.Objects; import java.util.Optional; -public class YahooAdvertisingBidder implements Bidder { +public class YahooAdsBidder implements Bidder { - private static final TypeReference> YAHOO_ADVERTISING_EXT_TYPE_REFERENCE = + private static final TypeReference> YAHOO_ADVERTISING_EXT_TYPE_REFERENCE = new TypeReference<>() { }; @@ -55,9 +55,9 @@ public class YahooAdvertisingBidder implements Bidder { private final BidRequestOrtbVersionConversionManager conversionManager; private final JacksonMapper mapper; - public YahooAdvertisingBidder(String endpointUrl, - BidRequestOrtbVersionConversionManager conversionManager, - JacksonMapper mapper) { + public YahooAdsBidder(String endpointUrl, + BidRequestOrtbVersionConversionManager conversionManager, + JacksonMapper mapper) { this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); this.mapper = Objects.requireNonNull(mapper); this.conversionManager = Objects.requireNonNull(conversionManager); @@ -76,8 +76,8 @@ public Result>> makeHttpRequests(BidRequest bidRequ for (int i = 0; i < impList.size(); i++) { try { final Imp imp = impList.get(i); - final ExtImpYahooAdvertising extImpYahooAdvertising = parseAndValidateImpExt(imp.getExt(), i); - final BidRequest modifiedRequest = modifyRequest(bidRequestOpenRtb25, imp, extImpYahooAdvertising, + final ExtImpYahooAds extImpYahooAds = parseAndValidateImpExt(imp.getExt(), i); + final BidRequest modifiedRequest = modifyRequest(bidRequestOpenRtb25, imp, extImpYahooAds, regs); bidRequests.add(makeHttpRequest(modifiedRequest)); } catch (PreBidException e) { @@ -88,29 +88,29 @@ public Result>> makeHttpRequests(BidRequest bidRequ return Result.of(bidRequests, errors); } - private ExtImpYahooAdvertising parseAndValidateImpExt(ObjectNode impExtNode, int index) { - final ExtImpYahooAdvertising extImpYahooAdvertising; + private ExtImpYahooAds parseAndValidateImpExt(ObjectNode impExtNode, int index) { + final ExtImpYahooAds extImpYahooAds; try { - extImpYahooAdvertising = mapper.mapper().convertValue(impExtNode, + extImpYahooAds = mapper.mapper().convertValue(impExtNode, YAHOO_ADVERTISING_EXT_TYPE_REFERENCE).getBidder(); } catch (IllegalArgumentException e) { throw new PreBidException("imp #%s: %s".formatted(index, e.getMessage())); } - final String dcn = extImpYahooAdvertising.getDcn(); + final String dcn = extImpYahooAds.getDcn(); if (StringUtils.isBlank(dcn)) { throw new PreBidException("imp #%s: missing param dcn".formatted(index)); } - final String pos = extImpYahooAdvertising.getPos(); + final String pos = extImpYahooAds.getPos(); if (StringUtils.isBlank(pos)) { throw new PreBidException("imp #%s: missing param pos".formatted(index)); } - return extImpYahooAdvertising; + return extImpYahooAds; } - private BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYahooAdvertising extImpYahooAdvertising, + private BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYahooAds extImpYahooAds, Regs regs) { final BidRequest.BidRequestBuilder requestBuilder = request.toBuilder(); @@ -118,9 +118,9 @@ private BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYahooAdverti final App app = request.getApp(); if (site != null) { - requestBuilder.site(site.toBuilder().id(extImpYahooAdvertising.getDcn()).build()); + requestBuilder.site(site.toBuilder().id(extImpYahooAds.getDcn()).build()); } else if (app != null) { - requestBuilder.app(app.toBuilder().id(extImpYahooAdvertising.getDcn()).build()); + requestBuilder.app(app.toBuilder().id(extImpYahooAds.getDcn()).build()); } if (regs != null) { @@ -128,14 +128,14 @@ private BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYahooAdverti } return requestBuilder - .imp(Collections.singletonList(modifyImp(imp, extImpYahooAdvertising))) + .imp(Collections.singletonList(modifyImp(imp, extImpYahooAds))) .build(); } - private static Imp modifyImp(Imp imp, ExtImpYahooAdvertising extImpYahooAdvertising) { + private static Imp modifyImp(Imp imp, ExtImpYahooAds extImpYahooAds) { final Banner banner = imp.getBanner(); return imp.toBuilder() - .tagid(extImpYahooAdvertising.getPos()) + .tagid(extImpYahooAds.getPos()) .banner(banner != null ? modifyBanner(imp.getBanner()) : null) .build(); } diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java new file mode 100644 index 00000000000..539cb6f3de0 --- /dev/null +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java @@ -0,0 +1,16 @@ +package org.prebid.server.proto.openrtb.ext.request.yahooads; + +import lombok.AllArgsConstructor; +import lombok.Value; + +/** + * Defines the contract for bidRequest.imp[i].ext.yahooAds + */ +@AllArgsConstructor(staticName = "of") +@Value +public class ExtImpYahooAds { + + String dcn; + + String pos; +} diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooadvertising/ExtImpYahooAdvertising.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooadvertising/ExtImpYahooAdvertising.java deleted file mode 100644 index b0f596683f6..00000000000 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooadvertising/ExtImpYahooAdvertising.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.prebid.server.proto.openrtb.ext.request.yahooadvertising; - -import lombok.AllArgsConstructor; -import lombok.Value; - -/** - * Defines the contract for bidRequest.imp[i].ext.yahooAdvertising - */ -@AllArgsConstructor(staticName = "of") -@Value -public class ExtImpYahooAdvertising { - - String dcn; - - String pos; -} diff --git a/src/main/java/org/prebid/server/spring/config/bidder/YahooAdvertisingConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/YahooAdsConfiguration.java similarity index 66% rename from src/main/java/org/prebid/server/spring/config/bidder/YahooAdvertisingConfiguration.java rename to src/main/java/org/prebid/server/spring/config/bidder/YahooAdsConfiguration.java index 125fd29b0a1..14b0397a148 100644 --- a/src/main/java/org/prebid/server/spring/config/bidder/YahooAdvertisingConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/bidder/YahooAdsConfiguration.java @@ -2,7 +2,7 @@ import org.prebid.server.auction.versionconverter.BidRequestOrtbVersionConversionManager; import org.prebid.server.bidder.BidderDeps; -import org.prebid.server.bidder.yahooadvertising.YahooAdvertisingBidder; +import org.prebid.server.bidder.yahooads.YahooAdsBidder; import org.prebid.server.json.JacksonMapper; import org.prebid.server.spring.config.bidder.model.BidderConfigurationProperties; import org.prebid.server.spring.config.bidder.util.BidderDepsAssembler; @@ -17,27 +17,27 @@ import javax.validation.constraints.NotBlank; @Configuration -@PropertySource(value = "classpath:/bidder-config/yahooAdvertising.yaml", factory = YamlPropertySourceFactory.class) -public class YahooAdvertisingConfiguration { +@PropertySource(value = "classpath:/bidder-config/yahooAds.yaml", factory = YamlPropertySourceFactory.class) +public class YahooAdsConfiguration { - private static final String BIDDER_NAME = "yahooAdvertising"; + private static final String BIDDER_NAME = "yahooAds"; - @Bean("yahooAdvertisingConfigurationProperties") - @ConfigurationProperties("adapters.yahooadvertising") + @Bean("yahooAdsConfigurationProperties") + @ConfigurationProperties("adapters.yahooads") BidderConfigurationProperties configurationProperties() { return new BidderConfigurationProperties(); } @Bean - BidderDeps yahooAdvertisingBidderDeps(BidderConfigurationProperties yahooAdvertisingConfigurationProperties, + BidderDeps yahooAdsBidderDeps(BidderConfigurationProperties yahooAdsConfigurationProperties, @NotBlank @Value("${external-url}") String externalUrl, JacksonMapper mapper, BidRequestOrtbVersionConversionManager conversionManager) { return BidderDepsAssembler.forBidder(BIDDER_NAME) - .withConfig(yahooAdvertisingConfigurationProperties) + .withConfig(yahooAdsConfigurationProperties) .usersyncerCreator(UsersyncerCreator.create(externalUrl)) - .bidderCreator(config -> new YahooAdvertisingBidder(config.getEndpoint(), conversionManager, mapper)) + .bidderCreator(config -> new YahooAdsBidder(config.getEndpoint(), conversionManager, mapper)) .assemble(); } } diff --git a/src/main/resources/bidder-config/yahooAdvertising.yaml b/src/main/resources/bidder-config/yahooAds.yaml similarity index 78% rename from src/main/resources/bidder-config/yahooAdvertising.yaml rename to src/main/resources/bidder-config/yahooAds.yaml index 626aaf32940..0ae8ed11627 100644 --- a/src/main/resources/bidder-config/yahooAdvertising.yaml +++ b/src/main/resources/bidder-config/yahooAds.yaml @@ -1,5 +1,5 @@ adapters: - yahooAdvertising: + yahooAds: endpoint: https://s2shb.ssp.yahoo.com/admax/bid/partners/PBS ortb-version: "2.6" aliases: @@ -7,8 +7,10 @@ adapters: enabled: false yahoossp: enabled: false + yahooAdvertising: + enabled: false meta-info: - maintainer-email: dsp-supply-prebid@verizonmedia.com + maintainer-email: hb-fe-tech@yahooinc.com app-media-types: - banner - video @@ -18,7 +20,7 @@ adapters: supported-vendors: vendor-id: 25 usersync: - cookie-family-name: yahooAdvertising + cookie-family-name: yahooAds redirect: url: https://ups.analytics.yahoo.com/ups/58401/sync?redir=true&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}} support-cors: false diff --git a/src/main/resources/static/bidder-params/yahooAdvertising.json b/src/main/resources/static/bidder-params/yahooAds.json similarity index 100% rename from src/main/resources/static/bidder-params/yahooAdvertising.json rename to src/main/resources/static/bidder-params/yahooAds.json diff --git a/src/test/java/org/prebid/server/bidder/yahooadvertising/YahooAdvertisingBidderTest.java b/src/test/java/org/prebid/server/bidder/yahooads/YahooAdsBidderTest.java similarity index 90% rename from src/test/java/org/prebid/server/bidder/yahooadvertising/YahooAdvertisingBidderTest.java rename to src/test/java/org/prebid/server/bidder/yahooads/YahooAdsBidderTest.java index ec7670d7b3c..dda82d43dd1 100644 --- a/src/test/java/org/prebid/server/bidder/yahooadvertising/YahooAdvertisingBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/yahooads/YahooAdsBidderTest.java @@ -1,4 +1,4 @@ -package org.prebid.server.bidder.yahooadvertising; +package org.prebid.server.bidder.yahooads; import com.fasterxml.jackson.core.JsonProcessingException; import com.iab.openrtb.request.App; @@ -30,7 +30,7 @@ import org.prebid.server.bidder.model.Result; import org.prebid.server.proto.openrtb.ext.ExtPrebid; import org.prebid.server.proto.openrtb.ext.request.ExtRegs; -import org.prebid.server.proto.openrtb.ext.request.yahooadvertising.ExtImpYahooAdvertising; +import org.prebid.server.proto.openrtb.ext.request.yahooads.ExtImpYahooAds; import java.util.List; import java.util.Map; @@ -49,7 +49,7 @@ import static org.prebid.server.proto.openrtb.ext.response.BidType.banner; import static org.prebid.server.proto.openrtb.ext.response.BidType.video; -public class YahooAdvertisingBidderTest extends VertxTest { +public class YahooAdsBidderTest extends VertxTest { private static final String ENDPOINT_URL = "https://test.endpoint.com"; @@ -59,18 +59,18 @@ public class YahooAdvertisingBidderTest extends VertxTest { @Mock private BidRequestOrtbVersionConversionManager conversionManager; - private YahooAdvertisingBidder yahooAdvertisingBidder; + private YahooAdsBidder yahooAdsBidder; @Before public void setUp() { when(conversionManager.convertFromAuctionSupportedVersion(any(BidRequest.class), eq(OrtbVersion.ORTB_2_5))) .thenAnswer(answer -> answer.getArgument(0)); - yahooAdvertisingBidder = new YahooAdvertisingBidder(ENDPOINT_URL, conversionManager, jacksonMapper); + yahooAdsBidder = new YahooAdsBidder(ENDPOINT_URL, conversionManager, jacksonMapper); } @Test public void creationShouldFailOnInvalidEndpointUrl() { - assertThatIllegalArgumentException().isThrownBy(() -> new YahooAdvertisingBidder("invalid_url", + assertThatIllegalArgumentException().isThrownBy(() -> new YahooAdsBidder("invalid_url", conversionManager, jacksonMapper)); } @@ -83,7 +83,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() { identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1); @@ -96,11 +96,11 @@ public void makeHttpRequestsShouldReturnErrorWhenDcnIsEmpty() { // given final BidRequest bidRequest = givenBidRequest( impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooAdvertising.of("", null)))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooAds.of("", null)))), identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -113,11 +113,11 @@ public void makeHttpRequestsShouldReturnErrorWhenPosIsEmpty() { // given final BidRequest bidRequest = givenBidRequest( impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooAdvertising.of("dcn", "")))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooAds.of("dcn", "")))), identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -132,12 +132,12 @@ public void makeHttpRequestsShouldCreateARequestForEachImpAndSkipImpsWithErrors( .imp(asList( givenImp(impBuilder -> impBuilder.id("imp1")), givenImp(impBuilder -> impBuilder.id("imp2") - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooAdvertising.of("dcn", ""))))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooAds.of("dcn", ""))))), givenImp(impBuilder -> impBuilder.id("imp3")))) .build(); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -155,7 +155,7 @@ public void makeHttpRequestsShouldAlwaysSetImpTagIdFromImpExt() { final BidRequest bidRequest = givenBidRequest(identity(), identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -172,7 +172,7 @@ public void makeHttpRequestsShouldSetSiteIdIfSiteIsPresentInTheRequest() { final BidRequest bidRequest = givenBidRequest(identity(), identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -190,7 +190,7 @@ public void makeHttpRequestsShouldSetAppIdIfAppIsPresentInTheRequest() { bidRequestBuilder -> bidRequestBuilder.site(null).app(App.builder().build())); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -209,7 +209,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerWidthIsZero() { identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -225,7 +225,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerHeightIsZero() { identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -241,7 +241,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerHasNoFormats() { identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -257,7 +257,7 @@ public void makeHttpRequestsSetFirstImpressionBannerWidthAndHeightWhenFromFirstF identity()); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -276,7 +276,7 @@ public void makeHttpRequestsShouldSetExpectedHeaders() { requestBuilder -> requestBuilder.site(null).device(Device.builder().ua("UA").build())); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -294,7 +294,7 @@ public void makeBidsShouldReturnErrorIfResponseBodyCouldNotBeParsed() { final BidderCall httpCall = givenHttpCall(null, "invalid"); // when - final Result> result = yahooAdvertisingBidder.makeBids(httpCall, null); + final Result> result = yahooAdsBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1); @@ -310,7 +310,7 @@ public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProces mapper.writeValueAsString(null)); // when - final Result> result = yahooAdvertisingBidder.makeBids(httpCall, null); + final Result> result = yahooAdsBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -324,7 +324,7 @@ public void makeBidsShouldReturnEmptyListIfBidResponseSeatBidIsNull() throws Jso mapper.writeValueAsString(BidResponse.builder().build())); // when - final Result> result = yahooAdvertisingBidder.makeBids(httpCall, null); + final Result> result = yahooAdsBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -338,7 +338,7 @@ public void makeBidsShouldReturnErrorIfBidResponseSeatBidIsEmpty() throws JsonPr mapper.writeValueAsString(BidResponse.builder().seatbid(emptyList()).build())); // when - final Result> result = yahooAdvertisingBidder.makeBids(httpCall, null); + final Result> result = yahooAdsBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1) @@ -359,7 +359,7 @@ public void makeBidsShouldReturnErrorWhenBidImpIdIsNotPresent() throws JsonProce givenBidResponse(bidBuilder -> bidBuilder.impid("321")))); // when - final Result> result = yahooAdvertisingBidder.makeBids(httpCall, null); + final Result> result = yahooAdsBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1) @@ -384,7 +384,7 @@ public void makeBidsShouldSkipNotBannerImpAndReturnBannerBidWhenBannerPresent() .build())); // when - final Result> result = yahooAdvertisingBidder.makeBids(httpCall, null); + final Result> result = yahooAdsBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -409,7 +409,7 @@ public void makeBidsShouldSkipNotSupportedImpAndReturnVideoBidWhenVideoPresent() .build())); // when - final Result> result = yahooAdvertisingBidder.makeBids(httpCall, null); + final Result> result = yahooAdsBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -429,7 +429,7 @@ public void makeBidsShouldRemoveTheOpenRTB26Regs() throws JsonProcessingExceptio .build()).device(Device.builder().ua("UA").build())); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -455,7 +455,7 @@ public void makeBidsShouldOverwriteRegsExtValues() throws JsonProcessingExceptio .build()).device(Device.builder().ua("UA").build())); // when - final Result>> result = yahooAdvertisingBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooAdsBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -479,7 +479,7 @@ private static Imp givenImp(Function impCustomiz return impCustomizer.apply(Imp.builder() .tagid("tagId") .banner(Banner.builder().w(100).h(100).build()) - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooAdvertising.of("dcn", "pos"))))) + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooAds.of("dcn", "pos"))))) .build(); } diff --git a/src/test/java/org/prebid/server/it/YahooAdvertisingTest.java b/src/test/java/org/prebid/server/it/YahooAdsTest.java similarity index 54% rename from src/test/java/org/prebid/server/it/YahooAdvertisingTest.java rename to src/test/java/org/prebid/server/it/YahooAdsTest.java index 1f79bebb5e7..7295b4914fd 100644 --- a/src/test/java/org/prebid/server/it/YahooAdvertisingTest.java +++ b/src/test/java/org/prebid/server/it/YahooAdsTest.java @@ -16,23 +16,23 @@ import static java.util.Collections.singletonList; @RunWith(SpringRunner.class) -public class YahooAdvertisingTest extends IntegrationTest { +public class YahooAdsTest extends IntegrationTest { @Test - public void openrtb2AuctionShouldRespondWithBidsFromYahooAdvertising() throws IOException, JSONException { + public void openrtb2AuctionShouldRespondWithBidsFromYahooAds() throws IOException, JSONException { // given - WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/yahooadvertising-exchange")) + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/yahooads-exchange")) .withRequestBody(equalToJson( - jsonFrom("openrtb2/yahooadvertising/test-yahooadvertising-bid-request.json"))) + jsonFrom("openrtb2/yahooads/test-yahooads-bid-request.json"))) .willReturn(aResponse().withBody( - jsonFrom("openrtb2/yahooadvertising/test-yahooadvertising-bid-response.json")))); + jsonFrom("openrtb2/yahooads/test-yahooads-bid-response.json")))); // when - final Response response = responseFor("openrtb2/yahooadvertising/test-auction-yahooadvertising-request.json", + final Response response = responseFor("openrtb2/yahooads/test-auction-yahooads-request.json", Endpoint.openrtb2_auction); // then - assertJsonEquals("openrtb2/yahooadvertising/test-auction-yahooadvertising-response.json", response, - singletonList("yahooAdvertising")); + assertJsonEquals("openrtb2/yahooads/test-auction-yahooads-response.json", response, + singletonList("yahooAds")); } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-auction-yahooadvertising-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-auction-yahooads-request.json similarity index 91% rename from src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-auction-yahooadvertising-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-auction-yahooads-request.json index 7d2e01ed07c..fc5d0ee2c1a 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-auction-yahooadvertising-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-auction-yahooads-request.json @@ -8,7 +8,7 @@ "h": 250 }, "ext": { - "yahooAdvertising": { + "yahooAds": { "dcn": "dcn", "pos": "pos" } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-auction-yahooadvertising-response.json b/src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-auction-yahooads-response.json similarity index 84% rename from src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-auction-yahooadvertising-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-auction-yahooads-response.json index 62a203818ca..2e1153776b4 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-auction-yahooadvertising-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-auction-yahooads-response.json @@ -19,14 +19,14 @@ } } ], - "seat": "yahooAdvertising", + "seat": "yahooAds", "group": 0 } ], "cur": "USD", "ext": { "responsetimemillis": { - "yahooAdvertising": "{{ yahooAdvertising.response_time_ms }}" + "yahooAds": "{{ yahooAds.response_time_ms }}" }, "prebid": { "auctiontimestamp": 0 diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-yahooadvertising-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-yahooads-bid-request.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-yahooadvertising-bid-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-yahooads-bid-request.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-yahooadvertising-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-yahooads-bid-response.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/yahooadvertising/test-yahooadvertising-bid-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/yahooads/test-yahooads-bid-response.json 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 f9520fe5196..d6249c585a2 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -353,8 +353,8 @@ adapters.unruly.enabled=true adapters.unruly.endpoint=http://localhost:8090/unruly-exchange adapters.visiblemeasures.enabled=true adapters.visiblemeasures.endpoint=http://localhost:8090/visiblemeasures-exchange -adapters.yahooadvertising.enabled=true -adapters.yahooadvertising.endpoint=http://localhost:8090/yahooadvertising-exchange +adapters.yahooads.enabled=true +adapters.yahooads.endpoint=http://localhost:8090/yahooads-exchange adapters.vrtcal.enabled=true adapters.vrtcal.endpoint=http://localhost:8090/vrtcal-exchange adapters.xeworks.enabled=true From bf4f7730084b16f95c383c5ea44e8ece22bf4bfb Mon Sep 17 00:00:00 2001 From: oath-jac Date: Wed, 9 Aug 2023 18:00:08 +0300 Subject: [PATCH 2/5] Review comments - updates --- .../proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java | 4 ---- src/main/resources/bidder-config/yahooAds.yaml | 3 --- 2 files changed, 7 deletions(-) diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java index 539cb6f3de0..2d06b96d489 100644 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java @@ -2,10 +2,6 @@ import lombok.AllArgsConstructor; import lombok.Value; - -/** - * Defines the contract for bidRequest.imp[i].ext.yahooAds - */ @AllArgsConstructor(staticName = "of") @Value public class ExtImpYahooAds { diff --git a/src/main/resources/bidder-config/yahooAds.yaml b/src/main/resources/bidder-config/yahooAds.yaml index 0ae8ed11627..cca6ed6c927 100644 --- a/src/main/resources/bidder-config/yahooAds.yaml +++ b/src/main/resources/bidder-config/yahooAds.yaml @@ -4,11 +4,8 @@ adapters: ortb-version: "2.6" aliases: yssp: - enabled: false yahoossp: - enabled: false yahooAdvertising: - enabled: false meta-info: maintainer-email: hb-fe-tech@yahooinc.com app-media-types: From 01cc1393849484d9aa6c4c717f837ea985383a8b Mon Sep 17 00:00:00 2001 From: oath-jac Date: Wed, 9 Aug 2023 18:26:12 +0300 Subject: [PATCH 3/5] Review comments - updates --- .../proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java index 2d06b96d489..23846e51bd2 100644 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahooads/ExtImpYahooAds.java @@ -2,6 +2,7 @@ import lombok.AllArgsConstructor; import lombok.Value; + @AllArgsConstructor(staticName = "of") @Value public class ExtImpYahooAds { From 33f679217c21f91b9addfdf94af6d94b0771330d Mon Sep 17 00:00:00 2001 From: oath-jac Date: Wed, 9 Aug 2023 22:29:15 +0300 Subject: [PATCH 4/5] Review comments - updates. --- src/main/resources/bidder-config/yahooAds.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/bidder-config/yahooAds.yaml b/src/main/resources/bidder-config/yahooAds.yaml index cca6ed6c927..a4ed3900fb8 100644 --- a/src/main/resources/bidder-config/yahooAds.yaml +++ b/src/main/resources/bidder-config/yahooAds.yaml @@ -4,8 +4,11 @@ adapters: ortb-version: "2.6" aliases: yssp: + enabled: true yahoossp: + enabled: true yahooAdvertising: + enabled: true meta-info: maintainer-email: hb-fe-tech@yahooinc.com app-media-types: From acfe923a17ee2e790d5f510bee4cbb5a03f1b75b Mon Sep 17 00:00:00 2001 From: oath-jac Date: Thu, 10 Aug 2023 10:07:58 +0300 Subject: [PATCH 5/5] Review comments - updates. --- src/main/resources/bidder-config/yahooAds.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/bidder-config/yahooAds.yaml b/src/main/resources/bidder-config/yahooAds.yaml index a4ed3900fb8..4d721721a22 100644 --- a/src/main/resources/bidder-config/yahooAds.yaml +++ b/src/main/resources/bidder-config/yahooAds.yaml @@ -4,11 +4,11 @@ adapters: ortb-version: "2.6" aliases: yssp: - enabled: true + endpoint: https://s2shb.ssp.yahoo.com/admax/bid/partners/PBS yahoossp: - enabled: true + endpoint: https://s2shb.ssp.yahoo.com/admax/bid/partners/PBS yahooAdvertising: - enabled: true + endpoint: https://s2shb.ssp.yahoo.com/admax/bid/partners/PBS meta-info: maintainer-email: hb-fe-tech@yahooinc.com app-media-types: