diff --git a/src/main/java/org/prebid/server/bidder/smoot/SmootBidder.java b/src/main/java/org/prebid/server/bidder/smoot/SmootBidder.java new file mode 100644 index 00000000000..ec054d9982d --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/smoot/SmootBidder.java @@ -0,0 +1,117 @@ +package org.prebid.server.bidder.smoot; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Imp; +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.apache.commons.lang3.StringUtils; +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.exception.PreBidException; +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.smoot.ExtImpSmoot; +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 SmootBidder implements Bidder { + + private static final TypeReference> SMOOT_EXT_TYPE_REFERENCE = new TypeReference<>() { + }; + + private final String endpointUrl; + private final JacksonMapper mapper; + + public SmootBidder(String endpointUrl, JacksonMapper mapper) { + this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); + this.mapper = Objects.requireNonNull(mapper); + } + + @Override + public Result>> makeHttpRequests(BidRequest request) { + final List> httpRequests = new ArrayList<>(); + final List errors = new ArrayList<>(); + + for (Imp imp : request.getImp()) { + try { + final ExtImpSmoot extImpSmoot = parseImpExt(imp); + final Imp modifiedImp = modifyImp(imp, extImpSmoot); + final BidRequest outgoingRequest = request.toBuilder() + .imp(Collections.singletonList(modifiedImp)) + .build(); + httpRequests.add(BidderUtil.defaultRequest(outgoingRequest, endpointUrl, mapper)); + } catch (PreBidException e) { + errors.add(BidderError.badInput(e.getMessage())); + } + } + + return Result.of(httpRequests, errors); + } + + private ExtImpSmoot parseImpExt(Imp imp) { + try { + return mapper.mapper().convertValue(imp.getExt(), SMOOT_EXT_TYPE_REFERENCE).getBidder(); + } catch (IllegalArgumentException e) { + throw new PreBidException("Error parsing imp.ext: " + e.getMessage()); + } + } + + private Imp modifyImp(Imp imp, ExtImpSmoot extImpSmoot) { + final SmootImpExt smootImpExt = StringUtils.isNotEmpty(extImpSmoot.getPlacementId()) + ? SmootImpExt.publisher(extImpSmoot.getPlacementId()) + : SmootImpExt.network(extImpSmoot.getEndpointId()); + + return imp.toBuilder() + .ext(mapper.mapper().createObjectNode().set("bidder", mapper.mapper().valueToTree(smootImpExt))) + .build(); + } + + @Override + public Result> makeBids(BidderCall httpCall, BidRequest bidRequest) { + try { + final BidResponse bidResponse = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); + return Result.withValues(extractBids(bidResponse)); + } catch (DecodeException | PreBidException e) { + return Result.withError(BidderError.badServerResponse(e.getMessage())); + } + } + + private static List extractBids(BidResponse bidResponse) { + if (bidResponse == null || CollectionUtils.isEmpty(bidResponse.getSeatbid())) { + return Collections.emptyList(); + } + return bidResponse.getSeatbid().stream() + .filter(Objects::nonNull) + .map(SeatBid::getBid) + .filter(Objects::nonNull) + .flatMap(Collection::stream) + .filter(Objects::nonNull) + .map(bid -> BidderBid.of(bid, getBidType(bid), bidResponse.getCur())) + .toList(); + } + + private static BidType getBidType(Bid bid) { + return switch (bid.getMtype()) { + case 1 -> BidType.banner; + case 2 -> BidType.video; + case 4 -> BidType.xNative; + case null, default -> + throw new PreBidException("could not define media type for impression: " + bid.getImpid()); + }; + } +} diff --git a/src/main/java/org/prebid/server/bidder/smoot/SmootImpExt.java b/src/main/java/org/prebid/server/bidder/smoot/SmootImpExt.java new file mode 100644 index 00000000000..214b6f37bc9 --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/smoot/SmootImpExt.java @@ -0,0 +1,24 @@ +package org.prebid.server.bidder.smoot; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Value; + +@Value(staticConstructor = "of") +public class SmootImpExt { + + String type; + + @JsonProperty("placementId") + String placementId; + + @JsonProperty("endpointId") + String endpointId; + + public static SmootImpExt publisher(String placementId) { + return SmootImpExt.of("publisher", placementId, null); + } + + public static SmootImpExt network(String endpointId) { + return SmootImpExt.of("network", null, endpointId); + } +} diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/smoot/ExtImpSmoot.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/smoot/ExtImpSmoot.java new file mode 100644 index 00000000000..6f7e8775a91 --- /dev/null +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/smoot/ExtImpSmoot.java @@ -0,0 +1,14 @@ +package org.prebid.server.proto.openrtb.ext.request.smoot; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Value; + +@Value(staticConstructor = "of") +public class ExtImpSmoot { + + @JsonProperty("placementId") + String placementId; + + @JsonProperty("endpointId") + String endpointId; +} diff --git a/src/main/java/org/prebid/server/spring/config/bidder/SmootConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/SmootConfiguration.java new file mode 100644 index 00000000000..154bb8c4779 --- /dev/null +++ b/src/main/java/org/prebid/server/spring/config/bidder/SmootConfiguration.java @@ -0,0 +1,41 @@ +package org.prebid.server.spring.config.bidder; + +import org.prebid.server.bidder.BidderDeps; +import org.prebid.server.bidder.smoot.SmootBidder; +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/smoot.yaml", factory = YamlPropertySourceFactory.class) +public class SmootConfiguration { + + private static final String BIDDER_NAME = "smoot"; + + @Bean("smootConfigurationProperties") + @ConfigurationProperties("adapters.smoot") + BidderConfigurationProperties configurationProperties() { + return new BidderConfigurationProperties(); + } + + @Bean + BidderDeps smootBidderDeps(BidderConfigurationProperties smootConfigurationProperties, + @NotBlank @Value("${external-url}") String externalUrl, + JacksonMapper mapper) { + + return BidderDepsAssembler.forBidder(BIDDER_NAME) + .withConfig(smootConfigurationProperties) + .usersyncerCreator(UsersyncerCreator.create(externalUrl)) + .bidderCreator(config -> new SmootBidder(config.getEndpoint(), mapper)) + .assemble(); + } +} diff --git a/src/main/resources/bidder-config/smoot.yaml b/src/main/resources/bidder-config/smoot.yaml new file mode 100644 index 00000000000..a1690cbb8ba --- /dev/null +++ b/src/main/resources/bidder-config/smoot.yaml @@ -0,0 +1,21 @@ +adapters: + smoot: + endpoint: 'https://endpoint1.smoot.ai/pserver' + meta-info: + maintainer-email: 'info@smoot.ai' + app-media-types: + - banner + - video + - native + site-media-types: + - banner + - video + - native + supported-vendors: + vendor-id: 0 + usersync: + cookie-family-name: smoot + redirect: + support-cors: false + url: 'https://usync.smxconv.com/pbserver?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&redir={{redirect_url}}' + uid-macro: '[UID]' diff --git a/src/main/resources/static/bidder-params/smoot.json b/src/main/resources/static/bidder-params/smoot.json new file mode 100644 index 00000000000..017047107cf --- /dev/null +++ b/src/main/resources/static/bidder-params/smoot.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Smoot Adapter Params", + "description": "A schema which validates params accepted by the Smoot adapter", + "type": "object", + "properties": { + "placementId": { + "type": "string", + "minLength": 1, + "description": "Placement ID" + }, + "endpointId": { + "type": "string", + "minLength": 1, + "description": "Endpoint ID" + } + }, + "oneOf": [ + { + "required": [ + "placementId" + ] + }, + { + "required": [ + "endpointId" + ] + } + ] +} diff --git a/src/test/java/org/prebid/server/bidder/smoot/SmootBidderTest.java b/src/test/java/org/prebid/server/bidder/smoot/SmootBidderTest.java new file mode 100644 index 00000000000..edaeb6fb695 --- /dev/null +++ b/src/test/java/org/prebid/server/bidder/smoot/SmootBidderTest.java @@ -0,0 +1,282 @@ +package org.prebid.server.bidder.smoot; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Imp; +import com.iab.openrtb.response.Bid; +import com.iab.openrtb.response.BidResponse; +import com.iab.openrtb.response.SeatBid; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; +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.ExtPrebid; +import org.prebid.server.proto.openrtb.ext.request.smoot.ExtImpSmoot; +import org.prebid.server.proto.openrtb.ext.response.BidType; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.function.UnaryOperator; + +import static java.util.Collections.singletonList; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; +import static org.prebid.server.bidder.model.BidderError.badServerResponse; +import static org.prebid.server.util.HttpUtil.ACCEPT_HEADER; +import static org.prebid.server.util.HttpUtil.APPLICATION_JSON_CONTENT_TYPE; +import static org.prebid.server.util.HttpUtil.CONTENT_TYPE_HEADER; +import static org.springframework.util.MimeTypeUtils.APPLICATION_JSON_VALUE; + +@ExtendWith(MockitoExtension.class) +public class SmootBidderTest extends VertxTest { + + private static final String ENDPOINT_URL = "https://test.endpoint.com"; + + private final SmootBidder target = new SmootBidder(ENDPOINT_URL, jacksonMapper); + + @Test + public void creationShouldFailOnInvalidEndpointUrl() { + assertThatIllegalArgumentException().isThrownBy(() -> new SmootBidder("invalid_url", jacksonMapper)); + } + + @Test + public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() { + // given + final BidRequest bidRequest = givenBidRequest(imp -> imp.ext(mapper.valueToTree( + ExtPrebid.of(null, mapper.createArrayNode())))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).hasSize(1) + .allSatisfy(error -> { + assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input); + assertThat(error.getMessage()).startsWith("Error parsing imp.ext:"); + }); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeHttpRequestsShouldCreateSeparateRequestForEachImp() { + // given + final BidRequest bidRequest = givenBidRequest( + imp -> imp.id("imp1").ext(givenPlacementImpExt("placement")), + imp -> imp.id("imp2").ext(givenEndpointImpExt("endpoint"))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).hasSize(2) + .extracting(HttpRequest::getImpIds) + .containsExactly(Set.of("imp1"), Set.of("imp2")); + } + + @Test + public void makeHttpRequestsShouldSetCorrectUriAndHeaders() { + // given + final BidRequest bidRequest = givenBidRequest(imp -> imp.ext(givenPlacementImpExt("placement"))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).hasSize(1).first() + .extracting(HttpRequest::getHeaders) + .satisfies(headers -> assertThat(headers.get(CONTENT_TYPE_HEADER)) + .isEqualTo(APPLICATION_JSON_CONTENT_TYPE)) + .satisfies(headers -> assertThat(headers.get(ACCEPT_HEADER)) + .isEqualTo(APPLICATION_JSON_VALUE)); + } + + @Test + public void makeHttpRequestsShouldModifyImpExtForPublisherType() { + // given + final BidRequest bidRequest = givenBidRequest(imp -> imp.ext(givenPlacementImpExt("placement"))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + final ObjectNode expectedExtNode = mapper.createObjectNode().set("bidder", mapper.createObjectNode() + .put("type", "publisher") + .put("placementId", "placement")); + + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).hasSize(1) + .extracting(HttpRequest::getPayload) + .flatExtracting(BidRequest::getImp) + .extracting(Imp::getExt) + .containsExactly(expectedExtNode); + } + + @Test + public void makeHttpRequestsShouldModifyImpExtForNetworkType() { + // given + final BidRequest bidRequest = givenBidRequest(imp -> imp.ext(givenEndpointImpExt("endpoint"))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + final ObjectNode expectedExtNode = mapper.createObjectNode().set("bidder", mapper.createObjectNode() + .put("type", "network") + .put("endpointId", "endpoint")); + + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).hasSize(1) + .extracting(HttpRequest::getPayload) + .flatExtracting(BidRequest::getImp) + .extracting(Imp::getExt) + .containsExactly(expectedExtNode); + } + + @Test + public void makeBidsShouldReturnErrorWhenResponseBodyCouldNotBeParsed() { + // given + final BidderCall httpCall = givenHttpCall("invalid_json"); + + // 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 'invalid_json'"); + }); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnEmptyListWhenBidResponseIsNull() throws JsonProcessingException { + // given + final BidderCall noSeatBids = givenHttpCall(mapper.writeValueAsString(null)); + + // when + final Result> result = target.makeBids(noSeatBids, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnBannerBidWhenMtypeIsBanner() throws JsonProcessingException { + // given + final Bid bannerBid = givenBid(1); + final BidderCall httpCall = givenHttpCall(givenBidResponse(bannerBid)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).containsExactly(BidderBid.of(bannerBid, BidType.banner, "USD")); + } + + @Test + public void makeBidsShouldReturnVideoBidWhenMtypeIsVideo() throws JsonProcessingException { + // given + final Bid videoBid = givenBid(2); + final BidderCall httpCall = givenHttpCall(givenBidResponse(videoBid)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).containsExactly(BidderBid.of(videoBid, BidType.video, "USD")); + } + + @Test + public void makeBidsShouldReturnNativeBidWhenMtypeIsNative() throws JsonProcessingException { + // given + final Bid nativeBid = givenBid(4); + final BidderCall httpCall = givenHttpCall(givenBidResponse(nativeBid)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).containsExactly(BidderBid.of(nativeBid, BidType.xNative, "USD")); + } + + @Test + public void makeBidsShouldReturnErrorIfMtypeIsMissing() throws JsonProcessingException { + // given + final BidderCall httpCall = givenHttpCall(givenBidResponse(givenBid(null))); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).hasSize(1) + .containsExactly(badServerResponse("could not define media type for impression: impId")); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnErrorIfMtypeIsUnsupported() throws JsonProcessingException { + // given + final BidderCall httpCall = givenHttpCall(givenBidResponse(givenBid(3))); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).hasSize(1) + .containsExactly(badServerResponse("could not define media type for impression: impId")); + assertThat(result.getValue()).isEmpty(); + } + + private static BidRequest givenBidRequest(UnaryOperator... impCustomizers) { + final List imps = Arrays.stream(impCustomizers) + .map(SmootBidderTest::givenImp) + .toList(); + return BidRequest.builder().imp(imps).build(); + } + + private static Imp givenImp(UnaryOperator impCustomizer) { + return impCustomizer.apply(Imp.builder().id("impId")).build(); + } + + private static ObjectNode givenPlacementImpExt(String placementId) { + return mapper.valueToTree(ExtPrebid.of(null, ExtImpSmoot.of(placementId, null))); + } + + private static ObjectNode givenEndpointImpExt(String endpointId) { + return mapper.valueToTree(ExtPrebid.of(null, ExtImpSmoot.of(null, endpointId))); + } + + private static Bid givenBid(Integer mtype) { + return Bid.builder().id("bidId").impid("impId").price(BigDecimal.ONE).mtype(mtype).build(); + } + + private static String givenBidResponse(Bid bid) throws JsonProcessingException { + return mapper.writeValueAsString(BidResponse.builder() + .cur("USD") + .seatbid(singletonList(SeatBid.builder().bid(singletonList(bid)).build())) + .build()); + } + + private static BidderCall givenHttpCall(String body) { + return BidderCall.succeededHttp( + HttpRequest.builder().build(), + HttpResponse.of(200, null, body), + null); + } +} diff --git a/src/test/java/org/prebid/server/it/SmootTest.java b/src/test/java/org/prebid/server/it/SmootTest.java new file mode 100644 index 00000000000..b6c2545d4a5 --- /dev/null +++ b/src/test/java/org/prebid/server/it/SmootTest.java @@ -0,0 +1,34 @@ +package org.prebid.server.it; + +import io.restassured.response.Response; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.prebid.server.model.Endpoint; + +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; + +public class SmootTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromSmoot() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/smoot-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/smoot/test-smoot-bid-request.json"))) + .willReturn(aResponse().withBody(jsonFrom( + "openrtb2/smoot/test-smoot-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/smoot/test-auction-smoot-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/smoot/test-auction-smoot-response.json", response, + singletonList("smoot")); + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-auction-smoot-request.json b/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-auction-smoot-request.json new file mode 100644 index 00000000000..e614ff78baf --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-auction-smoot-request.json @@ -0,0 +1,23 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "smoot": { + "placementId": "placementId" + } + } + } + ], + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-auction-smoot-response.json b/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-auction-smoot-response.json new file mode 100644 index 00000000000..60df35732e0 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-auction-smoot-response.json @@ -0,0 +1,43 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "exp": 300, + "price": 3.33, + "adm": "adm001", + "adid": "adid", + "cid": "cid", + "crid": "crid", + "mtype": 1, + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner", + "meta": { + "adaptercode": "smoot" + } + }, + "origbidcpm": 3.33 + } + } + ], + "seat": "smoot", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "smoot": "{{ smoot.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 0 + }, + "tmaxrequest": 5000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-smoot-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-smoot-bid-request.json new file mode 100644 index 00000000000..ae0589ead56 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-smoot-bid-request.json @@ -0,0 +1,56 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "secure": 1, + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "bidder": { + "placementId": "placementId", + "type": "publisher" + } + } + } + ], + "source": { + "tid": "${json-unit.any-string}" + }, + "site": { + "domain": "www.example.com", + "page": "http://www.example.com", + "publisher": { + "domain": "example.com" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "userAgent", + "ip": "193.168.244.1" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "server": { + "externalurl": "http://localhost:8080", + "gvlid": 1, + "datacenter": "local", + "endpoint": "/openrtb2/auction" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-smoot-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-smoot-bid-response.json new file mode 100644 index 00000000000..78648154f4e --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/smoot/test-smoot-bid-response.json @@ -0,0 +1,26 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "price": 3.33, + "adid": "adid", + "crid": "crid", + "cid": "cid", + "adm": "adm001", + "mtype": 1, + "h": 250, + "w": 300, + "ext": { + "prebid": { + "type": "banner" + } + } + } + ] + } + ] +} 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 717b0c09445..039842b240e 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -478,6 +478,8 @@ adapters.smartyads.enabled=true adapters.smartyads.endpoint=http://localhost:8090/smartyads-exchange adapters.smilewanted.enabled=true adapters.smilewanted.endpoint=http://localhost:8090/smilewanted-exchange +adapters.smoot.enabled=true +adapters.smoot.endpoint=http://localhost:8090/smoot-exchange adapters.smrtconnect.enabled=true adapters.smrtconnect.endpoint=http://localhost:8090/smrtconnect-exchange?supply_id={{SupplyId}} adapters.sonobi.enabled=true