From 0c121bb7802f8191abde9cb5988929b136545a3f Mon Sep 17 00:00:00 2001 From: oath-jac Date: Tue, 24 Aug 2021 14:11:03 +0300 Subject: [PATCH 1/2] VerizonMedia rebranding into YSSP --- .../YsspBidder.java} | 36 ++++++------ .../verizonmedia/ExtImpVerizonmedia.java | 16 ------ .../openrtb/ext/request/yssp/ExtImpYssp.java | 16 ++++++ ...figuration.java => YsspConfiguration.java} | 18 +++--- .../{verizonmedia.yaml => yssp.yaml} | 8 ++- .../{verizonmedia.json => yssp.json} | 4 +- .../YsspBidderTest.java} | 56 +++++++++---------- .../server/cookie/UidsCookieServiceTest.java | 2 +- .../{VerizonmediaTest.java => YsspTest.java} | 16 +++--- .../test-auction-yssp-request.json} | 2 +- .../test-auction-yssp-response.json} | 4 +- .../test-yssp-bid-request.json} | 0 .../test-yssp-bid-response.json} | 0 .../server/it/test-application.properties | 4 +- 14 files changed, 92 insertions(+), 90 deletions(-) rename src/main/java/org/prebid/server/bidder/{verizonmedia/VerizonmediaBidder.java => yssp/YsspBidder.java} (84%) delete mode 100644 src/main/java/org/prebid/server/proto/openrtb/ext/request/verizonmedia/ExtImpVerizonmedia.java create mode 100644 src/main/java/org/prebid/server/proto/openrtb/ext/request/yssp/ExtImpYssp.java rename src/main/java/org/prebid/server/spring/config/bidder/{VerizonmediaConfiguration.java => YsspConfiguration.java} (71%) rename src/main/resources/bidder-config/{verizonmedia.yaml => yssp.yaml} (86%) rename src/main/resources/static/bidder-params/{verizonmedia.json => yssp.json} (85%) rename src/test/java/org/prebid/server/bidder/{verizonmedia/VerizonmediaBidderTest.java => yssp/YsspBidderTest.java} (85%) rename src/test/java/org/prebid/server/it/{VerizonmediaTest.java => YsspTest.java} (55%) rename src/test/resources/org/prebid/server/it/openrtb2/{verizonmedia/test-auction-verizonmedia-request.json => yssp/test-auction-yssp-request.json} (91%) rename src/test/resources/org/prebid/server/it/openrtb2/{verizonmedia/test-auction-verizonmedia-response.json => yssp/test-auction-yssp-response.json} (86%) rename src/test/resources/org/prebid/server/it/openrtb2/{verizonmedia/test-verizonmedia-bid-request.json => yssp/test-yssp-bid-request.json} (100%) rename src/test/resources/org/prebid/server/it/openrtb2/{verizonmedia/test-verizonmedia-bid-response.json => yssp/test-yssp-bid-response.json} (100%) diff --git a/src/main/java/org/prebid/server/bidder/verizonmedia/VerizonmediaBidder.java b/src/main/java/org/prebid/server/bidder/yssp/YsspBidder.java similarity index 84% rename from src/main/java/org/prebid/server/bidder/verizonmedia/VerizonmediaBidder.java rename to src/main/java/org/prebid/server/bidder/yssp/YsspBidder.java index cf8c6a19e51..da65fd6881b 100644 --- a/src/main/java/org/prebid/server/bidder/verizonmedia/VerizonmediaBidder.java +++ b/src/main/java/org/prebid/server/bidder/yssp/YsspBidder.java @@ -1,4 +1,4 @@ -package org.prebid.server.bidder.verizonmedia; +package org.prebid.server.bidder.yssp; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -25,7 +25,7 @@ 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.verizonmedia.ExtImpVerizonmedia; +import org.prebid.server.proto.openrtb.ext.request.yssp.ExtImpYssp; import org.prebid.server.proto.openrtb.ext.response.BidType; import org.prebid.server.util.HttpUtil; @@ -36,16 +36,16 @@ import java.util.Objects; import java.util.stream.Collectors; -public class VerizonmediaBidder implements Bidder { +public class YsspBidder implements Bidder { - private static final TypeReference> VERIZON_EXT_TYPE_REFERENCE = - new TypeReference>() { + private static final TypeReference> YSSP_EXT_TYPE_REFERENCE = + new TypeReference>() { }; private final String endpointUrl; private final JacksonMapper mapper; - public VerizonmediaBidder(String endpointUrl, JacksonMapper mapper) { + public YsspBidder(String endpointUrl, JacksonMapper mapper) { this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); this.mapper = Objects.requireNonNull(mapper); } @@ -59,8 +59,8 @@ public Result>> makeHttpRequests(BidRequest bidRequ for (int i = 0; i < impList.size(); i++) { try { final Imp imp = impList.get(i); - final ExtImpVerizonmedia extImpVerizonmedia = parseAndValidateImpExt(imp.getExt(), i); - final BidRequest modifiedRequest = modifyRequest(bidRequest, imp, extImpVerizonmedia); + final ExtImpYssp extImpYssp = parseAndValidateImpExt(imp.getExt(), i); + final BidRequest modifiedRequest = modifyRequest(bidRequest, imp, extImpYssp); bidRequests.add(makeHttpRequest(modifiedRequest)); } catch (PreBidException e) { errors.add(BidderError.badInput(e.getMessage())); @@ -70,28 +70,28 @@ public Result>> makeHttpRequests(BidRequest bidRequ return Result.of(bidRequests, errors); } - private ExtImpVerizonmedia parseAndValidateImpExt(ObjectNode impExtNode, int index) { - final ExtImpVerizonmedia extImpVerizonmedia; + private ExtImpYssp parseAndValidateImpExt(ObjectNode impExtNode, int index) { + final ExtImpYssp extImpYssp; try { - extImpVerizonmedia = mapper.mapper().convertValue(impExtNode, VERIZON_EXT_TYPE_REFERENCE).getBidder(); + extImpYssp = mapper.mapper().convertValue(impExtNode, YSSP_EXT_TYPE_REFERENCE).getBidder(); } catch (IllegalArgumentException e) { throw new PreBidException(String.format("imp #%s: %s", index, e.getMessage())); } - final String dcn = extImpVerizonmedia.getDcn(); + final String dcn = extImpYssp.getDcn(); if (StringUtils.isBlank(dcn)) { throw new PreBidException(String.format("imp #%s: missing param dcn", index)); } - final String pos = extImpVerizonmedia.getPos(); + final String pos = extImpYssp.getPos(); if (StringUtils.isBlank(pos)) { throw new PreBidException(String.format("imp #%s: missing param pos", index)); } - return extImpVerizonmedia; + return extImpYssp; } - private static BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpVerizonmedia extImpVerizonmedia) { + private static BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYssp extImpYssp) { final Banner banner = imp.getBanner(); final boolean hasBanner = banner != null; @@ -105,7 +105,7 @@ private static BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpVeriz } final Imp.ImpBuilder impBuilder = imp.toBuilder() - .tagid(extImpVerizonmedia.getPos()); + .tagid(extImpYssp.getPos()); if (hasBanner && !hasBannerWidthAndHeight) { impBuilder.banner(modifyBanner(banner)); @@ -116,9 +116,9 @@ private static BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpVeriz final Site site = request.getSite(); final App app = request.getApp(); if (site != null) { - requestBuilder.site(site.toBuilder().id(extImpVerizonmedia.getDcn()).build()); + requestBuilder.site(site.toBuilder().id(extImpYssp.getDcn()).build()); } else if (app != null) { - requestBuilder.app(app.toBuilder().id(extImpVerizonmedia.getDcn()).build()); + requestBuilder.app(app.toBuilder().id(extImpYssp.getDcn()).build()); } return requestBuilder diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/verizonmedia/ExtImpVerizonmedia.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/verizonmedia/ExtImpVerizonmedia.java deleted file mode 100644 index 5eb2720c714..00000000000 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/verizonmedia/ExtImpVerizonmedia.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.prebid.server.proto.openrtb.ext.request.verizonmedia; - -import lombok.AllArgsConstructor; -import lombok.Value; - -/** - * Defines the contract for bidRequest.imp[i].ext.verizonmedia - */ -@AllArgsConstructor(staticName = "of") -@Value -public class ExtImpVerizonmedia { - - String dcn; - - String pos; -} diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yssp/ExtImpYssp.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yssp/ExtImpYssp.java new file mode 100644 index 00000000000..62bc4c69a68 --- /dev/null +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yssp/ExtImpYssp.java @@ -0,0 +1,16 @@ +package org.prebid.server.proto.openrtb.ext.request.yssp; + +import lombok.AllArgsConstructor; +import lombok.Value; + +/** + * Defines the contract for bidRequest.imp[i].ext.yssp + */ +@AllArgsConstructor(staticName = "of") +@Value +public class ExtImpYssp { + + String dcn; + + String pos; +} diff --git a/src/main/java/org/prebid/server/spring/config/bidder/VerizonmediaConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/YsspConfiguration.java similarity index 71% rename from src/main/java/org/prebid/server/spring/config/bidder/VerizonmediaConfiguration.java rename to src/main/java/org/prebid/server/spring/config/bidder/YsspConfiguration.java index 0d9ff349da6..622cda4154c 100644 --- a/src/main/java/org/prebid/server/spring/config/bidder/VerizonmediaConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/bidder/YsspConfiguration.java @@ -1,7 +1,7 @@ package org.prebid.server.spring.config.bidder; import org.prebid.server.bidder.BidderDeps; -import org.prebid.server.bidder.verizonmedia.VerizonmediaBidder; +import org.prebid.server.bidder.yssp.YsspBidder; import org.prebid.server.json.JacksonMapper; import org.prebid.server.spring.config.bidder.model.BidderConfigurationProperties; import org.prebid.server.spring.config.bidder.util.BidderDepsAssembler; @@ -18,10 +18,10 @@ import javax.validation.constraints.NotBlank; @Configuration -@PropertySource(value = "classpath:/bidder-config/verizonmedia.yaml", factory = YamlPropertySourceFactory.class) -public class VerizonmediaConfiguration { +@PropertySource(value = "classpath:/bidder-config/yssp.yaml", factory = YamlPropertySourceFactory.class) +public class YsspConfiguration { - private static final String BIDDER_NAME = "verizonmedia"; + private static final String BIDDER_NAME = "yssp"; @Value("${external-url}") @NotBlank @@ -31,21 +31,21 @@ public class VerizonmediaConfiguration { private JacksonMapper mapper; @Autowired - @Qualifier("verizonmediaConfigurationProperties") + @Qualifier("ysspConfigurationProperties") private BidderConfigurationProperties configProperties; - @Bean("verizonmediaConfigurationProperties") - @ConfigurationProperties("adapters.verizonmedia") + @Bean("ysspConfigurationProperties") + @ConfigurationProperties("adapters.yssp") BidderConfigurationProperties configurationProperties() { return new BidderConfigurationProperties(); } @Bean - BidderDeps verizonmediaBidderDeps() { + BidderDeps ysspBidderDeps() { return BidderDepsAssembler.forBidder(BIDDER_NAME) .withConfig(configProperties) .usersyncerCreator(UsersyncerCreator.create(externalUrl)) - .bidderCreator(config -> new VerizonmediaBidder(config.getEndpoint(), mapper)) + .bidderCreator(config -> new YsspBidder(config.getEndpoint(), mapper)) .assemble(); } } diff --git a/src/main/resources/bidder-config/verizonmedia.yaml b/src/main/resources/bidder-config/yssp.yaml similarity index 86% rename from src/main/resources/bidder-config/verizonmedia.yaml rename to src/main/resources/bidder-config/yssp.yaml index 6f5be2c81a1..f16e7360d8d 100644 --- a/src/main/resources/bidder-config/verizonmedia.yaml +++ b/src/main/resources/bidder-config/yssp.yaml @@ -1,12 +1,14 @@ adapters: - verizonmedia: + yssp: enabled: false endpoint: https://s2shb.ssp.yahoo.com/admax/bid/partners/MAG pbs-enforces-gdpr: true pbs-enforces-ccpa: true modifying-vast-xml-allowed: true deprecated-names: - aliases: {} + aliases: + verizonmedia: + enabled: false meta-info: maintainer-email: dsp-supply-prebid@verizonmedia.com app-media-types: @@ -18,6 +20,6 @@ adapters: usersync: url: https://ups.analytics.yahoo.com/ups/58401/sync?redir=true&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}} redirect-url: - cookie-family-name: verizonmedia + cookie-family-name: yssp type: redirect support-cors: false diff --git a/src/main/resources/static/bidder-params/verizonmedia.json b/src/main/resources/static/bidder-params/yssp.json similarity index 85% rename from src/main/resources/static/bidder-params/verizonmedia.json rename to src/main/resources/static/bidder-params/yssp.json index fdcbe887249..eb8867c3391 100644 --- a/src/main/resources/static/bidder-params/verizonmedia.json +++ b/src/main/resources/static/bidder-params/yssp.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "VerizonMedia Adapter Params", - "description": "A schema which validates params accepted by the VerizonMedia adapter", + "title": "YSSP Adapter Params", + "description": "A schema which validates params accepted by the YSSP adapter", "type": "object", "properties": { "dcn": { diff --git a/src/test/java/org/prebid/server/bidder/verizonmedia/VerizonmediaBidderTest.java b/src/test/java/org/prebid/server/bidder/yssp/YsspBidderTest.java similarity index 85% rename from src/test/java/org/prebid/server/bidder/verizonmedia/VerizonmediaBidderTest.java rename to src/test/java/org/prebid/server/bidder/yssp/YsspBidderTest.java index 0342a6f11ef..9168ea8c490 100644 --- a/src/test/java/org/prebid/server/bidder/verizonmedia/VerizonmediaBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/yssp/YsspBidderTest.java @@ -1,4 +1,4 @@ -package org.prebid.server.bidder.verizonmedia; +package org.prebid.server.bidder.yssp; import com.fasterxml.jackson.core.JsonProcessingException; import com.iab.openrtb.request.App; @@ -21,7 +21,7 @@ import org.prebid.server.bidder.model.HttpResponse; import org.prebid.server.bidder.model.Result; import org.prebid.server.proto.openrtb.ext.ExtPrebid; -import org.prebid.server.proto.openrtb.ext.request.verizonmedia.ExtImpVerizonmedia; +import org.prebid.server.proto.openrtb.ext.request.yssp.ExtImpYssp; import java.util.List; import java.util.Map; @@ -36,20 +36,20 @@ import static org.assertj.core.api.Assertions.tuple; import static org.prebid.server.proto.openrtb.ext.response.BidType.banner; -public class VerizonmediaBidderTest extends VertxTest { +public class YsspBidderTest extends VertxTest { private static final String ENDPOINT_URL = "https://test.endpoint.com"; - private VerizonmediaBidder verizonmediaBidder; + private YsspBidder ysspBidder; @Before public void setUp() { - verizonmediaBidder = new VerizonmediaBidder(ENDPOINT_URL, jacksonMapper); + ysspBidder = new YsspBidder(ENDPOINT_URL, jacksonMapper); } @Test public void creationShouldFailOnInvalidEndpointUrl() { - assertThatIllegalArgumentException().isThrownBy(() -> new VerizonmediaBidder("invalid_url", jacksonMapper)); + assertThatIllegalArgumentException().isThrownBy(() -> new YsspBidder("invalid_url", jacksonMapper)); } @Test @@ -61,7 +61,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() { identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1); @@ -74,11 +74,11 @@ public void makeHttpRequestsShouldReturnErrorWhenDcnIsEmpty() { // given final BidRequest bidRequest = givenBidRequest( impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpVerizonmedia.of("", null)))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYssp.of("", null)))), identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -91,11 +91,11 @@ public void makeHttpRequestsShouldReturnErrorWhenPosIsEmpty() { // given final BidRequest bidRequest = givenBidRequest( impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpVerizonmedia.of("dcn", "")))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYssp.of("dcn", "")))), identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -110,12 +110,12 @@ public void makeHttpRequestsShouldCreateARequestForEachImpAndSkipImpsWithErrors( .imp(asList( givenImp(impBuilder -> impBuilder.id("imp1")), givenImp(impBuilder -> impBuilder.id("imp2") - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpVerizonmedia.of("dcn", ""))))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYssp.of("dcn", ""))))), givenImp(impBuilder -> impBuilder.id("imp3")))) .build(); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -133,7 +133,7 @@ public void makeHttpRequestsShouldAlwaysSetImpTagIdFromImpExt() { final BidRequest bidRequest = givenBidRequest(identity(), identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -150,7 +150,7 @@ public void makeHttpRequestsShouldSetSiteIdIfSiteIsPresentInTheRequest() { final BidRequest bidRequest = givenBidRequest(identity(), identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -168,7 +168,7 @@ public void makeHttpRequestsShouldSetAppIdIfAppIsPresentInTheRequest() { bidRequestBuilder -> bidRequestBuilder.site(null).app(App.builder().build())); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -187,7 +187,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerWidthIsZero() { identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -203,7 +203,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerHeightIsZero() { identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -219,7 +219,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerHasNoFormats() { identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -235,7 +235,7 @@ public void makeHttpRequestsSetFirstImpressionBannerWidthAndHeightWhenFromFirstF identity()); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -254,7 +254,7 @@ public void makeHttpRequestsShouldSetExpectedHeaders() { requestBuilder -> requestBuilder.site(null).device(Device.builder().ua("UA").build())); // when - final Result>> result = verizonmediaBidder.makeHttpRequests(bidRequest); + final Result>> result = ysspBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -272,7 +272,7 @@ public void makeBidsShouldReturnErrorIfResponseBodyCouldNotBeParsed() { final HttpCall httpCall = givenHttpCall(null, "invalid"); // when - final Result> result = verizonmediaBidder.makeBids(httpCall, null); + final Result> result = ysspBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1); @@ -288,7 +288,7 @@ public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProces mapper.writeValueAsString(null)); // when - final Result> result = verizonmediaBidder.makeBids(httpCall, null); + final Result> result = ysspBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -302,7 +302,7 @@ public void makeBidsShouldReturnEmptyListIfBidResponseSeatBidIsNull() throws Jso mapper.writeValueAsString(BidResponse.builder().build())); // when - final Result> result = verizonmediaBidder.makeBids(httpCall, null); + final Result> result = ysspBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -316,7 +316,7 @@ public void makeBidsShouldReturnErrorIfBidResponseSeatBidIsEmpty() throws JsonPr mapper.writeValueAsString(BidResponse.builder().seatbid(emptyList()).build())); // when - final Result> result = verizonmediaBidder.makeBids(httpCall, null); + final Result> result = ysspBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1) @@ -337,7 +337,7 @@ public void makeBidsShouldReturnErrorWhenBidImpIdIsNotPresent() throws JsonProce givenBidResponse(bidBuilder -> bidBuilder.impid("321")))); // when - final Result> result = verizonmediaBidder.makeBids(httpCall, null); + final Result> result = ysspBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1) @@ -362,7 +362,7 @@ public void makeBidsShouldSkipNotBannerImpAndReturnBannerBidWhenBannerPresent() .build())); // when - final Result> result = verizonmediaBidder.makeBids(httpCall, null); + final Result> result = ysspBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -383,7 +383,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, ExtImpVerizonmedia.of("dcn", "pos"))))) + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYssp.of("dcn", "pos"))))) .build(); } diff --git a/src/test/java/org/prebid/server/cookie/UidsCookieServiceTest.java b/src/test/java/org/prebid/server/cookie/UidsCookieServiceTest.java index a8543f2e43f..f0bba87a08f 100644 --- a/src/test/java/org/prebid/server/cookie/UidsCookieServiceTest.java +++ b/src/test/java/org/prebid/server/cookie/UidsCookieServiceTest.java @@ -280,7 +280,7 @@ public void toCookieShouldEnforceMaxCookieSizeAndRemoveAUidWithCloserExpirationD .updateUid("sharethrough", "sharethroughUid") .updateUid("improvedigital", "improvedigitalUid") .updateUid("somoaudience", "somoaudienceUid") - .updateUid("verizonmedia", "verizonmediaUid"); + .updateUid("yssp", "ysspUid"); // the size of uidsCookie above is 530, therefore it is expected to be modified. final int maxCookieSizeBytes = 500; diff --git a/src/test/java/org/prebid/server/it/VerizonmediaTest.java b/src/test/java/org/prebid/server/it/YsspTest.java similarity index 55% rename from src/test/java/org/prebid/server/it/VerizonmediaTest.java rename to src/test/java/org/prebid/server/it/YsspTest.java index 3ecd3073b4e..fe919d8c2a3 100644 --- a/src/test/java/org/prebid/server/it/VerizonmediaTest.java +++ b/src/test/java/org/prebid/server/it/YsspTest.java @@ -16,23 +16,23 @@ import static java.util.Collections.singletonList; @RunWith(SpringRunner.class) -public class VerizonmediaTest extends IntegrationTest { +public class YsspTest extends IntegrationTest { @Test - public void openrtb2AuctionShouldRespondWithBidsFromVerizonmedia() throws IOException, JSONException { + public void openrtb2AuctionShouldRespondWithBidsFromYssp() throws IOException, JSONException { // given - WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/verizonmedia-exchange")) + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/yssp-exchange")) .withRequestBody(equalToJson( - jsonFrom("openrtb2/verizonmedia/test-verizonmedia-bid-request.json"))) + jsonFrom("openrtb2/yssp/test-yssp-bid-request.json"))) .willReturn(aResponse().withBody( - jsonFrom("openrtb2/verizonmedia/test-verizonmedia-bid-response.json")))); + jsonFrom("openrtb2/yssp/test-yssp-bid-response.json")))); // when - final Response response = responseFor("openrtb2/verizonmedia/test-auction-verizonmedia-request.json", + final Response response = responseFor("openrtb2/yssp/test-auction-yssp-request.json", Endpoint.openrtb2_auction); // then - assertJsonEquals("openrtb2/verizonmedia/test-auction-verizonmedia-response.json", response, - singletonList("verizonmedia")); + assertJsonEquals("openrtb2/yssp/test-auction-yssp-response.json", response, + singletonList("yssp")); } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-request.json similarity index 91% rename from src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-request.json index 76979ec2344..829adbc6f87 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-request.json @@ -8,7 +8,7 @@ "h": 250 }, "ext": { - "verizonmedia": { + "yssp": { "dcn": "dcn", "pos": "pos" } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-response.json b/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-response.json similarity index 86% rename from src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-response.json index 19948abcb4a..95f5b6749f0 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-auction-verizonmedia-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-response.json @@ -19,14 +19,14 @@ } } ], - "seat": "verizonmedia", + "seat": "yssp", "group": 0 } ], "cur": "USD", "ext": { "responsetimemillis": { - "verizonmedia": "{{ verizonmedia.response_time_ms }}" + "yssp": "{{ yssp.response_time_ms }}" }, "prebid": { "auctiontimestamp": 0 diff --git a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-verizonmedia-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-yssp-bid-request.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-verizonmedia-bid-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/yssp/test-yssp-bid-request.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-verizonmedia-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-yssp-bid-response.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/verizonmedia/test-verizonmedia-bid-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/yssp/test-yssp-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 b7a6f4b7a15..7f11bac1416 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -229,8 +229,8 @@ adapters.unruly.enabled=true adapters.unruly.endpoint=http://localhost:8090/unruly-exchange adapters.valueimpression.enabled=true adapters.valueimpression.endpoint=http://localhost:8090/valueimpression-exchange -adapters.verizonmedia.enabled=true -adapters.verizonmedia.endpoint=http://localhost:8090/verizonmedia-exchange +adapters.yssp.enabled=true +adapters.yssp.endpoint=http://localhost:8090/yssp-exchange adapters.vrtcal.enabled=true adapters.vrtcal.endpoint=http://localhost:8090/vrtcal-exchange adapters.visx.enabled=true From d3d512cb7f7d77c67411158038062c55b0575e1c Mon Sep 17 00:00:00 2001 From: oath-jac Date: Mon, 13 Sep 2021 17:00:26 +0300 Subject: [PATCH 2/2] We were told by legal to go further with `yahoossp`, we'll keep the yssp alias at least for now. --- .../YahooSSPBidder.java} | 36 ++++++------ .../ext/request/yahoossp/ExtImpYahooSSP.java | 16 ++++++ .../openrtb/ext/request/yssp/ExtImpYssp.java | 16 ------ ...ration.java => YahooSSPConfiguration.java} | 18 +++--- .../{yssp.yaml => yahoossp.yaml} | 6 +- .../{yssp.json => yahoossp.json} | 6 +- .../YahooSSPBidderTest.java} | 56 +++++++++---------- .../server/cookie/UidsCookieServiceTest.java | 2 +- .../it/{YsspTest.java => YahooSSPTest.java} | 16 +++--- .../test-auction-yahoossp-request.json} | 4 +- .../test-auction-yahoossp-response.json} | 4 +- .../test-yahoossp-bid-request.json} | 0 .../test-yahoossp-bid-response.json} | 0 .../server/it/test-application.properties | 4 +- 14 files changed, 93 insertions(+), 91 deletions(-) rename src/main/java/org/prebid/server/bidder/{yssp/YsspBidder.java => yahoossp/YahooSSPBidder.java} (85%) create mode 100644 src/main/java/org/prebid/server/proto/openrtb/ext/request/yahoossp/ExtImpYahooSSP.java delete mode 100644 src/main/java/org/prebid/server/proto/openrtb/ext/request/yssp/ExtImpYssp.java rename src/main/java/org/prebid/server/spring/config/bidder/{YsspConfiguration.java => YahooSSPConfiguration.java} (73%) rename src/main/resources/bidder-config/{yssp.yaml => yahoossp.yaml} (88%) rename src/main/resources/static/bidder-params/{yssp.json => yahoossp.json} (86%) rename src/test/java/org/prebid/server/bidder/{yssp/YsspBidderTest.java => yahoossp/YahooSSPBidderTest.java} (86%) rename src/test/java/org/prebid/server/it/{YsspTest.java => YahooSSPTest.java} (57%) rename src/test/resources/org/prebid/server/it/openrtb2/{yssp/test-auction-yssp-request.json => yahoossp/test-auction-yahoossp-request.json} (92%) rename src/test/resources/org/prebid/server/it/openrtb2/{yssp/test-auction-yssp-response.json => yahoossp/test-auction-yahoossp-response.json} (87%) rename src/test/resources/org/prebid/server/it/openrtb2/{yssp/test-yssp-bid-request.json => yahoossp/test-yahoossp-bid-request.json} (100%) rename src/test/resources/org/prebid/server/it/openrtb2/{yssp/test-yssp-bid-response.json => yahoossp/test-yahoossp-bid-response.json} (100%) diff --git a/src/main/java/org/prebid/server/bidder/yssp/YsspBidder.java b/src/main/java/org/prebid/server/bidder/yahoossp/YahooSSPBidder.java similarity index 85% rename from src/main/java/org/prebid/server/bidder/yssp/YsspBidder.java rename to src/main/java/org/prebid/server/bidder/yahoossp/YahooSSPBidder.java index da65fd6881b..75d086b731a 100644 --- a/src/main/java/org/prebid/server/bidder/yssp/YsspBidder.java +++ b/src/main/java/org/prebid/server/bidder/yahoossp/YahooSSPBidder.java @@ -1,4 +1,4 @@ -package org.prebid.server.bidder.yssp; +package org.prebid.server.bidder.yahoossp; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -25,7 +25,7 @@ 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.yssp.ExtImpYssp; +import org.prebid.server.proto.openrtb.ext.request.yahoossp.ExtImpYahooSSP; import org.prebid.server.proto.openrtb.ext.response.BidType; import org.prebid.server.util.HttpUtil; @@ -36,16 +36,16 @@ import java.util.Objects; import java.util.stream.Collectors; -public class YsspBidder implements Bidder { +public class YahooSSPBidder implements Bidder { - private static final TypeReference> YSSP_EXT_TYPE_REFERENCE = - new TypeReference>() { + private static final TypeReference> YAHOOSSP_EXT_TYPE_REFERENCE = + new TypeReference>() { }; private final String endpointUrl; private final JacksonMapper mapper; - public YsspBidder(String endpointUrl, JacksonMapper mapper) { + public YahooSSPBidder(String endpointUrl, JacksonMapper mapper) { this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); this.mapper = Objects.requireNonNull(mapper); } @@ -59,8 +59,8 @@ public Result>> makeHttpRequests(BidRequest bidRequ for (int i = 0; i < impList.size(); i++) { try { final Imp imp = impList.get(i); - final ExtImpYssp extImpYssp = parseAndValidateImpExt(imp.getExt(), i); - final BidRequest modifiedRequest = modifyRequest(bidRequest, imp, extImpYssp); + final ExtImpYahooSSP extImpYahooSSP = parseAndValidateImpExt(imp.getExt(), i); + final BidRequest modifiedRequest = modifyRequest(bidRequest, imp, extImpYahooSSP); bidRequests.add(makeHttpRequest(modifiedRequest)); } catch (PreBidException e) { errors.add(BidderError.badInput(e.getMessage())); @@ -70,28 +70,28 @@ public Result>> makeHttpRequests(BidRequest bidRequ return Result.of(bidRequests, errors); } - private ExtImpYssp parseAndValidateImpExt(ObjectNode impExtNode, int index) { - final ExtImpYssp extImpYssp; + private ExtImpYahooSSP parseAndValidateImpExt(ObjectNode impExtNode, int index) { + final ExtImpYahooSSP extImpYahooSSP; try { - extImpYssp = mapper.mapper().convertValue(impExtNode, YSSP_EXT_TYPE_REFERENCE).getBidder(); + extImpYahooSSP = mapper.mapper().convertValue(impExtNode, YAHOOSSP_EXT_TYPE_REFERENCE).getBidder(); } catch (IllegalArgumentException e) { throw new PreBidException(String.format("imp #%s: %s", index, e.getMessage())); } - final String dcn = extImpYssp.getDcn(); + final String dcn = extImpYahooSSP.getDcn(); if (StringUtils.isBlank(dcn)) { throw new PreBidException(String.format("imp #%s: missing param dcn", index)); } - final String pos = extImpYssp.getPos(); + final String pos = extImpYahooSSP.getPos(); if (StringUtils.isBlank(pos)) { throw new PreBidException(String.format("imp #%s: missing param pos", index)); } - return extImpYssp; + return extImpYahooSSP; } - private static BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYssp extImpYssp) { + private static BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYahooSSP extImpYahooSSP) { final Banner banner = imp.getBanner(); final boolean hasBanner = banner != null; @@ -105,7 +105,7 @@ private static BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYssp } final Imp.ImpBuilder impBuilder = imp.toBuilder() - .tagid(extImpYssp.getPos()); + .tagid(extImpYahooSSP.getPos()); if (hasBanner && !hasBannerWidthAndHeight) { impBuilder.banner(modifyBanner(banner)); @@ -116,9 +116,9 @@ private static BidRequest modifyRequest(BidRequest request, Imp imp, ExtImpYssp final Site site = request.getSite(); final App app = request.getApp(); if (site != null) { - requestBuilder.site(site.toBuilder().id(extImpYssp.getDcn()).build()); + requestBuilder.site(site.toBuilder().id(extImpYahooSSP.getDcn()).build()); } else if (app != null) { - requestBuilder.app(app.toBuilder().id(extImpYssp.getDcn()).build()); + requestBuilder.app(app.toBuilder().id(extImpYahooSSP.getDcn()).build()); } return requestBuilder diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahoossp/ExtImpYahooSSP.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahoossp/ExtImpYahooSSP.java new file mode 100644 index 00000000000..1319d0b0afc --- /dev/null +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yahoossp/ExtImpYahooSSP.java @@ -0,0 +1,16 @@ +package org.prebid.server.proto.openrtb.ext.request.yahoossp; + +import lombok.AllArgsConstructor; +import lombok.Value; + +/** + * Defines the contract for bidRequest.imp[i].ext.yahoossp + */ +@AllArgsConstructor(staticName = "of") +@Value +public class ExtImpYahooSSP { + + String dcn; + + String pos; +} diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yssp/ExtImpYssp.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/yssp/ExtImpYssp.java deleted file mode 100644 index 62bc4c69a68..00000000000 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/yssp/ExtImpYssp.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.prebid.server.proto.openrtb.ext.request.yssp; - -import lombok.AllArgsConstructor; -import lombok.Value; - -/** - * Defines the contract for bidRequest.imp[i].ext.yssp - */ -@AllArgsConstructor(staticName = "of") -@Value -public class ExtImpYssp { - - String dcn; - - String pos; -} diff --git a/src/main/java/org/prebid/server/spring/config/bidder/YsspConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/YahooSSPConfiguration.java similarity index 73% rename from src/main/java/org/prebid/server/spring/config/bidder/YsspConfiguration.java rename to src/main/java/org/prebid/server/spring/config/bidder/YahooSSPConfiguration.java index 622cda4154c..520665dec82 100644 --- a/src/main/java/org/prebid/server/spring/config/bidder/YsspConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/bidder/YahooSSPConfiguration.java @@ -1,7 +1,7 @@ package org.prebid.server.spring.config.bidder; import org.prebid.server.bidder.BidderDeps; -import org.prebid.server.bidder.yssp.YsspBidder; +import org.prebid.server.bidder.yahoossp.YahooSSPBidder; import org.prebid.server.json.JacksonMapper; import org.prebid.server.spring.config.bidder.model.BidderConfigurationProperties; import org.prebid.server.spring.config.bidder.util.BidderDepsAssembler; @@ -18,10 +18,10 @@ import javax.validation.constraints.NotBlank; @Configuration -@PropertySource(value = "classpath:/bidder-config/yssp.yaml", factory = YamlPropertySourceFactory.class) -public class YsspConfiguration { +@PropertySource(value = "classpath:/bidder-config/yahoossp.yaml", factory = YamlPropertySourceFactory.class) +public class YahooSSPConfiguration { - private static final String BIDDER_NAME = "yssp"; + private static final String BIDDER_NAME = "yahoossp"; @Value("${external-url}") @NotBlank @@ -31,21 +31,21 @@ public class YsspConfiguration { private JacksonMapper mapper; @Autowired - @Qualifier("ysspConfigurationProperties") + @Qualifier("yahooSSPConfigurationProperties") private BidderConfigurationProperties configProperties; - @Bean("ysspConfigurationProperties") - @ConfigurationProperties("adapters.yssp") + @Bean("yahooSSPConfigurationProperties") + @ConfigurationProperties("adapters.yahoossp") BidderConfigurationProperties configurationProperties() { return new BidderConfigurationProperties(); } @Bean - BidderDeps ysspBidderDeps() { + BidderDeps yahooSSPBidderDeps() { return BidderDepsAssembler.forBidder(BIDDER_NAME) .withConfig(configProperties) .usersyncerCreator(UsersyncerCreator.create(externalUrl)) - .bidderCreator(config -> new YsspBidder(config.getEndpoint(), mapper)) + .bidderCreator(config -> new YahooSSPBidder(config.getEndpoint(), mapper)) .assemble(); } } diff --git a/src/main/resources/bidder-config/yssp.yaml b/src/main/resources/bidder-config/yahoossp.yaml similarity index 88% rename from src/main/resources/bidder-config/yssp.yaml rename to src/main/resources/bidder-config/yahoossp.yaml index f16e7360d8d..b443f1f7de7 100644 --- a/src/main/resources/bidder-config/yssp.yaml +++ b/src/main/resources/bidder-config/yahoossp.yaml @@ -1,5 +1,5 @@ adapters: - yssp: + yahoossp: enabled: false endpoint: https://s2shb.ssp.yahoo.com/admax/bid/partners/MAG pbs-enforces-gdpr: true @@ -9,6 +9,8 @@ adapters: aliases: verizonmedia: enabled: false + yssp: + enabled: false meta-info: maintainer-email: dsp-supply-prebid@verizonmedia.com app-media-types: @@ -20,6 +22,6 @@ adapters: usersync: url: https://ups.analytics.yahoo.com/ups/58401/sync?redir=true&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}} redirect-url: - cookie-family-name: yssp + cookie-family-name: yahoossp type: redirect support-cors: false diff --git a/src/main/resources/static/bidder-params/yssp.json b/src/main/resources/static/bidder-params/yahoossp.json similarity index 86% rename from src/main/resources/static/bidder-params/yssp.json rename to src/main/resources/static/bidder-params/yahoossp.json index eb8867c3391..0044f8d1c7c 100644 --- a/src/main/resources/static/bidder-params/yssp.json +++ b/src/main/resources/static/bidder-params/yahoossp.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "YSSP Adapter Params", - "description": "A schema which validates params accepted by the YSSP adapter", + "title": "YahooSSP Adapter Params", + "description": "A schema which validates params accepted by the YahooSSP adapter", "type": "object", "properties": { "dcn": { @@ -17,4 +17,4 @@ "dcn", "pos" ] -} \ No newline at end of file +} diff --git a/src/test/java/org/prebid/server/bidder/yssp/YsspBidderTest.java b/src/test/java/org/prebid/server/bidder/yahoossp/YahooSSPBidderTest.java similarity index 86% rename from src/test/java/org/prebid/server/bidder/yssp/YsspBidderTest.java rename to src/test/java/org/prebid/server/bidder/yahoossp/YahooSSPBidderTest.java index 9168ea8c490..f814d69502f 100644 --- a/src/test/java/org/prebid/server/bidder/yssp/YsspBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/yahoossp/YahooSSPBidderTest.java @@ -1,4 +1,4 @@ -package org.prebid.server.bidder.yssp; +package org.prebid.server.bidder.yahoossp; import com.fasterxml.jackson.core.JsonProcessingException; import com.iab.openrtb.request.App; @@ -21,7 +21,7 @@ import org.prebid.server.bidder.model.HttpResponse; import org.prebid.server.bidder.model.Result; import org.prebid.server.proto.openrtb.ext.ExtPrebid; -import org.prebid.server.proto.openrtb.ext.request.yssp.ExtImpYssp; +import org.prebid.server.proto.openrtb.ext.request.yahoossp.ExtImpYahooSSP; import java.util.List; import java.util.Map; @@ -36,20 +36,20 @@ import static org.assertj.core.api.Assertions.tuple; import static org.prebid.server.proto.openrtb.ext.response.BidType.banner; -public class YsspBidderTest extends VertxTest { +public class YahooSSPBidderTest extends VertxTest { private static final String ENDPOINT_URL = "https://test.endpoint.com"; - private YsspBidder ysspBidder; + private YahooSSPBidder yahooSSPBidder; @Before public void setUp() { - ysspBidder = new YsspBidder(ENDPOINT_URL, jacksonMapper); + yahooSSPBidder = new YahooSSPBidder(ENDPOINT_URL, jacksonMapper); } @Test public void creationShouldFailOnInvalidEndpointUrl() { - assertThatIllegalArgumentException().isThrownBy(() -> new YsspBidder("invalid_url", jacksonMapper)); + assertThatIllegalArgumentException().isThrownBy(() -> new YahooSSPBidder("invalid_url", jacksonMapper)); } @Test @@ -61,7 +61,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() { identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1); @@ -74,11 +74,11 @@ public void makeHttpRequestsShouldReturnErrorWhenDcnIsEmpty() { // given final BidRequest bidRequest = givenBidRequest( impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYssp.of("", null)))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooSSP.of("", null)))), identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -91,11 +91,11 @@ public void makeHttpRequestsShouldReturnErrorWhenPosIsEmpty() { // given final BidRequest bidRequest = givenBidRequest( impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYssp.of("dcn", "")))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooSSP.of("dcn", "")))), identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -110,12 +110,12 @@ public void makeHttpRequestsShouldCreateARequestForEachImpAndSkipImpsWithErrors( .imp(asList( givenImp(impBuilder -> impBuilder.id("imp1")), givenImp(impBuilder -> impBuilder.id("imp2") - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYssp.of("dcn", ""))))), + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooSSP.of("dcn", ""))))), givenImp(impBuilder -> impBuilder.id("imp3")))) .build(); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).hasSize(1) @@ -133,7 +133,7 @@ public void makeHttpRequestsShouldAlwaysSetImpTagIdFromImpExt() { final BidRequest bidRequest = givenBidRequest(identity(), identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -150,7 +150,7 @@ public void makeHttpRequestsShouldSetSiteIdIfSiteIsPresentInTheRequest() { final BidRequest bidRequest = givenBidRequest(identity(), identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -168,7 +168,7 @@ public void makeHttpRequestsShouldSetAppIdIfAppIsPresentInTheRequest() { bidRequestBuilder -> bidRequestBuilder.site(null).app(App.builder().build())); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -187,7 +187,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerWidthIsZero() { identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -203,7 +203,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerHeightIsZero() { identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -219,7 +219,7 @@ public void makeHttpRequestsShouldReturnErrorWhenBannerHasNoFormats() { identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getValue()).isEmpty(); @@ -235,7 +235,7 @@ public void makeHttpRequestsSetFirstImpressionBannerWidthAndHeightWhenFromFirstF identity()); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -254,7 +254,7 @@ public void makeHttpRequestsShouldSetExpectedHeaders() { requestBuilder -> requestBuilder.site(null).device(Device.builder().ua("UA").build())); // when - final Result>> result = ysspBidder.makeHttpRequests(bidRequest); + final Result>> result = yahooSSPBidder.makeHttpRequests(bidRequest); // then assertThat(result.getErrors()).isEmpty(); @@ -272,7 +272,7 @@ public void makeBidsShouldReturnErrorIfResponseBodyCouldNotBeParsed() { final HttpCall httpCall = givenHttpCall(null, "invalid"); // when - final Result> result = ysspBidder.makeBids(httpCall, null); + final Result> result = yahooSSPBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1); @@ -288,7 +288,7 @@ public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProces mapper.writeValueAsString(null)); // when - final Result> result = ysspBidder.makeBids(httpCall, null); + final Result> result = yahooSSPBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -302,7 +302,7 @@ public void makeBidsShouldReturnEmptyListIfBidResponseSeatBidIsNull() throws Jso mapper.writeValueAsString(BidResponse.builder().build())); // when - final Result> result = ysspBidder.makeBids(httpCall, null); + final Result> result = yahooSSPBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -316,7 +316,7 @@ public void makeBidsShouldReturnErrorIfBidResponseSeatBidIsEmpty() throws JsonPr mapper.writeValueAsString(BidResponse.builder().seatbid(emptyList()).build())); // when - final Result> result = ysspBidder.makeBids(httpCall, null); + final Result> result = yahooSSPBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1) @@ -337,7 +337,7 @@ public void makeBidsShouldReturnErrorWhenBidImpIdIsNotPresent() throws JsonProce givenBidResponse(bidBuilder -> bidBuilder.impid("321")))); // when - final Result> result = ysspBidder.makeBids(httpCall, null); + final Result> result = yahooSSPBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).hasSize(1) @@ -362,7 +362,7 @@ public void makeBidsShouldSkipNotBannerImpAndReturnBannerBidWhenBannerPresent() .build())); // when - final Result> result = ysspBidder.makeBids(httpCall, null); + final Result> result = yahooSSPBidder.makeBids(httpCall, null); // then assertThat(result.getErrors()).isEmpty(); @@ -383,7 +383,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, ExtImpYssp.of("dcn", "pos"))))) + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpYahooSSP.of("dcn", "pos"))))) .build(); } diff --git a/src/test/java/org/prebid/server/cookie/UidsCookieServiceTest.java b/src/test/java/org/prebid/server/cookie/UidsCookieServiceTest.java index f0bba87a08f..c1c36d69160 100644 --- a/src/test/java/org/prebid/server/cookie/UidsCookieServiceTest.java +++ b/src/test/java/org/prebid/server/cookie/UidsCookieServiceTest.java @@ -280,7 +280,7 @@ public void toCookieShouldEnforceMaxCookieSizeAndRemoveAUidWithCloserExpirationD .updateUid("sharethrough", "sharethroughUid") .updateUid("improvedigital", "improvedigitalUid") .updateUid("somoaudience", "somoaudienceUid") - .updateUid("yssp", "ysspUid"); + .updateUid("yahoossp", "yahoosspUid"); // the size of uidsCookie above is 530, therefore it is expected to be modified. final int maxCookieSizeBytes = 500; diff --git a/src/test/java/org/prebid/server/it/YsspTest.java b/src/test/java/org/prebid/server/it/YahooSSPTest.java similarity index 57% rename from src/test/java/org/prebid/server/it/YsspTest.java rename to src/test/java/org/prebid/server/it/YahooSSPTest.java index fe919d8c2a3..cfafd2819b0 100644 --- a/src/test/java/org/prebid/server/it/YsspTest.java +++ b/src/test/java/org/prebid/server/it/YahooSSPTest.java @@ -16,23 +16,23 @@ import static java.util.Collections.singletonList; @RunWith(SpringRunner.class) -public class YsspTest extends IntegrationTest { +public class YahooSSPTest extends IntegrationTest { @Test - public void openrtb2AuctionShouldRespondWithBidsFromYssp() throws IOException, JSONException { + public void openrtb2AuctionShouldRespondWithBidsFromYahooSSP() throws IOException, JSONException { // given - WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/yssp-exchange")) + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/yahoossp-exchange")) .withRequestBody(equalToJson( - jsonFrom("openrtb2/yssp/test-yssp-bid-request.json"))) + jsonFrom("openrtb2/yahoossp/test-yahoossp-bid-request.json"))) .willReturn(aResponse().withBody( - jsonFrom("openrtb2/yssp/test-yssp-bid-response.json")))); + jsonFrom("openrtb2/yahoossp/test-yahoossp-bid-response.json")))); // when - final Response response = responseFor("openrtb2/yssp/test-auction-yssp-request.json", + final Response response = responseFor("openrtb2/yahoossp/test-auction-yahoossp-request.json", Endpoint.openrtb2_auction); // then - assertJsonEquals("openrtb2/yssp/test-auction-yssp-response.json", response, - singletonList("yssp")); + assertJsonEquals("openrtb2/yahoossp/test-auction-yahoossp-response.json", response, + singletonList("yahoossp")); } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-auction-yahoossp-request.json similarity index 92% rename from src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-auction-yahoossp-request.json index 829adbc6f87..bda005345c6 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-auction-yahoossp-request.json @@ -8,7 +8,7 @@ "h": 250 }, "ext": { - "yssp": { + "yahoossp": { "dcn": "dcn", "pos": "pos" } @@ -21,4 +21,4 @@ "gdpr": 0 } } -} \ No newline at end of file +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-response.json b/src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-auction-yahoossp-response.json similarity index 87% rename from src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-auction-yahoossp-response.json index 95f5b6749f0..88f585ef00b 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-auction-yssp-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-auction-yahoossp-response.json @@ -19,14 +19,14 @@ } } ], - "seat": "yssp", + "seat": "yahoossp", "group": 0 } ], "cur": "USD", "ext": { "responsetimemillis": { - "yssp": "{{ yssp.response_time_ms }}" + "yahoossp": "{{ yahoossp.response_time_ms }}" }, "prebid": { "auctiontimestamp": 0 diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-yssp-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-yahoossp-bid-request.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/yssp/test-yssp-bid-request.json rename to src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-yahoossp-bid-request.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/yssp/test-yssp-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-yahoossp-bid-response.json similarity index 100% rename from src/test/resources/org/prebid/server/it/openrtb2/yssp/test-yssp-bid-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/yahoossp/test-yahoossp-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 04b3328c92d..b7a603222b7 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -229,8 +229,8 @@ adapters.unruly.enabled=true adapters.unruly.endpoint=http://localhost:8090/unruly-exchange adapters.valueimpression.enabled=true adapters.valueimpression.endpoint=http://localhost:8090/valueimpression-exchange -adapters.yssp.enabled=true -adapters.yssp.endpoint=http://localhost:8090/yssp-exchange +adapters.yahoossp.enabled=true +adapters.yahoossp.endpoint=http://localhost:8090/yahoossp-exchange adapters.vrtcal.enabled=true adapters.vrtcal.endpoint=http://localhost:8090/vrtcal-exchange adapters.visx.enabled=true