diff --git a/sample/configs/prebid-config.yaml b/sample/configs/prebid-config.yaml index 93a53b7952b..9241769535a 100644 --- a/sample/configs/prebid-config.yaml +++ b/sample/configs/prebid-config.yaml @@ -10,6 +10,8 @@ adapters: enabled: true rubicon: enabled: true + startio: + enabled: true metrics: prefix: prebid cache: diff --git a/src/main/java/org/prebid/server/bidder/startio/StartioBidder.java b/src/main/java/org/prebid/server/bidder/startio/StartioBidder.java new file mode 100644 index 00000000000..a5eae973115 --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/startio/StartioBidder.java @@ -0,0 +1,150 @@ +package org.prebid.server.bidder.startio; + +import com.fasterxml.jackson.core.JsonPointer; +import com.fasterxml.jackson.databind.JsonNode; +import com.iab.openrtb.request.App; +import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Imp; +import com.iab.openrtb.request.Site; +import com.iab.openrtb.response.Bid; +import com.iab.openrtb.response.BidResponse; +import com.iab.openrtb.response.SeatBid; +import org.apache.commons.collections4.CollectionUtils; +import org.prebid.server.bidder.Bidder; +import org.prebid.server.bidder.model.BidderBid; +import org.prebid.server.bidder.model.BidderCall; +import org.prebid.server.bidder.model.BidderError; +import org.prebid.server.bidder.model.HttpRequest; +import org.prebid.server.bidder.model.Result; +import org.prebid.server.json.DecodeException; +import org.prebid.server.json.JacksonMapper; +import org.prebid.server.proto.openrtb.ext.response.BidType; +import org.prebid.server.util.BidderUtil; +import org.prebid.server.util.HttpUtil; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +public class StartioBidder implements Bidder { + + private final String endpointUrl; + private final JacksonMapper mapper; + + private static final JsonPointer BID_TYPE_POINTER = JsonPointer.valueOf("/prebid/type"); + private static final String BID_CURRENCY = "USD"; + + public StartioBidder(String endpointUrl, JacksonMapper mapper) { + this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); + this.mapper = Objects.requireNonNull(mapper); + } + + @Override + public final Result>> makeHttpRequests(BidRequest bidRequest) { + + if (hasAppOrSiteId(bidRequest)) { + return Result.withError(BidderError.badInput( + "Bidder requires either app.id or site.id to be specified.")); + } + + if (isSupportedCurrency(bidRequest.getCur())) { + return Result.withError(BidderError.badInput("Unsupported currency, bidder only accepts USD.")); + } + + final List> requests = new ArrayList<>(); + final List errors = new ArrayList<>(); + final List imps = bidRequest.getImp(); + for (int i = 0; i < imps.size(); i++) { + Imp imp = imps.get(i); + if (imp.getBanner() == null && imp.getVideo() == null && imp.getXNative() == null) { + errors.add(BidderError.badInput( + "imp[%d]: Unsupported media type, bidder does not support audio.".formatted(i))); + } else { + if (imp.getAudio() != null) { + imp = imp.toBuilder().audio(null).build(); + } + requests.add(BidderUtil.defaultRequest( + bidRequest.toBuilder().imp(Collections.singletonList(imp)).build(), + endpointUrl, mapper)); + } + } + + return Result.of(requests, errors); + } + + @Override + public final Result> makeBids(BidderCall httpCall, BidRequest bidRequest) { + final BidResponse response; + + try { + response = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); + } catch (DecodeException e) { + return Result.withError(BidderError.badServerResponse(e.getMessage())); + } + + final List errors = new ArrayList<>(); + return Result.of(extractBids(response, errors), errors); + } + + private static List extractBids(BidResponse bidResponse, List errors) { + if (bidResponse == null || CollectionUtils.isEmpty(bidResponse.getSeatbid())) { + return Collections.emptyList(); + } + return bidsFromResponse(bidResponse, errors); + } + + private static List bidsFromResponse(BidResponse bidResponse, List errors) { + return bidResponse.getSeatbid().stream() + .filter(Objects::nonNull) + .map(SeatBid::getBid) + .filter(Objects::nonNull) + .flatMap(Collection::stream) + .map(bid -> constructBidderBid(bid, bidResponse.getCur(), errors)) + .filter(Objects::nonNull) + .toList(); + } + + private static BidderBid constructBidderBid(Bid bid, String currency, List errors) { + final BidType type = getBidType(bid); + if (type != null) { + return BidderBid.of(bid, type, currency); + } + + errors.add(BidderError.badServerResponse( + "Failed to parse bid media type for impression %s.".formatted(bid.getImpid()))); + return null; + } + + private static BidType getBidType(Bid bid) { + final JsonNode ext = bid.getExt(); + if (ext == null) { + return null; + } + + final JsonNode bidType = ext.at(BID_TYPE_POINTER); + if (bidType == null || !bidType.isTextual()) { + return null; + } + + return switch (bidType.textValue()) { + case "banner" -> BidType.banner; + case "video" -> BidType.video; + case "native" -> BidType.xNative; + default -> null; + }; + } + + private static boolean isSupportedCurrency(List currencies) { + return currencies != null && !currencies.isEmpty() && !currencies.contains(BID_CURRENCY); + } + + private static boolean hasAppOrSiteId(BidRequest bidRequest) { + final App app = bidRequest.getApp(); + final Site site = bidRequest.getSite(); + return (app == null || app.getId() == null || app.getId().isEmpty()) + && (site == null || site.getId() == null || site.getId().isEmpty()); + } + +} diff --git a/src/main/java/org/prebid/server/spring/config/bidder/StartioBidderConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/StartioBidderConfiguration.java new file mode 100644 index 00000000000..1cb3bda1cf3 --- /dev/null +++ b/src/main/java/org/prebid/server/spring/config/bidder/StartioBidderConfiguration.java @@ -0,0 +1,41 @@ +package org.prebid.server.spring.config.bidder; + +import org.prebid.server.bidder.BidderDeps; +import org.prebid.server.bidder.startio.StartioBidder; +import org.prebid.server.json.JacksonMapper; +import org.prebid.server.spring.config.bidder.model.BidderConfigurationProperties; +import org.prebid.server.spring.config.bidder.util.BidderDepsAssembler; +import org.prebid.server.spring.config.bidder.util.UsersyncerCreator; +import org.prebid.server.spring.env.YamlPropertySourceFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; + +import jakarta.validation.constraints.NotBlank; + +@Configuration +@PropertySource(value = "classpath:/bidder-config/startio.yaml", factory = YamlPropertySourceFactory.class) +public class StartioBidderConfiguration { + + private static final String BIDDER_NAME = "startio"; + + @Bean("startioConfigurationProperties") + @ConfigurationProperties("adapters.startio") + BidderConfigurationProperties configurationProperties() { + return new BidderConfigurationProperties(); + } + + @Bean + BidderDeps startioBidderDeps(BidderConfigurationProperties startioConfigurationProperties, + @NotBlank @Value("${external-url}") String externalUrl, + JacksonMapper mapper) { + + return BidderDepsAssembler.forBidder(BIDDER_NAME) + .withConfig(startioConfigurationProperties) + .usersyncerCreator(UsersyncerCreator.create(externalUrl)) + .bidderCreator(config -> new StartioBidder(config.getEndpoint(), mapper)) + .assemble(); + } +} diff --git a/src/main/resources/bidder-config/startio.yaml b/src/main/resources/bidder-config/startio.yaml new file mode 100644 index 00000000000..50be8e27fc2 --- /dev/null +++ b/src/main/resources/bidder-config/startio.yaml @@ -0,0 +1,14 @@ +adapters: + startio: + endpoint: http://pbs-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbs + meta-info: + maintainer-email: prebid@start.io + app-media-types: + - banner + - video + - native + site-media-types: + - banner + - video + - native + vendor-id: 1216 diff --git a/src/main/resources/static/bidder-params/startio.json b/src/main/resources/static/bidder-params/startio.json new file mode 100644 index 00000000000..bae19ac4e81 --- /dev/null +++ b/src/main/resources/static/bidder-params/startio.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Start.io Adapter Params", + "description": "A schema which validates params accepted by the Start.io adapter", + "type": "object", + "properties": {}, + "required": [] +} diff --git a/src/test/java/org/prebid/server/bidder/startio/StartioBidderTest.java b/src/test/java/org/prebid/server/bidder/startio/StartioBidderTest.java new file mode 100644 index 00000000000..0045d0c28db --- /dev/null +++ b/src/test/java/org/prebid/server/bidder/startio/StartioBidderTest.java @@ -0,0 +1,328 @@ +package org.prebid.server.bidder.startio; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.iab.openrtb.request.App; +import com.iab.openrtb.request.Audio; +import com.iab.openrtb.request.Banner; +import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Imp; +import com.iab.openrtb.request.Native; +import com.iab.openrtb.request.Site; +import com.iab.openrtb.request.Video; +import com.iab.openrtb.response.Bid; +import com.iab.openrtb.response.BidResponse; +import com.iab.openrtb.response.SeatBid; +import io.netty.handler.codec.http.HttpHeaderValues; +import io.vertx.core.MultiMap; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.prebid.server.VertxTest; +import org.prebid.server.bidder.model.BidderBid; +import org.prebid.server.bidder.model.BidderCall; +import org.prebid.server.bidder.model.BidderError; +import org.prebid.server.bidder.model.HttpRequest; +import org.prebid.server.bidder.model.HttpResponse; +import org.prebid.server.bidder.model.Result; +import org.prebid.server.proto.openrtb.ext.response.BidType; +import org.prebid.server.util.HttpUtil; + +import java.util.List; +import java.util.Map; +import java.util.function.UnaryOperator; + +import static java.util.Arrays.asList; +import static java.util.Collections.singletonList; +import static java.util.function.UnaryOperator.identity; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; +import static org.assertj.core.api.Assertions.tuple; + +public class StartioBidderTest extends VertxTest { + + private StartioBidder target; + + @BeforeEach + public void setUp() { + target = new StartioBidder("http://test.endpoint.com", jacksonMapper); + } + + @Test + public void creationShouldFailOnInvalidEndpointUrl() { + assertThatIllegalArgumentException().isThrownBy( + () -> new StartioBidder("invalid_url", jacksonMapper)); + } + + @Test + public void makeHttpRequestsShouldCorrectlyAddHeaders() { + // given + final BidRequest bidRequest = givenBidRequest(identity()); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getValue()) + .extracting(HttpRequest::getHeaders) + .flatExtracting(MultiMap::entries) + .extracting(Map.Entry::getKey, Map.Entry::getValue) + .containsExactlyInAnyOrder( + tuple(HttpUtil.CONTENT_TYPE_HEADER.toString(), HttpUtil.APPLICATION_JSON_CONTENT_TYPE), + tuple(HttpUtil.ACCEPT_HEADER.toString(), HttpHeaderValues.APPLICATION_JSON.toString())); + } + + @Test + public void makeHttpRequestsShouldReturnErrorIfNoAppOrSiteSpecified() { + // given + final BidRequest bidRequest = givenBidRequest( + requestCustomizer -> requestCustomizer.app(null).site(null), + identity()); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).hasSize(1).contains( + BidderError.badInput("Bidder requires either app.id or site.id to be specified.")); + } + + @Test + public void makeHttpRequestsShouldReturnErrorIfNoAppOrSiteIdSpecified() { + // given + final BidRequest bidRequest = givenBidRequest( + requestCustomizer -> requestCustomizer + .app(App.builder().id(null).build()) + .site(Site.builder().id(null).build()), + identity()); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).hasSize(1).contains( + BidderError.badInput("Bidder requires either app.id or site.id to be specified.")); + } + + @Test + public void makeHttpRequestsShouldReturnRequestIfSiteIdPresent() { + // given + final BidRequest bidRequest = givenBidRequest( + requestCustomizer -> requestCustomizer.app(null) + .site(Site.builder().id("siteId").build()), + identity()); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).hasSize(0); + assertThat(result.getValue()).hasSize(1); + } + + @Test + public void makeHttpRequestsShouldReturnErrorForUnsupportedCurrency() { + // given + final BidRequest bidRequest = givenBidRequest( + requestCustomizer -> requestCustomizer.cur(List.of("EUR")), + identity()); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).hasSize(1).contains( + BidderError.badInput("Unsupported currency, bidder only accepts USD.")); + } + + @Test + public void makeBidsShouldReturnErrorIfResponseBodyCouldNotBeParsed() { + // given + final BidderCall httpCall = givenHttpCall(null, "invalid"); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).hasSize(1) + .allSatisfy(error -> { + assertThat(error.getType()).isEqualTo(BidderError.Type.bad_server_response); + assertThat(error.getMessage()).startsWith("Failed to decode: Unrecognized token"); + }); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProcessingException { + // given + final BidRequest bidRequest = givenBidRequest(identity()); + final BidderCall httpCall = givenHttpCall(bidRequest, mapper.writeValueAsString(null)); + + // when + final Result> result = target.makeBids(httpCall, bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnEmptyListIfBidResponseSeatBidIsNull() throws JsonProcessingException { + // given + final BidRequest bidRequest = givenBidRequest(identity()); + final BidderCall httpCall = givenHttpCall(bidRequest, + mapper.writeValueAsString(BidResponse.builder().build())); + + // when + final Result> result = target.makeBids(httpCall, bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReportErrorAndSkipBidIfCannotParseBidType() throws JsonProcessingException { + // given + final BidRequest bidRequest = givenBidRequest(identity()); + final BidderCall httpCall = givenHttpCall(bidRequest, + givenBidResponse( + givenBid("001", BidType.banner), + givenBid("002", BidType.video), + givenBid("003", BidType.xNative), + givenBid("004", BidType.audio), + givenBid("005", BidType.banner).toBuilder().ext(null).build(), + givenBid("006", BidType.banner).toBuilder().ext( + mapper.createObjectNode().put("prebid", false)).build(), + givenBid("007", BidType.banner).toBuilder().ext( + mapper.createObjectNode().set("prebid", + mapper.createObjectNode().put("type", "not a banner"))).build() + )); + + // when + final Result> result = target.makeBids(httpCall, bidRequest); + + // then + assertThat(result.getErrors()).hasSize(4).allSatisfy( + error -> assertThat( + error.getMessage()).startsWith("Failed to parse bid media type for impression")); + assertThat(result.getValue()).hasSize(3).allSatisfy( + bid -> assertThat(bid.getBid().getImpid()).isIn(List.of("001", "002", "003"))); + } + + @Test + public void makeHttpRequestsShouldReturnErrorWhenImpressionContainsOnlyAudio() { + + // given + final Audio audio = Audio.builder().mimes(List.of("audio/mp3")).build(); + final BidRequest bidRequest = givenBidRequest(identity(), + impBuilder -> impBuilder.id("Imp01").banner(null).video(null).xNative(null).audio(audio)); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getValue()).isEmpty(); + assertThat(result.getErrors()).hasSize(1).contains( + BidderError.badInput("imp[0]: Unsupported media type, bidder does not support audio.")); + } + + @Test + public void makeHttpRequestsShouldRemoveAudioFromImpressionIfItContainsMultipleMediaTypes() { + + // given + final Audio audio = Audio.builder().mimes(List.of("audio/mp3")).build(); + final Banner banner = Banner.builder().build(); + final BidRequest bidRequest = givenBidRequest(identity(), + impBuilder -> impBuilder.id("Imp01").audio(audio).banner(banner)); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).hasSize(1) + .extracting(HttpRequest::getPayload).extracting(BidRequest::getImp).extracting(List::getFirst) + .allSatisfy(impression -> { + assertThat(impression.getAudio()).isEqualTo(null); + assertThat(impression.getBanner()).isEqualTo(banner); + }); + } + + @Test + public void makeHttpRequestsShouldSplitRequestByImpressions() { + // given + final Banner banner = Banner.builder().w(100).h(100).build(); + final Video video = Video.builder().w(100).h(200).build(); + final Native nativeImp = Native.builder().request("request").build(); + final Imp imp1 = givenImp(impBuilder -> impBuilder.id("imp1").banner(banner)); + final Imp imp2 = givenImp(impBuilder -> impBuilder.id("imp2").video(video)); + final Imp imp3 = givenImp(impBuilder -> impBuilder.id("imp3").xNative(nativeImp)); + final BidRequest bidRequest = givenBidRequest( + requestCustomizer -> requestCustomizer.imp(List.of(imp1, imp2, imp3)), + identity()); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + final List> httpRequests = result.getValue(); + assertThat(httpRequests).hasSize(3); + + // Each resulting request contains single impression + assertThat(httpRequests) + .extracting(HttpRequest::getPayload) + .extracting(BidRequest::getImp) + .allSatisfy(impressions -> assertThat(impressions).hasSize(1)); + + // All impressions are correctly passed in the resulting requests + assertThat(httpRequests) + .extracting(HttpRequest::getPayload) + .extracting(BidRequest::getImp) + .extracting(List::getFirst) + .satisfiesExactlyInAnyOrder( + impression -> assertThat(impression).isEqualTo(imp1), + impression -> assertThat(impression).isEqualTo(imp2), + impression -> assertThat(impression).isEqualTo(imp3) + ); + } + + private static BidRequest givenBidRequest( + UnaryOperator bidRequestCustomizer, + UnaryOperator impCustomizer) { + + return bidRequestCustomizer.apply(BidRequest.builder().app(App.builder().id("appId").build()) + .imp(singletonList(givenImp(impCustomizer)))) + .build(); + } + + private static BidRequest givenBidRequest(UnaryOperator impCustomizer) { + return givenBidRequest(identity(), impCustomizer); + } + + private static Imp givenImp(UnaryOperator impCustomizer) { + return impCustomizer.apply(Imp.builder().id("345").banner(Banner.builder().build())).build(); + } + + private static BidderCall givenHttpCall(BidRequest bidRequest, String body) { + return BidderCall.succeededHttp( + HttpRequest.builder().payload(bidRequest).build(), + HttpResponse.of(200, null, body), + null); + } + + private BidderCall givenHttpCall(BidRequest bidRequest, BidResponse bidResponse) + throws JsonProcessingException { + return givenHttpCall(bidRequest, mapper.writeValueAsString(bidResponse)); + } + + private static BidResponse givenBidResponse(Bid... bids) { + return BidResponse.builder().seatbid(singletonList( + SeatBid.builder().bid(asList(bids)).build())).build(); + } + + private static Bid givenBid(String impid, BidType bidType) { + return Bid.builder().impid(impid).ext(mapper.createObjectNode().set("prebid", + mapper.createObjectNode().put("type", bidType.getName()))).build(); + } + +} diff --git a/src/test/java/org/prebid/server/it/StartioTest.java b/src/test/java/org/prebid/server/it/StartioTest.java new file mode 100644 index 00000000000..220e1e2ea3c --- /dev/null +++ b/src/test/java/org/prebid/server/it/StartioTest.java @@ -0,0 +1,60 @@ +package org.prebid.server.it; + +import io.restassured.response.Response; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.junit.runner.RunWith; +import org.prebid.server.model.Endpoint; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.IOException; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; +import static java.util.Collections.singletonList; + +@RunWith(SpringRunner.class) +public class StartioTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromStartio() throws IOException, JSONException { + + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/startio-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/startio/test-startio-bid-request.json"))) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/startio/test-startio-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/startio/test-auction-startio-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/startio/test-auction-startio-response.json", response, singletonList("startio")); + } + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromStartioWithSeparateBidRequestsForMultipleImps() + throws IOException, JSONException { + + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/startio-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/startio/test-startio-bid-request-1.json"))) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/startio/test-startio-bid-response-1.json")))); + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/startio-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/startio/test-startio-bid-request-2.json"))) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/startio/test-startio-bid-response-2.json")))); + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/startio-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/startio/test-startio-bid-request-3.json"))) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/startio/test-startio-bid-response-3.json")))); + + // when + final Response response = responseFor("openrtb2/startio/test-auction-startio-request-multiple-imps.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/startio/test-auction-startio-response-multiple-imps.json", + response, singletonList("startio")); + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-request-multiple-imps.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-request-multiple-imps.json new file mode 100644 index 00000000000..6a5592da774 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-request-multiple-imps.json @@ -0,0 +1,235 @@ +{ + "id": "12345", + "at": 1, + "tmax": 485, + "imp": [ + { + "id": "impId001", + "tagid": "999999-1111-8888-2222-77777777777", + "instl": 1, + "bidfloor": 0.5, + "bidfloorcur": "USD", + "video": { + "api": [ + 7 + ], + "battr": [ + 16 + ], + "companiontype": [ + 1, + 2 + ], + "h": 480, + "w": 320, + "skip": 1, + "mimes": [ + "video/mp4" + ], + "minduration": 5, + "maxduration": 30, + "linearity": 1, + "protocols": [ + 2, + 3, + 5, + 6 + ], + "pos": 7, + "startdelay": 0, + "placement": 4, + "skipmin": 0, + "skipafter": 0, + "companionad": [ + { + "w": 320, + "h": 480, + "pos": 7, + "mimes": [ + "image/jpg", + "image/gif" + ], + "api": [ + 3, + 5, + 6 + ], + "vcm": 1 + } + ], + "delivery": [], + "maxextended": 0, + "ext": { + "rewarded": 1, + "videotype": "rewarded", + "plcmt": 3 + }, + "plcmt": 2 + }, + "metric": [ + { + "type": "viewability", + "value": 0.97, + "vendor": "ZZZ" + } + ], + "displaymanager": "ZZZ", + "displaymanagerver": "42.42.42", + "secure": 1, + "ext": { + "prebid": { + "bidder": { + "startio": {} + } + } + } + }, + { + "id": "impId002", + "banner": { + "w": 320, + "h": 480, + "battr": [ + 16 + ], + "pos": 7, + "mimes": [ + "image/jpg", + "image/gif" + ], + "api": [ + 7 + ] + }, + "secure": 1, + "ext": { + "tid": "0440dd3b-c685-4f4b-bf32-f63f839df055", + "prebid": { + "bidder": { + "startio": { + "param": "paramValue" + } + } + } + } + }, + { + "id": "impId003", + "native": { + "ver": "1.1", + "request": "{\"adunit\":2,\"assets\":[{\"id\":3,\"img\":{\"h\":480,\"hmin\":0,\"type\":3,\"w\":320,\"wmin\":0},\"required\":1},{\"id\":0,\"required\":1,\"title\":{\"len\":25}},{\"data\":{\"len\":25,\"type\":1},\"id\":4,\"required\":1},{\"data\":{\"len\":140,\"type\":2},\"id\":6,\"required\":1}],\"context\":1,\"layout\":1,\"contextsubtype\":11,\"plcmtcnt\":1,\"plcmttype\":2,\"ver\":\"1.1\",\"ext\":{\"banner\":{\"w\":320,\"h\":480}}}" + }, + "tagid": "0420420500", + "secure": 1, + "ext": { + "prebid": { + "bidder": { + "startio": { + "param": "paramValue" + } + } + } + } + } + ], + "app": { + "id": "aaaaaa-ffff-bbbb-eeee-cccccccccccc", + "name": "appname", + "domain": "pubname.com", + "privacypolicy": 1, + "publisher": { + "id": "192837465", + "name": "pubname", + "domain": "pubname.com" + }, + "bundle": "com.pubname.appname", + "content": { + "userrating": "4.53" + }, + "storeurl": "https://play.google.com/store/apps/details?id=com.pubname.appname", + "ver": "2.27.2", + "paid": 0 + }, + "device": { + "ip": "111.111.111.111", + "devicetype": 4, + "carrier": "Verizon ", + "connectiontype": 6, + "make": "samsung", + "model": "SM-G960U", + "ua": "Mozilla/5.0 (Linux; Android 10; SM-G960U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.39 Mobile Safari/537.36", + "os": "Android", + "osv": "10", + "geo": { + "country": "USA", + "city": "Pennsauken", + "type": 2, + "region": "NJ", + "zip": "08110", + "metro": "504", + "ipservice": 3 + }, + "ifa": "11111111-2222-9999-8888-3333333333", + "h": 740, + "w": 360, + "pxratio": 2, + "lmt": 0, + "language": "en" + }, + "cur": [ + "USD" + ], + "bcat": [ + "IAB23-1", + "IAB7-26", + "IAB7-44", + "IAB7-25", + "IAB7-30", + "IAB23-5", + "IAB25-3", + "IAB26-2", + "IAB23-4", + "IAB25-2", + "IAB26-1", + "IAB23-3", + "IAB25-1", + "IAB23-2", + "IAB23-9", + "IAB25-7", + "IAB23-8", + "IAB25-6", + "IAB23-7", + "IAB25-5", + "IAB26-4", + "IAB23-6", + "IAB25-4", + "IAB26-3", + "IAB23-10", + "IAB7-39", + "IAB7-5", + "IAB1-8", + "IAB11-5", + "IAB15-1", + "IAB14-1", + "IAB11-4", + "IAB15-5", + "IAB18-2", + "IAB9-7" + ], + "badv": [ + "domain1.com", + "domain2.com", + "domain3.com", + "domain4.com" + ], + "source": { + "ext": { + "omidpn": "omidpn", + "omidpv": "omidpv" + } + }, + "ext": { + "hb": 1 + } +} + diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-request.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-request.json new file mode 100644 index 00000000000..5e659da50de --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-request.json @@ -0,0 +1,187 @@ +{ + "id": "123456789", + "at": 1, + "tmax": 485, + "imp": [ + { + "id": "123456789", + "tagid": "999999-1111-8888-2222-77777777777", + "instl": 1, + "bidfloor": 0.5, + "bidfloorcur": "USD", + "video": { + "api": [ + 7 + ], + "battr": [ + 16 + ], + "companiontype": [ + 1, + 2 + ], + "h": 480, + "w": 320, + "skip": 1, + "mimes": [ + "video/mp4" + ], + "minduration": 5, + "maxduration": 30, + "linearity": 1, + "protocols": [ + 2, + 3, + 5, + 6 + ], + "pos": 7, + "startdelay": 0, + "placement": 4, + "skipmin": 0, + "skipafter": 0, + "companionad": [ + { + "w": 320, + "h": 480, + "pos": 7, + "mimes": [ + "image/jpg", + "image/gif" + ], + "api": [ + 3, + 5, + 6 + ], + "vcm": 1 + } + ], + "delivery": [], + "maxextended": 0, + "ext": { + "rewarded": 1, + "videotype": "rewarded", + "plcmt": 3 + }, + "plcmt": 2 + }, + "metric": [ + { + "type": "viewability", + "value": 0.97, + "vendor": "ZZZ" + } + ], + "displaymanager": "ZZZ", + "displaymanagerver": "42.42.42", + "secure": 1, + "ext": { + "prebid": { + "bidder": { + "startio": {} + } + } + } + } + ], + "app": { + "id": "aaaaaa-ffff-bbbb-eeee-cccccccccccc", + "name": "appname", + "domain": "pubname.com", + "privacypolicy": 1, + "publisher": { + "id": "192837465", + "name": "pubname", + "domain": "pubname.com" + }, + "bundle": "com.pubname.appname", + "content": { + "userrating": "4.53" + }, + "storeurl": "https://play.google.com/store/apps/details?id=com.pubname.appname", + "ver": "2.27.2", + "paid": 0 + }, + "device": { + "ip": "111.111.111.111", + "devicetype": 4, + "carrier": "Verizon ", + "connectiontype": 6, + "make": "samsung", + "model": "SM-G960U", + "ua": "Mozilla/5.0 (Linux; Android 10; SM-G960U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.39 Mobile Safari/537.36", + "os": "Android", + "osv": "10", + "geo": { + "country": "USA", + "city": "Pennsauken", + "type": 2, + "region": "NJ", + "zip": "08110", + "metro": "504", + "ipservice": 3 + }, + "ifa": "11111111-2222-9999-8888-3333333333", + "h": 740, + "w": 360, + "pxratio": 2, + "lmt": 0, + "language": "en" + }, + "cur": [ + "USD" + ], + "bcat": [ + "IAB23-1", + "IAB7-26", + "IAB7-44", + "IAB7-25", + "IAB7-30", + "IAB23-5", + "IAB25-3", + "IAB26-2", + "IAB23-4", + "IAB25-2", + "IAB26-1", + "IAB23-3", + "IAB25-1", + "IAB23-2", + "IAB23-9", + "IAB25-7", + "IAB23-8", + "IAB25-6", + "IAB23-7", + "IAB25-5", + "IAB26-4", + "IAB23-6", + "IAB25-4", + "IAB26-3", + "IAB23-10", + "IAB7-39", + "IAB7-5", + "IAB1-8", + "IAB11-5", + "IAB15-1", + "IAB14-1", + "IAB11-4", + "IAB15-5", + "IAB18-2", + "IAB9-7" + ], + "badv": [ + "domain1.com", + "domain2.com", + "domain3.com", + "domain4.com" + ], + "source": { + "ext": { + "omidpn": "omidpn", + "omidpv": "omidpv" + } + }, + "ext": { + "hb": 1 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-response-multiple-imps.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-response-multiple-imps.json new file mode 100644 index 00000000000..5a9205ff663 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-response-multiple-imps.json @@ -0,0 +1,114 @@ +{ + "id": "12345", + "seatbid": [ + { + "bid": [ + { + "id": "0213b3e3-c59a-4129-aba5-458ad77b2d30", + "impid": "impId001", + "price": 0.6018685301576561, + "nurl": "https://adwin.startappservice.com/adwin/api/v1.0/adwin?d=dparam", + "lurl": "https://img.image.com/product/image.jpg", + "adm": "\n \n \n iabtechlab\n http://example.com/error\n \n \n \n \n \n \n \n http://example.com/track/impression\n \n \n \n iabtechlab video ad\n AD CONTENT description category\n \n \n 8465\n \n \n http://example.com/tracking/start\n http://example.com/tracking/firstQuartile\n http://example.com/tracking/midpoint\n http://example.com/tracking/thirdQuartile\n http://example.com/tracking/complete\n http://example.com/tracking/progress-10\n \n 00:00:16\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n", + "adomain": [ + "start.io" + ], + "iurl": "https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=dparam", + "cid": "9147870261277510647", + "crid": "4176712578365726823", + "cat": [ + "IAB0" + ], + "w": 480, + "h": 320, + "exp": 1500, + "ext": { + "origbidcpm": 0.6018685301576561, + "origbidcur": "USD", + "prebid": { + "type": "video", + "meta": { + "adaptercode": "startio" + } + } + } + }, + { + "id": "01b916af-70bd-4032-8fa3-b70ceea87150", + "impid": "impId002", + "price": 0.48378391855747593, + "nurl": "https://adwin.startappservice.com/adwin/api/v1.0/adwin?d=dparam", + "lurl": "https://img.image.com/product/image.jpg", + "adm": "\n", + "adomain": [ + "start.io" + ], + "iurl": "https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=dparam", + "cid": "608765636039546023", + "crid": "6487611316533858701", + "cat": [], + "w": 480, + "h": 320, + "exp": 300, + "ext": { + "origbidcpm": 0.48378391855747593, + "origbidcur": "USD", + "prebid": { + "type": "banner", + "meta": { + "adaptercode": "startio" + } + } + } + }, + { + "id": "00881ac4-d1f9-4f7b-a05d-c741cc8755eb", + "impid": "impId003", + "price": 0.8160129797250805, + "nurl": "https://adwin.startappservice.com/adwin/api/v1.0/adwin?d=dparam", + "lurl": "https://img.image.com/product/image.jpg", + "adm": "{\"native\":{\"assets\":[{\"id\":1,\"title\":{\"len\":90,\"text\":\"Title\"}},{\"id\":2,\"img\":{\"w\":320,\"h\":250,\"url\":\"https://img.image.com/product/image.jpg\"}},{\"id\":3,\"img\":{\"w\":50,\"h\":50,\"url\":\"https://img.image.com/product/icon.jpg\"}},{\"id\":4,\"data\":{\"type\":2,\"value\":\"Description\"}},{\"id\":5,\"data\":{\"type\":1,\"value\":\"Sponsored by Start.io\"}}],\"link\":{\"url\":\"https://click.url.com\"},\"imptrackers\":[\"https://impression.url.com\"],\"eventtrackers\":[{\"event\":1,\"method\":1,\"url\":\"https://event.url.com\"}],\"ver\":\"1.2\"}}", + "adomain": [ + "start.io" + ], + "iurl": "https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=dparam", + "cid": "3964362510039318661", + "crid": "4750185616442446679", + "cat": [ + "IAB6-5", + "IAB6-8", + "IAB6-4", + "IAB6-7", + "IAB6-6", + "IAB6-2" + ], + "w": 480, + "h": 320, + "exp": 300, + "ext": { + "origbidcpm": 0.8160129797250805, + "origbidcur": "USD", + "prebid": { + "type": "native", + "meta": { + "adaptercode": "startio" + } + } + } + } + ], + "seat": "startio", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "startio": "{{ startio.response_time_ms }}" + }, + "tmaxrequest": 485, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-response.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-response.json new file mode 100644 index 00000000000..6d1805379ea --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-auction-startio-response.json @@ -0,0 +1,51 @@ +{ + "id": "123456789", + "seatbid": [ + { + "bid": [ + { + "id": "0213b3e3-c59a-4129-aba5-458ad77b2d30", + "impid": "123456789", + "price": 0.6018685301576561, + "nurl": "https://adwin.startappservice.com/adwin/api/v1.0/adwin?d=dparam", + "lurl": "https://img.image.com/product/image.jpg", + "adm": "\n \n \n iabtechlab\n http://example.com/error\n \n \n \n \n \n \n \n http://example.com/track/impression\n \n \n \n iabtechlab video ad\n AD CONTENT description category\n \n \n 8465\n \n \n http://example.com/tracking/start\n http://example.com/tracking/firstQuartile\n http://example.com/tracking/midpoint\n http://example.com/tracking/thirdQuartile\n http://example.com/tracking/complete\n http://example.com/tracking/progress-10\n \n 00:00:16\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n", + "adomain": [ + "start.io" + ], + "iurl": "https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=dparam", + "cid": "9147870261277510647", + "crid": "4176712578365726823", + "cat": [ + "IAB0" + ], + "w": 480, + "h": 320, + "exp": 1500, + "ext": { + "origbidcpm": 0.6018685301576561, + "origbidcur": "USD", + "prebid": { + "type": "video", + "meta": { + "adaptercode": "startio" + } + } + } + } + ], + "seat": "startio", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "startio": "{{ startio.response_time_ms }}" + }, + "tmaxrequest": 485, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-1.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-1.json new file mode 100644 index 00000000000..08f132e4af2 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-1.json @@ -0,0 +1,196 @@ +{ + "id": "12345", + "imp": [ + { + "id": "impId001", + "metric": [ + { + "type": "viewability", + "value": 0.97, + "vendor": "ZZZ" + } + ], + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 5, + "maxduration": 30, + "startdelay": 0, + "protocols": [ + 2, + 3, + 5, + 6 + ], + "w": 320, + "h": 480, + "placement": 4, + "plcmt": 2, + "linearity": 1, + "skip": 1, + "skipmin": 0, + "skipafter": 0, + "battr": [ + 16 + ], + "maxextended": 0, + "delivery": [], + "pos": 7, + "companionad": [ + { + "w": 320, + "h": 480, + "pos": 7, + "mimes": [ + "image/jpg", + "image/gif" + ], + "api": [ + 3, + 5, + 6 + ], + "vcm": 1 + } + ], + "api": [ + 7 + ], + "companiontype": [ + 1, + 2 + ], + "ext": { + "rewarded": 1, + "videotype": "rewarded", + "plcmt": 3 + } + }, + "displaymanager": "ZZZ", + "displaymanagerver": "42.42.42", + "instl": 1, + "tagid": "999999-1111-8888-2222-77777777777", + "bidfloor": 0.5, + "bidfloorcur": "USD", + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": {} + } + } + ], + "app": { + "id": "aaaaaa-ffff-bbbb-eeee-cccccccccccc", + "name": "appname", + "bundle": "com.pubname.appname", + "domain": "pubname.com", + "storeurl": "https://play.google.com/store/apps/details?id=com.pubname.appname", + "ver": "2.27.2", + "privacypolicy": 1, + "paid": 0, + "publisher": { + "id": "192837465", + "name": "pubname", + "domain": "pubname.com" + }, + "content": { + "userrating": "4.53" + } + }, + "device": { + "geo": { + "type": 2, + "ipservice": 3, + "country": "USA", + "region": "NJ", + "metro": "504", + "city": "Pennsauken", + "zip": "08110" + }, + "lmt": 0, + "ua": "Mozilla/5.0 (Linux; Android 10; SM-G960U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.39 Mobile Safari/537.36", + "ip": "111.111.111.111", + "devicetype": 4, + "make": "samsung", + "model": "SM-G960U", + "os": "Android", + "osv": "10", + "h": 740, + "w": 360, + "pxratio": 2, + "language": "en", + "carrier": "Verizon ", + "connectiontype": 6, + "ifa": "11111111-2222-9999-8888-3333333333" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "bcat": [ + "IAB23-1", + "IAB7-26", + "IAB7-44", + "IAB7-25", + "IAB7-30", + "IAB23-5", + "IAB25-3", + "IAB26-2", + "IAB23-4", + "IAB25-2", + "IAB26-1", + "IAB23-3", + "IAB25-1", + "IAB23-2", + "IAB23-9", + "IAB25-7", + "IAB23-8", + "IAB25-6", + "IAB23-7", + "IAB25-5", + "IAB26-4", + "IAB23-6", + "IAB25-4", + "IAB26-3", + "IAB23-10", + "IAB7-39", + "IAB7-5", + "IAB1-8", + "IAB11-5", + "IAB15-1", + "IAB14-1", + "IAB11-4", + "IAB15-5", + "IAB18-2", + "IAB9-7" + ], + "badv": [ + "domain1.com", + "domain2.com", + "domain3.com", + "domain4.com" + ], + "source": { + "tid": "${json-unit.any-string}", + "ext": { + "omidpv": "omidpv", + "omidpn": "omidpn" + } + }, + "ext": { + "prebid": { + "channel": { + "name": "app" + }, + "server": { + "externalurl": "http://localhost:8080", + "gvlid": 1, + "datacenter": "local", + "endpoint": "/openrtb2/auction" + } + }, + "hb": 1 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-2.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-2.json new file mode 100644 index 00000000000..35f9db6d2c4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-2.json @@ -0,0 +1,142 @@ +{ + "id": "12345", + "imp": [ + { + "id": "impId002", + "banner": { + "w": 320, + "h": 480, + "battr": [ + 16 + ], + "pos": 7, + "mimes": [ + "image/jpg", + "image/gif" + ], + "api": [ + 7 + ] + }, + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": { + "param": "paramValue" + } + } + } ], + "app": { + "id": "aaaaaa-ffff-bbbb-eeee-cccccccccccc", + "name": "appname", + "bundle": "com.pubname.appname", + "domain": "pubname.com", + "storeurl": "https://play.google.com/store/apps/details?id=com.pubname.appname", + "ver": "2.27.2", + "privacypolicy": 1, + "paid": 0, + "publisher": { + "id": "192837465", + "name": "pubname", + "domain": "pubname.com" + }, + "content": { + "userrating": "4.53" + } + }, + "device": { + "geo": { + "type": 2, + "ipservice": 3, + "country": "USA", + "region": "NJ", + "metro": "504", + "city": "Pennsauken", + "zip": "08110" + }, + "lmt": 0, + "ua": "Mozilla/5.0 (Linux; Android 10; SM-G960U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.39 Mobile Safari/537.36", + "ip": "111.111.111.111", + "devicetype": 4, + "make": "samsung", + "model": "SM-G960U", + "os": "Android", + "osv": "10", + "h": 740, + "w": 360, + "pxratio": 2, + "language": "en", + "carrier": "Verizon ", + "connectiontype": 6, + "ifa": "11111111-2222-9999-8888-3333333333" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "bcat": [ + "IAB23-1", + "IAB7-26", + "IAB7-44", + "IAB7-25", + "IAB7-30", + "IAB23-5", + "IAB25-3", + "IAB26-2", + "IAB23-4", + "IAB25-2", + "IAB26-1", + "IAB23-3", + "IAB25-1", + "IAB23-2", + "IAB23-9", + "IAB25-7", + "IAB23-8", + "IAB25-6", + "IAB23-7", + "IAB25-5", + "IAB26-4", + "IAB23-6", + "IAB25-4", + "IAB26-3", + "IAB23-10", + "IAB7-39", + "IAB7-5", + "IAB1-8", + "IAB11-5", + "IAB15-1", + "IAB14-1", + "IAB11-4", + "IAB15-5", + "IAB18-2", + "IAB9-7" + ], + "badv": [ + "domain1.com", + "domain2.com", + "domain3.com", + "domain4.com" + ], + "source": { + "tid": "${json-unit.any-string}", + "ext": { + "omidpv": "omidpv", + "omidpn": "omidpn" + } + }, + "ext": { + "prebid": { + "channel": { + "name": "app" + }, + "server": { + "externalurl": "http://localhost:8080", + "gvlid": 1, + "datacenter": "local", + "endpoint": "/openrtb2/auction" + } + }, + "hb": 1 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-3.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-3.json new file mode 100644 index 00000000000..e1ece75e1e0 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request-3.json @@ -0,0 +1,133 @@ +{ + "id": "12345", + "imp": [ + { + "id": "impId003", + "native": { + "request": "{\"ver\":\"1.1\",\"context\":1,\"contextsubtype\":11,\"plcmttype\":2,\"plcmtcnt\":1,\"assets\":[{\"id\":3,\"required\":1,\"img\":{\"type\":3,\"w\":320,\"wmin\":0,\"h\":480,\"hmin\":0}},{\"id\":0,\"required\":1,\"title\":{\"len\":25}},{\"id\":4,\"required\":1,\"data\":{\"type\":1,\"len\":25}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":140}}],\"adunit\":2,\"layout\":1,\"ext\":{\"banner\":{\"w\":320,\"h\":480}}}", + "ver": "1.1" + }, + "tagid": "0420420500", + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": { + "param": "paramValue" + } + } + } + ], + "app": { + "id": "aaaaaa-ffff-bbbb-eeee-cccccccccccc", + "name": "appname", + "bundle": "com.pubname.appname", + "domain": "pubname.com", + "storeurl": "https://play.google.com/store/apps/details?id=com.pubname.appname", + "ver": "2.27.2", + "privacypolicy": 1, + "paid": 0, + "publisher": { + "id": "192837465", + "name": "pubname", + "domain": "pubname.com" + }, + "content": { + "userrating": "4.53" + } + }, + "device": { + "geo": { + "type": 2, + "ipservice": 3, + "country": "USA", + "region": "NJ", + "metro": "504", + "city": "Pennsauken", + "zip": "08110" + }, + "lmt": 0, + "ua": "Mozilla/5.0 (Linux; Android 10; SM-G960U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.39 Mobile Safari/537.36", + "ip": "111.111.111.111", + "devicetype": 4, + "make": "samsung", + "model": "SM-G960U", + "os": "Android", + "osv": "10", + "h": 740, + "w": 360, + "pxratio": 2, + "language": "en", + "carrier": "Verizon ", + "connectiontype": 6, + "ifa": "11111111-2222-9999-8888-3333333333" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "bcat": [ + "IAB23-1", + "IAB7-26", + "IAB7-44", + "IAB7-25", + "IAB7-30", + "IAB23-5", + "IAB25-3", + "IAB26-2", + "IAB23-4", + "IAB25-2", + "IAB26-1", + "IAB23-3", + "IAB25-1", + "IAB23-2", + "IAB23-9", + "IAB25-7", + "IAB23-8", + "IAB25-6", + "IAB23-7", + "IAB25-5", + "IAB26-4", + "IAB23-6", + "IAB25-4", + "IAB26-3", + "IAB23-10", + "IAB7-39", + "IAB7-5", + "IAB1-8", + "IAB11-5", + "IAB15-1", + "IAB14-1", + "IAB11-4", + "IAB15-5", + "IAB18-2", + "IAB9-7" + ], + "badv": [ + "domain1.com", + "domain2.com", + "domain3.com", + "domain4.com" + ], + "source": { + "tid": "${json-unit.any-string}", + "ext": { + "omidpv": "omidpv", + "omidpn": "omidpn" + } + }, + "ext": { + "prebid": { + "channel": { + "name": "app" + }, + "server": { + "externalurl": "http://localhost:8080", + "gvlid": 1, + "datacenter": "local", + "endpoint": "/openrtb2/auction" + } + }, + "hb": 1 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request.json new file mode 100644 index 00000000000..d62a63548d4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-request.json @@ -0,0 +1,196 @@ +{ + "id": "123456789", + "imp": [ + { + "id": "123456789", + "metric": [ + { + "type": "viewability", + "value": 0.97, + "vendor": "ZZZ" + } + ], + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 5, + "maxduration": 30, + "startdelay": 0, + "protocols": [ + 2, + 3, + 5, + 6 + ], + "w": 320, + "h": 480, + "placement": 4, + "plcmt": 2, + "linearity": 1, + "skip": 1, + "skipmin": 0, + "skipafter": 0, + "battr": [ + 16 + ], + "maxextended": 0, + "delivery": [], + "pos": 7, + "companionad": [ + { + "w": 320, + "h": 480, + "pos": 7, + "mimes": [ + "image/jpg", + "image/gif" + ], + "api": [ + 3, + 5, + 6 + ], + "vcm": 1 + } + ], + "api": [ + 7 + ], + "companiontype": [ + 1, + 2 + ], + "ext": { + "rewarded": 1, + "videotype": "rewarded", + "plcmt": 3 + } + }, + "displaymanager": "ZZZ", + "displaymanagerver": "42.42.42", + "instl": 1, + "tagid": "999999-1111-8888-2222-77777777777", + "bidfloor": 0.5, + "bidfloorcur": "USD", + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": {} + } + } + ], + "app": { + "id": "aaaaaa-ffff-bbbb-eeee-cccccccccccc", + "name": "appname", + "bundle": "com.pubname.appname", + "domain": "pubname.com", + "storeurl": "https://play.google.com/store/apps/details?id=com.pubname.appname", + "ver": "2.27.2", + "privacypolicy": 1, + "paid": 0, + "publisher": { + "id": "192837465", + "name": "pubname", + "domain": "pubname.com" + }, + "content": { + "userrating": "4.53" + } + }, + "device": { + "geo": { + "type": 2, + "ipservice": 3, + "country": "USA", + "region": "NJ", + "metro": "504", + "city": "Pennsauken", + "zip": "08110" + }, + "lmt": 0, + "ua": "Mozilla/5.0 (Linux; Android 10; SM-G960U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.39 Mobile Safari/537.36", + "ip": "111.111.111.111", + "devicetype": 4, + "make": "samsung", + "model": "SM-G960U", + "os": "Android", + "osv": "10", + "h": 740, + "w": 360, + "pxratio": 2, + "language": "en", + "carrier": "Verizon ", + "connectiontype": 6, + "ifa": "11111111-2222-9999-8888-3333333333" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "bcat": [ + "IAB23-1", + "IAB7-26", + "IAB7-44", + "IAB7-25", + "IAB7-30", + "IAB23-5", + "IAB25-3", + "IAB26-2", + "IAB23-4", + "IAB25-2", + "IAB26-1", + "IAB23-3", + "IAB25-1", + "IAB23-2", + "IAB23-9", + "IAB25-7", + "IAB23-8", + "IAB25-6", + "IAB23-7", + "IAB25-5", + "IAB26-4", + "IAB23-6", + "IAB25-4", + "IAB26-3", + "IAB23-10", + "IAB7-39", + "IAB7-5", + "IAB1-8", + "IAB11-5", + "IAB15-1", + "IAB14-1", + "IAB11-4", + "IAB15-5", + "IAB18-2", + "IAB9-7" + ], + "badv": [ + "domain1.com", + "domain2.com", + "domain3.com", + "domain4.com" + ], + "source": { + "tid": "${json-unit.any-string}", + "ext": { + "omidpv": "omidpv", + "omidpn": "omidpn" + } + }, + "ext": { + "prebid": { + "channel": { + "name": "app" + }, + "server": { + "externalurl": "http://localhost:8080", + "gvlid": 1, + "datacenter": "local", + "endpoint": "/openrtb2/auction" + } + }, + "hb": 1 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-1.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-1.json new file mode 100644 index 00000000000..cf0604e10b8 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-1.json @@ -0,0 +1,37 @@ +{ + "id": "123456789", + "seatbid": [ + { + "bid": [ + { + "id": "0213b3e3-c59a-4129-aba5-458ad77b2d30", + "impid": "impId001", + "price": 0.6018685301576561, + "adm": "\n \n \n iabtechlab\n http://example.com/error\n \n \n \n \n \n \n \n http://example.com/track/impression\n \n \n \n iabtechlab video ad\n AD CONTENT description category\n \n \n 8465\n \n \n http://example.com/tracking/start\n http://example.com/tracking/firstQuartile\n http://example.com/tracking/midpoint\n http://example.com/tracking/thirdQuartile\n http://example.com/tracking/complete\n http://example.com/tracking/progress-10\n \n 00:00:16\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n", + "nurl": "https://adwin.startappservice.com/adwin/api/v1.0/adwin?d=dparam", + "lurl": "https://img.image.com/product/image.jpg", + "iurl": "https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=dparam", + "adomain": [ + "start.io" + ], + "cid": "9147870261277510647", + "crid": "4176712578365726823", + "w": 480, + "h": 320, + "cat": [ + "IAB0" + ], + "ext": { + "prebid":{ + "type": "video" + } + } + } + ], + "seat": "start.io", + "group": 0 + } + ], + "cur": "USD", + "bidid": "e3c853f1-fc21-42bb-8896-59fed5564789" +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-2.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-2.json new file mode 100644 index 00000000000..984bf62c9ce --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-2.json @@ -0,0 +1,35 @@ +{ + "id": "12345", + "seatbid": [ + { + "bid": [ + { + "id": "01b916af-70bd-4032-8fa3-b70ceea87150", + "impid": "impId002", + "price": 0.48378391855747593, + "adm": "\n", + "nurl": "https://adwin.startappservice.com/adwin/api/v1.0/adwin?d=dparam", + "lurl": "https://img.image.com/product/image.jpg", + "iurl": "https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=dparam", + "adomain": [ + "start.io" + ], + "cid": "608765636039546023", + "crid": "6487611316533858701", + "w": 480, + "h": 320, + "cat": [], + "ext": { + "prebid":{ + "type": "banner" + } + } + } + ], + "seat": "start.io", + "group": 0 + } + ], + "cur": "USD", + "bidid": "4d57a59e-3bf3-4792-9fda-95df536608a7" +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-3.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-3.json new file mode 100644 index 00000000000..52b2c241bfc --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response-3.json @@ -0,0 +1,42 @@ +{ + "id": "r8cd85aed-25a6-4db0-ad98-4a3af1f7601cr", + "seatbid": [ + { + "bid": [ + { + "id": "00881ac4-d1f9-4f7b-a05d-c741cc8755eb", + "impid": "impId003", + "price": 0.8160129797250805, + "adm": "{\"native\":{\"assets\":[{\"id\":1,\"title\":{\"len\":90,\"text\":\"Title\"}},{\"id\":2,\"img\":{\"w\":320,\"h\":250,\"url\":\"https://img.image.com/product/image.jpg\"}},{\"id\":3,\"img\":{\"w\":50,\"h\":50,\"url\":\"https://img.image.com/product/icon.jpg\"}},{\"id\":4,\"data\":{\"type\":2,\"value\":\"Description\"}},{\"id\":5,\"data\":{\"type\":1,\"value\":\"Sponsored by Start.io\"}}],\"link\":{\"url\":\"https://click.url.com\"},\"imptrackers\":[\"https://impression.url.com\"],\"eventtrackers\":[{\"event\":1,\"method\":1,\"url\":\"https://event.url.com\"}],\"ver\":\"1.2\"}}", + "nurl": "https://adwin.startappservice.com/adwin/api/v1.0/adwin?d=dparam", + "lurl": "https://img.image.com/product/image.jpg", + "iurl": "https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=dparam", + "adomain": [ + "start.io" + ], + "cid": "3964362510039318661", + "crid": "4750185616442446679", + "w": 480, + "h": 320, + "cat": [ + "IAB6-5", + "IAB6-8", + "IAB6-4", + "IAB6-7", + "IAB6-6", + "IAB6-2" + ], + "ext": { + "prebid":{ + "type": "native" + } + } + } + ], + "seat": "start.io", + "group": 0 + } + ], + "cur": "USD", + "bidid": "3f7acaad-f29a-4a2b-90bb-b44d206d4b14" +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response.json new file mode 100644 index 00000000000..dac8b1ab26b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/startio/test-startio-bid-response.json @@ -0,0 +1,37 @@ +{ + "id": "123456789", + "seatbid": [ + { + "bid": [ + { + "id": "0213b3e3-c59a-4129-aba5-458ad77b2d30", + "impid": "123456789", + "price": 0.6018685301576561, + "adm": "\n \n \n iabtechlab\n http://example.com/error\n \n \n \n \n \n \n \n http://example.com/track/impression\n \n \n \n iabtechlab video ad\n AD CONTENT description category\n \n \n 8465\n \n \n http://example.com/tracking/start\n http://example.com/tracking/firstQuartile\n http://example.com/tracking/midpoint\n http://example.com/tracking/thirdQuartile\n http://example.com/tracking/complete\n http://example.com/tracking/progress-10\n \n 00:00:16\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n", + "nurl": "https://adwin.startappservice.com/adwin/api/v1.0/adwin?d=dparam", + "lurl": "https://img.image.com/product/image.jpg", + "iurl": "https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=dparam", + "adomain": [ + "start.io" + ], + "cid": "9147870261277510647", + "crid": "4176712578365726823", + "w": 480, + "h": 320, + "cat": [ + "IAB0" + ], + "ext": { + "prebid":{ + "type": "video" + } + } + } + ], + "seat": "start.io", + "group": 0 + } + ], + "cur": "USD", + "bidid": "e3c853f1-fc21-42bb-8896-59fed5564788" +} 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 860aec4ac8c..ca2fff088e6 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -453,6 +453,8 @@ adapters.silvermob.enabled=true adapters.silvermob.endpoint=http://localhost:8090/silvermob-exchange adapters.silverpush.enabled=true adapters.silverpush.endpoint=http://localhost:8090/silverpush-exchange +adapters.startio.enabled=true +adapters.startio.endpoint=http://localhost:8090/startio-exchange adapters.stroeercore..enabled=true adapters.stroeercore.endpoint=http://localhost:8090/stroeercore-exchange adapters.suntContent.enabled=true