diff --git a/src/main/java/org/prebid/server/bidder/zmaticoo/ZMaticooBidder.java b/src/main/java/org/prebid/server/bidder/zmaticoo/ZMaticooBidder.java new file mode 100644 index 00000000000..028d3dbc6de --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/zmaticoo/ZMaticooBidder.java @@ -0,0 +1,182 @@ +package org.prebid.server.bidder.zmaticoo; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JsonNode; +import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Imp; +import com.iab.openrtb.request.Native; +import com.iab.openrtb.response.Bid; +import com.iab.openrtb.response.BidResponse; +import com.iab.openrtb.response.SeatBid; +import io.vertx.core.http.HttpMethod; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +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.model.UpdateResult; +import org.prebid.server.proto.openrtb.ext.ExtPrebid; +import org.prebid.server.proto.openrtb.ext.request.zmaticoo.ExtImpZMaticoo; +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 ZMaticooBidder implements Bidder { + + private static final TypeReference> ZMATICOO_EXT_TYPE_REFERENCE = + new TypeReference<>() { + }; + + private final String endpointUrl; + private final JacksonMapper mapper; + + public ZMaticooBidder(String endpointUrl, JacksonMapper mapper) { + this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); + this.mapper = Objects.requireNonNull(mapper); + } + + @Override + public Result>> makeHttpRequests(BidRequest request) { + final List bidderErrors = new ArrayList<>(); + final List modifiedImps = new ArrayList<>(); + + for (Imp imp : request.getImp()) { + try { + validateImpExt(imp); + modifiedImps.add(modifyImp(imp)); + } catch (PreBidException e) { + bidderErrors.add(BidderError.badInput(e.getMessage())); + } + } + + if (CollectionUtils.isNotEmpty(bidderErrors)) { + return Result.withErrors(bidderErrors); + } + + final BidRequest modifiedRequest = request.toBuilder().imp(modifiedImps).build(); + return Result.withValue(makeHttpRequest(modifiedRequest)); + } + + private void validateImpExt(Imp imp) { + final ExtImpZMaticoo extImpZMaticoo; + try { + extImpZMaticoo = mapper.mapper().convertValue(imp.getExt(), ZMATICOO_EXT_TYPE_REFERENCE).getBidder(); + } catch (IllegalArgumentException e) { + throw new PreBidException(e.getMessage()); + } + if (StringUtils.isBlank(extImpZMaticoo.getPubId()) || StringUtils.isBlank(extImpZMaticoo.getZoneId())) { + throw new PreBidException("imp.ext.pubId or imp.ext.zoneId required"); + } + } + + private Imp modifyImp(Imp imp) { + final Native xNative = imp.getXNative(); + if (xNative == null) { + return imp; + } + + final UpdateResult nativeRequest = resolveNativeRequest(xNative.getRequest()); + return nativeRequest.isUpdated() + ? imp.toBuilder() + .xNative(xNative.toBuilder() + .request(nativeRequest.getValue()) + .build()) + .build() + : imp; + } + + private UpdateResult resolveNativeRequest(String nativeRequest) { + final JsonNode nativeRequestNode; + try { + nativeRequestNode = StringUtils.isNotBlank(nativeRequest) + ? mapper.mapper().readTree(nativeRequest) + : mapper.mapper().createObjectNode(); + } catch (JsonProcessingException e) { + throw new PreBidException(e.getMessage()); + } + + if (nativeRequestNode.has("native")) { + return UpdateResult.unaltered(nativeRequest); + } + + final String updatedNativeRequest = mapper.mapper().createObjectNode() + .putPOJO("native", nativeRequestNode) + .toString(); + + return UpdateResult.updated(updatedNativeRequest); + } + + private HttpRequest makeHttpRequest(BidRequest modifiedRequest) { + return HttpRequest.builder() + .method(HttpMethod.POST) + .uri(endpointUrl) + .headers(HttpUtil.headers()) + .impIds(BidderUtil.impIds(modifiedRequest)) + .payload(modifiedRequest) + .body(mapper.encodeToBytes(modifiedRequest)) + .build(); + } + + @Override + public final Result> makeBids(BidderCall httpCall, BidRequest bidRequest) { + try { + final List errors = new ArrayList<>(); + final BidResponse bidResponse = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); + return Result.of(extractBids(bidResponse, errors), errors); + } catch (DecodeException e) { + return Result.withError(BidderError.badServerResponse(e.getMessage())); + } + } + + private static List extractBids(BidResponse bidResponse, List errors) { + 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 -> makeBidderBid(bid, bidResponse.getCur(), errors)) + .filter(Objects::nonNull) + .toList(); + } + + private static BidderBid makeBidderBid(Bid bid, String currency, List errors) { + try { + final BidType bidType = getBidMediaType(bid); + return BidderBid.of(bid, bidType, currency); + } catch (PreBidException e) { + errors.add(BidderError.badServerResponse(e.getMessage())); + return null; + } + } + + private static BidType getBidMediaType(Bid bid) { + final int markupType = ObjectUtils.defaultIfNull(bid.getMtype(), 0); + return switch (markupType) { + case 1 -> BidType.banner; + case 2 -> BidType.video; + case 4 -> BidType.xNative; + default -> throw new PreBidException( + "unrecognized bid type in response from zmaticoo for bid " + bid.getImpid()); + }; + } + +} diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/zmaticoo/ExtImpZMaticoo.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/zmaticoo/ExtImpZMaticoo.java new file mode 100644 index 00000000000..321a136d0ac --- /dev/null +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/zmaticoo/ExtImpZMaticoo.java @@ -0,0 +1,14 @@ +package org.prebid.server.proto.openrtb.ext.request.zmaticoo; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Value; + +@Value(staticConstructor = "of") +public class ExtImpZMaticoo { + + @JsonProperty("pubId") + String pubId; + + @JsonProperty("zoneId") + String zoneId; +} diff --git a/src/main/java/org/prebid/server/spring/config/bidder/ZMaticooBidderConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/ZMaticooBidderConfiguration.java new file mode 100644 index 00000000000..540a58a67ec --- /dev/null +++ b/src/main/java/org/prebid/server/spring/config/bidder/ZMaticooBidderConfiguration.java @@ -0,0 +1,41 @@ +package org.prebid.server.spring.config.bidder; + +import org.prebid.server.bidder.BidderDeps; +import org.prebid.server.bidder.zmaticoo.ZMaticooBidder; +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 javax.validation.constraints.NotBlank; + +@Configuration +@PropertySource(value = "classpath:/bidder-config/zmaticoo.yaml", factory = YamlPropertySourceFactory.class) +public class ZMaticooBidderConfiguration { + + private static final String BIDDER_NAME = "zmaticoo"; + + @Bean("zmaticooConfigurationProperties") + @ConfigurationProperties("adapters.zmaticoo") + BidderConfigurationProperties configurationProperties() { + return new BidderConfigurationProperties(); + } + + @Bean + BidderDeps zmaticooBidderDeps(BidderConfigurationProperties zmaticooConfigurationProperties, + @NotBlank @Value("${external-url}") String externalUrl, + JacksonMapper mapper) { + + return BidderDepsAssembler.forBidder(BIDDER_NAME) + .withConfig(zmaticooConfigurationProperties) + .usersyncerCreator(UsersyncerCreator.create(externalUrl)) + .bidderCreator(config -> new ZMaticooBidder(config.getEndpoint(), mapper)) + .assemble(); + } +} diff --git a/src/main/resources/bidder-config/zmaticoo.yaml b/src/main/resources/bidder-config/zmaticoo.yaml new file mode 100644 index 00000000000..718fff17436 --- /dev/null +++ b/src/main/resources/bidder-config/zmaticoo.yaml @@ -0,0 +1,12 @@ +adapters: + zmaticoo: + endpoint: https://bid.zmaticoo.com/prebid/bid + meta-info: + maintainer-email: adam.li@eclicktech.com.cn + app-media-types: + - banner + - video + - native + site-media-types: + supported-vendors: + vendor-id: 803 diff --git a/src/main/resources/static/bidder-params/zmaticoo.json b/src/main/resources/static/bidder-params/zmaticoo.json new file mode 100644 index 00000000000..8200c94d13c --- /dev/null +++ b/src/main/resources/static/bidder-params/zmaticoo.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "zMaticoo Adapter Params", + "description": "A schema which validates params accepted by the zMaticoo adapter", + "type": "object", + "properties": { + "pubId": { + "type": "string", + "description": "Publisher ID", + "minLength": 1 + }, + "zoneId": { + "type": "string", + "description": "Zone Id", + "minLength": 1 + } + }, + "required": [ + "pubId", + "zoneId" + ] +} diff --git a/src/test/java/org/prebid/server/bidder/zmaticoo/ZMaticooBidderTest.java b/src/test/java/org/prebid/server/bidder/zmaticoo/ZMaticooBidderTest.java new file mode 100644 index 00000000000..182aba5d0a7 --- /dev/null +++ b/src/test/java/org/prebid/server/bidder/zmaticoo/ZMaticooBidderTest.java @@ -0,0 +1,225 @@ +package org.prebid.server.bidder.zmaticoo; + +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.request.Native; +import com.iab.openrtb.response.Bid; +import com.iab.openrtb.response.BidResponse; +import com.iab.openrtb.response.SeatBid; +import org.junit.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.ExtPrebid; +import org.prebid.server.proto.openrtb.ext.request.zmaticoo.ExtImpZMaticoo; + +import java.util.List; +import java.util.function.UnaryOperator; + +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; +import static org.prebid.server.proto.openrtb.ext.response.BidType.banner; +import static org.prebid.server.proto.openrtb.ext.response.BidType.video; +import static org.prebid.server.proto.openrtb.ext.response.BidType.xNative; + +public class ZMaticooBidderTest extends VertxTest { + + private static final String ENDPOINT_URL = "https://test.com/test"; + + private final ZMaticooBidder target = new ZMaticooBidder(ENDPOINT_URL, jacksonMapper); + + @Test + public void creationShouldFailOnInvalidEndpointUrl() { + assertThatIllegalArgumentException() + .isThrownBy(() -> new ZMaticooBidder("invalid_url", jacksonMapper)); + } + + @Test + public void makeHttpRequestsShouldReturnErrorsOnInvalidImps() { + // given + final ObjectNode invalidNode = mapper.createObjectNode(); + invalidNode.putArray("bidder"); + final BidRequest bidRequest = givenBidRequest( + givenImp(imp -> imp.ext(invalidNode)), + givenImp(ExtImpZMaticoo.of("", "")), + givenImp(ExtImpZMaticoo.of("pubId", "")), + givenImp(ExtImpZMaticoo.of("", "zoneId"))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getValue()).isEmpty(); + assertThat(result.getErrors()).satisfies(errors -> { + assertThat(errors.get(0)).satisfies(error -> { + assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input); + assertThat(error.getMessage()).startsWith("Cannot deserialize value of type"); + }); + assertThat(errors.stream().skip(1)) + .map(BidderError::getType, BidderError::getMessage) + .containsOnly(tuple(BidderError.Type.bad_input, "imp.ext.pubId or imp.ext.zoneId required")); + }); + } + + @Test + public void makeHttpRequestsShouldProperlyHandleValidNative() { + // given + final BidRequest bidRequest = givenBidRequest( + givenImp(identity()), + givenImp(imp -> imp.xNative(Native.builder().build())), + givenImp(imp -> imp.xNative(Native.builder() + .request(""" + { + "native": 1 + } + """) + .build())), + givenImp(imp -> imp.xNative(Native.builder() + .request(""" + { + "field": 0 + } + """) + .build()))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getValue()) + .hasSize(1) + .extracting(HttpRequest::getPayload) + .extracting(BidRequest::getImp) + .allSatisfy(imps -> { + assertThat(imps.get(0)).isSameAs(bidRequest.getImp().get(0)); + assertThat(imps.get(1)) + .extracting(Imp::getXNative) + .extracting(Native::getRequest) + .isEqualTo("{\"native\":{}}"); + assertThat(imps.get(2)).isSameAs(bidRequest.getImp().get(2)); + assertThat(imps.get(3)) + .extracting(Imp::getXNative) + .extracting(Native::getRequest) + .isEqualTo("{\"native\":{\"field\":0}}"); + }); + assertThat(result.getErrors()).isEmpty(); + } + + @Test + public void makeHttpRequestsShouldReturnErrorOnInvalidNativeRequest() { + // given + final BidRequest bidRequest = givenBidRequest( + givenImp(imp -> imp.xNative(Native.builder().request("invalid").build()))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getValue()).isEmpty(); + assertThat(result.getErrors()).hasSize(1).allSatisfy(error -> { + assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input); + assertThat(error.getMessage()).startsWith("Unrecognized token 'invalid': was"); + }); + } + + @Test + public void makeBidsShouldReturnErrorIfResponseBodyCouldNotBeParsed() { + // given + final BidderCall httpCall = givenHttpCall("invalid"); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getValue()).isEmpty(); + 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"); + }); + } + + @Test + public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProcessingException { + // given + final BidderCall httpCall = givenHttpCall(mapper.writeValueAsString(null)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getValue()).isEmpty(); + assertThat(result.getErrors()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnEmptyListIfBidResponseSeatBidIsEmpty() throws JsonProcessingException { + // given + final BidderCall httpCall = givenHttpCall(givenBidResponse()); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnValidBids() throws JsonProcessingException { + // given + final BidderCall httpCall = givenHttpCall( + givenBidResponse( + Bid.builder().id("1").mtype(1).build(), + Bid.builder().id("2").mtype(2).build(), + Bid.builder().id("3").impid("impId3").mtype(null).build(), + Bid.builder().id("4").mtype(4).build(), + Bid.builder().id("5").impid("impId5").mtype(0).build())); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getValue()) + .extracting(bidderBid -> bidderBid.getBid().getId(), BidderBid::getType) + .containsExactly(tuple("1", banner), tuple("2", video), tuple("4", xNative)); + assertThat(result.getErrors()).containsExactly( + BidderError.badServerResponse("unrecognized bid type in response from zmaticoo for bid impId3"), + BidderError.badServerResponse("unrecognized bid type in response from zmaticoo for bid impId5")); + } + + private static BidRequest givenBidRequest(Imp... imp) { + return BidRequest.builder().imp(List.of(imp)).build(); + } + + private static Imp givenImp(ExtImpZMaticoo extImpZMaticoo) { + return Imp.builder() + .ext(mapper.valueToTree(ExtPrebid.of(null, extImpZMaticoo))) + .build(); + } + + private static Imp givenImp(UnaryOperator impCustomizer) { + return impCustomizer + .apply(Imp.builder().ext(mapper.valueToTree( + ExtPrebid.of(null, ExtImpZMaticoo.of("pubId", "pubId"))))) + .build(); + } + + private static String givenBidResponse(Bid... bids) throws JsonProcessingException { + return mapper.writeValueAsString(BidResponse.builder() + .seatbid(singletonList(SeatBid.builder().bid(List.of(bids)).build())) + .build()); + } + + private static BidderCall givenHttpCall(String body) { + return BidderCall.succeededHttp(null, HttpResponse.of(200, null, body), null); + } +} diff --git a/src/test/java/org/prebid/server/it/ZMaticooTest.java b/src/test/java/org/prebid/server/it/ZMaticooTest.java new file mode 100644 index 00000000000..ce76ff0b91b --- /dev/null +++ b/src/test/java/org/prebid/server/it/ZMaticooTest.java @@ -0,0 +1,35 @@ +package org.prebid.server.it; + +import io.restassured.response.Response; +import org.json.JSONException; +import org.junit.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 ZMaticooTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromZMaticoo() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/zmaticoo-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/zmaticoo/test-zmaticoo-bid-request.json"))) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/zmaticoo/test-zmaticoo-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/zmaticoo/test-auction-zmaticoo-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/zmaticoo/test-auction-zmaticoo-response.json", response, singletonList("zmaticoo")); + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-auction-zmaticoo-request.json b/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-auction-zmaticoo-request.json new file mode 100644 index 00000000000..afa10f0938d --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-auction-zmaticoo-request.json @@ -0,0 +1,24 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "zmaticoo": { + "pubId": "pubTestID", + "zoneId": "zoneTestID" + } + } + } + ], + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-auction-zmaticoo-response.json b/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-auction-zmaticoo-response.json new file mode 100644 index 00000000000..f2bb11ef448 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-auction-zmaticoo-response.json @@ -0,0 +1,39 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "price": 3.33, + "mtype": 1, + "adm": "adm001", + "adid": "adid001", + "cid": "cid001", + "crid": "crid001", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + }, + "origbidcpm": 3.33 + } + } + ], + "seat": "zmaticoo", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "zmaticoo": "{{ zmaticoo.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 0 + }, + "tmaxrequest": 5000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-zmaticoo-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-zmaticoo-bid-request.json new file mode 100644 index 00000000000..46e80d08b96 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-zmaticoo-bid-request.json @@ -0,0 +1,57 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "banner": { + "w": 300, + "h": 250 + }, + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": { + "pubId": "pubTestID", + "zoneId": "zoneTestID" + } + } + } + ], + "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/zmaticoo/test-zmaticoo-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-zmaticoo-bid-response.json new file mode 100644 index 00000000000..891438f2401 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/zmaticoo/test-zmaticoo-bid-response.json @@ -0,0 +1,21 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "price": 3.33, + "mtype": 1, + "adid": "adid001", + "crid": "crid001", + "cid": "cid001", + "adm": "adm001", + "h": 250, + "w": 300 + } + ] + } + ] +} 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 1f0a9689ece..ccc7611ae9b 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -445,6 +445,8 @@ adapters.aax.enabled=true adapters.aax.endpoint=http://localhost:8090/aax-exchange adapters.zeta_global_ssp.enabled=true adapters.zeta_global_ssp.endpoint=http://localhost:8090/zeta_global_ssp-exchange +adapters.zmaticoo.enabled=true +adapters.zmaticoo.endpoint=http://localhost:8090/zmaticoo-exchange adapters.yearxero.enabled=true adapters.yearxero.endpoint=http://localhost:8090/yearxero-exchange adapters.minutemedia.enabled=true