diff --git a/src/main/java/org/prebid/server/bidder/adverxo/AdverxoBidder.java b/src/main/java/org/prebid/server/bidder/adverxo/AdverxoBidder.java new file mode 100644 index 00000000000..1880a2e9ad4 --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/adverxo/AdverxoBidder.java @@ -0,0 +1,183 @@ +package org.prebid.server.bidder.adverxo; + +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.Price; +import org.prebid.server.bidder.model.Result; +import org.prebid.server.currency.CurrencyConversionService; +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.adverxo.ExtImpAdverxo; +import org.prebid.server.proto.openrtb.ext.response.BidType; +import org.prebid.server.util.BidderUtil; +import org.prebid.server.util.HttpUtil; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +public class AdverxoBidder implements Bidder { + + private static final TypeReference> ADVERXO_EXT_TYPE_REFERENCE = + new TypeReference<>() { + }; + private static final String DEFAULT_BID_CURRENCY = "USD"; + private static final String ADUNIT_MACROS_ENDPOINT = "{{adUnitId}}"; + private static final String AUTH_MACROS_ENDPOINT = "{{auth}}"; + private static final String PRICE_MACRO = "${AUCTION_PRICE}"; + + private final String endpointUrl; + private final JacksonMapper mapper; + private final CurrencyConversionService currencyConversionService; + + public AdverxoBidder(String endpointUrl, + JacksonMapper mapper, + CurrencyConversionService currencyConversionService) { + + this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); + this.mapper = mapper; + this.currencyConversionService = currencyConversionService; + } + + @Override + public Result>> makeHttpRequests(BidRequest request) { + final List errors = new ArrayList<>(); + final List> requests = new ArrayList<>(); + + for (Imp imp : request.getImp()) { + try { + final ExtImpAdverxo extImp = parseImpExt(imp); + final String endpoint = resolveEndpoint(extImp); + final Imp modifiedImp = modifyImp(request, imp); + final BidRequest outgoingRequest = createRequest(request, modifiedImp); + + requests.add(BidderUtil.defaultRequest(outgoingRequest, endpoint, mapper)); + } catch (PreBidException e) { + errors.add(BidderError.badInput(e.getMessage())); + } + } + + return Result.of(requests, errors); + } + + private ExtImpAdverxo parseImpExt(Imp imp) { + try { + return mapper.mapper().convertValue(imp.getExt(), ADVERXO_EXT_TYPE_REFERENCE).getBidder(); + } catch (IllegalArgumentException e) { + throw new PreBidException("Error parsing ext.imp.bidder: " + e.getMessage()); + } + } + + private String resolveEndpoint(ExtImpAdverxo extImp) { + return endpointUrl + .replace(ADUNIT_MACROS_ENDPOINT, Objects.toString(extImp.getAdUnitId(), "0")) + .replace(AUTH_MACROS_ENDPOINT, HttpUtil.encodeUrl(StringUtils.defaultString(extImp.getAuth()))); + } + + private Imp modifyImp(BidRequest bidRequest, Imp imp) { + final Price resolvedBidFloor = resolveBidFloor(imp, bidRequest); + + return imp.toBuilder() + .bidfloor(resolvedBidFloor.getValue()) + .bidfloorcur(resolvedBidFloor.getCurrency()) + .build(); + } + + private Price resolveBidFloor(Imp imp, BidRequest bidRequest) { + final Price initialBidFloorPrice = Price.of(imp.getBidfloorcur(), imp.getBidfloor()); + return BidderUtil.shouldConvertBidFloor(initialBidFloorPrice, DEFAULT_BID_CURRENCY) + ? convertBidFloor(initialBidFloorPrice, bidRequest) + : initialBidFloorPrice; + } + + private Price convertBidFloor(Price bidFloorPrice, BidRequest bidRequest) { + final BigDecimal convertedPrice = currencyConversionService.convertCurrency( + bidFloorPrice.getValue(), + bidRequest, + bidFloorPrice.getCurrency(), + DEFAULT_BID_CURRENCY); + + return Price.of(DEFAULT_BID_CURRENCY, convertedPrice); + } + + private static BidRequest createRequest(BidRequest originalRequest, Imp modifiedImp) { + return originalRequest.toBuilder() + .imp(Collections.singletonList(modifiedImp)) + .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 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 -> makeBid(bid, bidResponse.getCur())) + .collect(Collectors.toList()); + } + + private BidderBid makeBid(Bid bid, String currency) { + final BidType bidType = getBidType(bid.getMtype()); + final String resolvedAdm = bidType == BidType.xNative ? resolveAdm(bid.getAdm(), bid.getPrice()) : bid.getAdm(); + final Bid processedBid = processBidMacros(bid, resolvedAdm); + + return BidderBid.of(processedBid, bidType, currency); + } + + private static BidType getBidType(Integer mType) { + return switch (mType) { + case 1 -> BidType.banner; + case 2 -> BidType.video; + case 4 -> BidType.xNative; + case null, default -> throw new PreBidException("Unsupported mType " + mType); + }; + } + + private static Bid processBidMacros(Bid bid, String adm) { + final String price = bid.getPrice() != null ? bid.getPrice().toPlainString() : "0"; + + return bid.toBuilder() + .adm(replaceMacro(adm, price)) + .build(); + } + + private static String replaceMacro(String input, String value) { + return input != null ? input.replace(PRICE_MACRO, value) : null; + } + + private static String resolveAdm(String bidAdm, BigDecimal price) { + return StringUtils.isNotBlank(bidAdm) ? bidAdm.replace("${AUCTION_PRICE}", String.valueOf(price)) : bidAdm; + } +} diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/adverxo/ExtImpAdverxo.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/adverxo/ExtImpAdverxo.java new file mode 100644 index 00000000000..86a90653464 --- /dev/null +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/adverxo/ExtImpAdverxo.java @@ -0,0 +1,13 @@ +package org.prebid.server.proto.openrtb.ext.request.adverxo; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Value; + +@Value(staticConstructor = "of") +public class ExtImpAdverxo { + + @JsonProperty("adUnitId") + Integer adUnitId; + + String auth; +} diff --git a/src/main/java/org/prebid/server/spring/config/bidder/AdverxoBidderConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/AdverxoBidderConfiguration.java new file mode 100644 index 00000000000..ae9224670b7 --- /dev/null +++ b/src/main/java/org/prebid/server/spring/config/bidder/AdverxoBidderConfiguration.java @@ -0,0 +1,43 @@ +package org.prebid.server.spring.config.bidder; + +import org.prebid.server.bidder.BidderDeps; +import org.prebid.server.bidder.adverxo.AdverxoBidder; +import org.prebid.server.currency.CurrencyConversionService; +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/adverxo.yaml", factory = YamlPropertySourceFactory.class) +public class AdverxoBidderConfiguration { + + private static final String BIDDER_NAME = "adverxo"; + + @Bean("adverxoConfigurationProperties") + @ConfigurationProperties("adapters.adverxo") + BidderConfigurationProperties configurationProperties() { + return new BidderConfigurationProperties(); + } + + @Bean + BidderDeps adverxoBidderDeps(BidderConfigurationProperties adverxoConfigurationProperties, + @NotBlank @Value("${external-url}") String externalUrl, + JacksonMapper mapper, + CurrencyConversionService currencyConversionService) { + + return BidderDepsAssembler.forBidder(BIDDER_NAME) + .withConfig(adverxoConfigurationProperties) + .usersyncerCreator(UsersyncerCreator.create(externalUrl)) + .bidderCreator(config -> new AdverxoBidder(config.getEndpoint(), mapper, currencyConversionService)) + .assemble(); + } +} diff --git a/src/main/resources/bidder-config/adverxo.yaml b/src/main/resources/bidder-config/adverxo.yaml new file mode 100644 index 00000000000..8474c269505 --- /dev/null +++ b/src/main/resources/bidder-config/adverxo.yaml @@ -0,0 +1,70 @@ +adapters: + adverxo: + endpoint: https://pbsadverxo.com/auction?adUnitId={{adUnitId}}&auth={{auth}} + endpoint-compression: gzip + aliases: + adport: + enabled: false + endpoint: https://adport.pbsadverxo.com/auction?id={{adUnitId}}&auth={{auth}} + usersync: + enabled: false + cookie-family-name: adport + iframe: + url: https://adport.pbsadverxo.com/usync?type=iframe&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}} + uid-macro: '$UID' + support-cors: false + redirect: + url: https://adport.pbsadverxo.com/usync?type=image&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}} + uid-macro: '$UID' + support-cors: false + bidsmind: + enabled: false + endpoint: https://bidsmind.pbsadverxo.com/auction?id={{adUnitId}}&auth={{auth}} + usersync: + enabled: false + cookie-family-name: bidsmind + iframe: + url: https://bidsmind.pbsadverxo.com/usync?type=iframe&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}} + uid-macro: '$UID' + support-cors: false + redirect: + url: https://bidsmind.pbsadverxo.com/usync?type=image&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}} + uid-macro: '$UID' + support-cors: false + mobupps: + enabled: false + endpoint: https://mobupps.pbsadverxo.com/auction?id={{adUnitId}}&auth={{auth}} + usersync: + enabled: false + cookie-family-name: mobupps + iframe: + url: https://mobupps.pbsadverxo.com/usync?type=iframe&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}} + uid-macro: '$UID' + support-cors: false + redirect: + url: https://mobupps.pbsadverxo.com/usync?type=image&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}} + uid-macro: '$UID' + support-cors: false + meta-info: + maintainer-email: developer@adverxo.com + app-media-types: + - banner + - native + - video + site-media-types: + - banner + - native + - video + supported-vendors: + vendor-id: 0 + usersync: + cookie-family-name: adverxo + iframe: + url: https://pbsadverxo.com/usync?type=iframe&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}} + support-cors: false + uid-macro: '$UID' + redirect: + url: https://pbsadverxo.com/usync?type=image&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}} + support-cors: false + uid-macro: '$UID' + diff --git a/src/main/resources/static/bidder-params/adverxo.json b/src/main/resources/static/bidder-params/adverxo.json new file mode 100644 index 00000000000..072abe4df99 --- /dev/null +++ b/src/main/resources/static/bidder-params/adverxo.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Adverxo Adapter Params", + "description": "A schema which validates params accepted by the Adverxo adapter", + "type": "object", + "properties": { + "adUnitId": { + "type": "integer", + "minimum": 1, + "description": "Unique identifier for the ad unit in Adverxo platform." + }, + "auth": { + "type": "string", + "minLength": 6, + "description": "Authentication token provided by Adverxo platform for the AdUnit." + } + }, + "required": ["adUnitId", "auth"] +} diff --git a/src/test/java/org/prebid/server/bidder/adverxo/AdverxoBidderTest.java b/src/test/java/org/prebid/server/bidder/adverxo/AdverxoBidderTest.java new file mode 100644 index 00000000000..986b8e9134b --- /dev/null +++ b/src/test/java/org/prebid/server/bidder/adverxo/AdverxoBidderTest.java @@ -0,0 +1,333 @@ +package org.prebid.server.bidder.adverxo; + +import com.fasterxml.jackson.core.JsonProcessingException; +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.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +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.HttpRequest; +import org.prebid.server.bidder.model.HttpResponse; +import org.prebid.server.bidder.model.Result; +import org.prebid.server.currency.CurrencyConversionService; +import org.prebid.server.proto.openrtb.ext.ExtPrebid; +import org.prebid.server.proto.openrtb.ext.request.adverxo.ExtImpAdverxo; +import org.prebid.server.proto.openrtb.ext.response.BidType; + +import java.math.BigDecimal; +import java.util.List; +import java.util.function.UnaryOperator; + +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.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +public class AdverxoBidderTest extends VertxTest { + + private static final String ENDPOINT_URL = "https://test.endpoint.com/{{adUnitId}}/{{auth}}"; + private static final String AD_UNIT_ID = "123"; + private static final String AUTH = "testAuth"; + + @Mock + private CurrencyConversionService currencyConversionService; + + private AdverxoBidder target; + + @BeforeEach + public void setUp() { + target = new AdverxoBidder(ENDPOINT_URL, jacksonMapper, currencyConversionService); + } + + @Test + public void creationShouldFailOnInvalidEndpointUrl() { + assertThatIllegalArgumentException().isThrownBy(() -> new AdverxoBidder( + "invalid_url", + jacksonMapper, + currencyConversionService)); + } + + @Test + public void makeHttpRequestsShouldReturnErrorIfImpExtInvalid() { + // given + final BidRequest bidRequest = givenBidRequest(impBuilder -> + impBuilder.ext(mapper.valueToTree(ExtPrebid.of(null, mapper.createArrayNode())))); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).hasSize(1); + assertThat(result.getErrors().get(0).getMessage()).startsWith("Error parsing ext.imp.bidder"); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeHttpRequestsShouldReplaceMacrosInEndpointUrl() { + // given + final BidRequest bidRequest = givenBidRequest(identity()); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).hasSize(1) + .extracting(HttpRequest::getUri) + .containsExactly("https://test.endpoint.com/123/testAuth"); + } + + @Test + public void makeHttpRequestsShouldConvertCurrencyIfNeeded() { + // given + final BigDecimal bidFloor = BigDecimal.ONE; + final String bidFloorCur = "EUR"; + final BigDecimal convertedPrice = BigDecimal.TEN; + + when(currencyConversionService.convertCurrency(any(), any(), any(), any())) + .thenReturn(convertedPrice); + + final BidRequest bidRequest = givenBidRequest(impBuilder -> + impBuilder + .bidfloor(bidFloor) + .bidfloorcur(bidFloorCur)); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + verify(currencyConversionService).convertCurrency( + eq(bidFloor), + any(), + eq(bidFloorCur), + eq("USD") + ); + + final BidRequest outgoingRequest = result.getValue().get(0).getPayload(); + final Imp modifiedImp = outgoingRequest.getImp().get(0); + assertThat(modifiedImp.getBidfloor()).isEqualTo(convertedPrice); + assertThat(modifiedImp.getBidfloorcur()).isEqualTo("USD"); + } + + @Test + public void makeHttpRequestsShouldCreateMultipleRequestsForMultipleImps() { + // given + final BidRequest bidRequest = BidRequest.builder() + .imp(List.of( + givenImp("imp1"), + givenImp("imp2"), + givenImp("imp3") + )) + .build(); + + // when + final Result>> result = target.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).hasSize(3); + } + + @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); + assertThat(result.getErrors().get(0).getMessage()).startsWith("Failed to decode"); + } + + @Test + public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProcessingException { + // given + final BidderCall httpCall = givenHttpCall(null, + mapper.writeValueAsString(null)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldResolveBannerBidType() throws JsonProcessingException { + // given + final BidResponse bidResponse = givenBidResponse( + Bid.builder().impid("123").mtype(1).adm("bannerAdm").build()); + final BidderCall httpCall = givenHttpCall( + BidRequest.builder().build(), mapper.writeValueAsString(bidResponse)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).extracting(BidderBid::getType).containsExactly(BidType.banner); + } + + @Test + public void makeBidsShouldResolveVideoBidType() throws JsonProcessingException { + // given + final BidResponse bidResponse = givenBidResponse( + Bid.builder().impid("456").mtype(2).adm("videoAdm").build()); + final BidderCall httpCall = givenHttpCall( + BidRequest.builder().build(), mapper.writeValueAsString(bidResponse)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).extracting(BidderBid::getType).containsExactly(BidType.video); + } + + @Test + public void makeBidsShouldResolveNativeBidType() throws JsonProcessingException { + // given + final BidResponse bidResponse = givenBidResponse( + Bid.builder().impid("789").mtype(4).adm("{\"native\":{\"assets\":[]}}").build()); + final BidderCall httpCall = givenHttpCall( + BidRequest.builder().build(), mapper.writeValueAsString(bidResponse)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).extracting(BidderBid::getType).containsExactly(BidType.xNative); + } + + @Test + public void makeBidsShouldReturnErrorWhenMTypeIsUnsupported() throws JsonProcessingException { + // given + final Bid bid = Bid.builder() + .impid("999") + .mtype(99) + .adm("unsupportedAdm") + .build(); + + final BidResponse bidResponse = BidResponse.builder() + .seatbid(List.of(SeatBid.builder().bid(List.of(bid)).build())) + .build(); + + final BidderCall httpCall = givenHttpCall( + BidRequest.builder().build(), + mapper.writeValueAsString(bidResponse)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).hasSize(1); + assertThat(result.getErrors().get(0).getMessage()).contains("Unsupported mType 99"); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReplacePriceMacroInAdmAndNurl() throws JsonProcessingException { + // given + final Bid bid = Bid.builder() + .impid("123") + .mtype(1) + .adm("Price is ${AUCTION_PRICE}") + .price(BigDecimal.valueOf(5.55)) + .build(); + + final BidResponse bidResponse = BidResponse.builder() + .seatbid(List.of(SeatBid.builder().bid(List.of(bid)).build())) + .build(); + + final BidderCall httpCall = givenHttpCall( + BidRequest.builder().build(), + mapper.writeValueAsString(bidResponse)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + final BidderBid bidderBid = result.getValue().get(0); + assertThat(bidderBid.getBid().getAdm()).isEqualTo("Price is 5.55"); + } + + @Test + public void makeBidsShouldHandleNativeAdmParsing() throws JsonProcessingException { + // given + final String adm = "{\"native\": {\"key\": \"value\"}}"; + final Bid bid = Bid.builder() + .impid("123") + .mtype(4) + .adm(adm) + .build(); + + final BidResponse bidResponse = BidResponse.builder() + .seatbid(List.of(SeatBid.builder().bid(List.of(bid)).build())) + .build(); + + final BidderCall httpCall = givenHttpCall( + BidRequest.builder().build(), + mapper.writeValueAsString(bidResponse)); + + // when + final Result> result = target.makeBids(httpCall, null); + + // then + assertThat(result.getValue().get(0).getBid().getAdm()).isEqualTo(adm); + } + + private static BidRequest givenBidRequest(UnaryOperator impCustomizer) { + return givenBidRequest(identity(), impCustomizer); + } + + private static BidRequest givenBidRequest( + UnaryOperator bidRequestCustomizer, + UnaryOperator impCustomizer) { + + return bidRequestCustomizer.apply(BidRequest.builder() + .imp(List.of(impCustomizer.apply(Imp.builder() + .id("123") + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpAdverxo.of( + Integer.parseInt(AD_UNIT_ID), AUTH))))) + .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 static Imp givenImp(String impId) { + return Imp.builder() + .id(impId) + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpAdverxo.of(123, "testAuth")))) + .build(); + } + + private static BidResponse givenBidResponse(Bid bid) { + return BidResponse.builder() + .cur("USD") + .seatbid(List.of(SeatBid.builder().bid(List.of(bid)).build())) + .build(); + } + +} diff --git a/src/test/java/org/prebid/server/it/AdportTest.java b/src/test/java/org/prebid/server/it/AdportTest.java new file mode 100644 index 00000000000..c78e1309fbb --- /dev/null +++ b/src/test/java/org/prebid/server/it/AdportTest.java @@ -0,0 +1,33 @@ +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 AdportTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromTheAdport() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adport-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/adport/test-adport-bid-request.json"), true, true)) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/adport/test-adport-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/adport/test-auction-adport-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/adport/test-auction-adport-response.json", response, + singletonList("adport")); + } +} diff --git a/src/test/java/org/prebid/server/it/AdverxoTest.java b/src/test/java/org/prebid/server/it/AdverxoTest.java new file mode 100644 index 00000000000..30b2f3bc049 --- /dev/null +++ b/src/test/java/org/prebid/server/it/AdverxoTest.java @@ -0,0 +1,36 @@ +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.equalTo; +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 AdverxoTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromTheAdverxo() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adverxo-exchange")) + .withQueryParam("adUnitId", equalTo("1")) + .withQueryParam("auth", equalTo("123456")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/adverxo/test-adverxo-bid-request.json"), true, true)) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/adverxo/test-adverxo-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/adverxo/test-auction-adverxo-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/adverxo/test-auction-adverxo-response.json", response, + singletonList("adverxo")); + } +} diff --git a/src/test/java/org/prebid/server/it/BidsmindTest.java b/src/test/java/org/prebid/server/it/BidsmindTest.java new file mode 100644 index 00000000000..e834092d229 --- /dev/null +++ b/src/test/java/org/prebid/server/it/BidsmindTest.java @@ -0,0 +1,33 @@ +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 BidsmindTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromTheBidsmind() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/bidsmind-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/bidsmind/test-bidsmind-bid-request.json"), true, true)) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/bidsmind/test-bidsmind-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/bidsmind/test-auction-bidsmind-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/bidsmind/test-auction-bidsmind-response.json", response, + singletonList("bidsmind")); + } +} diff --git a/src/test/java/org/prebid/server/it/MobuppsTest.java b/src/test/java/org/prebid/server/it/MobuppsTest.java new file mode 100644 index 00000000000..9987de46469 --- /dev/null +++ b/src/test/java/org/prebid/server/it/MobuppsTest.java @@ -0,0 +1,33 @@ +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 MobuppsTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromTheMobupps() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/mobupps-exchange")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/mobupps/test-mobupps-bid-request.json"), true, true)) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/mobupps/test-mobupps-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/mobupps/test-auction-mobupps-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/mobupps/test-auction-mobupps-response.json", response, + singletonList("mobupps")); + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adport/test-adport-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/adport/test-adport-bid-request.json new file mode 100644 index 00000000000..b1a0a5c0c8b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adport/test-adport-bid-request.json @@ -0,0 +1,51 @@ +{ + "id": "test-auction-request", + "imp": [ + { + "id": "imp1", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": { + "adUnitId": 1, + "auth": "123456" + } + } + } + ], + "site": { + "domain": "testpage.com", + "page": "http://testpage.com", + "publisher": { + "domain": "testpage.com" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "Mozilla/5.0", + "ip": "193.168.244.1" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "source": { + "tid": "${json-unit.any-string}" + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adport/test-adport-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/adport/test-adport-bid-response.json new file mode 100644 index 00000000000..f4914655cb9 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adport/test-adport-bid-response.json @@ -0,0 +1,40 @@ +{ + "id": "test-auction-request", + "seatbid": [ + { + "seat": "adport", + "group": 0, + "bid": [ + { + "id": "bid1", + "impid": "imp1", + "price": 1.23, + "adm": "", + "nurl": "https://example.com/win?price=1.23", + "crid": "creative1", + "w": 300, + "h": 250, + "exp": 300, + "mtype": 1, + "ext": { + "origbidcpm": 1.23, + "origbidcur": "USD", + "prebid": { + "type": "banner" + } + } + } + ] + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "adport": 0 + }, + "tmaxrequest": 5000, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adport/test-auction-adport-request.json b/src/test/resources/org/prebid/server/it/openrtb2/adport/test-auction-adport-request.json new file mode 100644 index 00000000000..9839e0dbb16 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adport/test-auction-adport-request.json @@ -0,0 +1,34 @@ +{ + "id": "test-auction-request", + "imp": [ + { + "id": "imp1", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "adport": { + "adUnitId": 1, + "auth": "123456" + } + } + } + ], + "site": { + "page": "http://testpage.com" + }, + "device": { + "ua": "Mozilla/5.0" + }, + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adport/test-auction-adport-response.json b/src/test/resources/org/prebid/server/it/openrtb2/adport/test-auction-adport-response.json new file mode 100644 index 00000000000..f4914655cb9 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adport/test-auction-adport-response.json @@ -0,0 +1,40 @@ +{ + "id": "test-auction-request", + "seatbid": [ + { + "seat": "adport", + "group": 0, + "bid": [ + { + "id": "bid1", + "impid": "imp1", + "price": 1.23, + "adm": "", + "nurl": "https://example.com/win?price=1.23", + "crid": "creative1", + "w": 300, + "h": 250, + "exp": 300, + "mtype": 1, + "ext": { + "origbidcpm": 1.23, + "origbidcur": "USD", + "prebid": { + "type": "banner" + } + } + } + ] + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "adport": 0 + }, + "tmaxrequest": 5000, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-adverxo-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-adverxo-bid-request.json new file mode 100644 index 00000000000..b1a0a5c0c8b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-adverxo-bid-request.json @@ -0,0 +1,51 @@ +{ + "id": "test-auction-request", + "imp": [ + { + "id": "imp1", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": { + "adUnitId": 1, + "auth": "123456" + } + } + } + ], + "site": { + "domain": "testpage.com", + "page": "http://testpage.com", + "publisher": { + "domain": "testpage.com" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "Mozilla/5.0", + "ip": "193.168.244.1" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "source": { + "tid": "${json-unit.any-string}" + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-adverxo-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-adverxo-bid-response.json new file mode 100644 index 00000000000..0d282ff107d --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-adverxo-bid-response.json @@ -0,0 +1,40 @@ +{ + "id": "test-auction-request", + "seatbid": [ + { + "seat": "adverxo", + "group": 0, + "bid": [ + { + "id": "bid1", + "impid": "imp1", + "price": 1.23, + "adm": "", + "nurl": "https://example.com/win?price=1.23", + "crid": "creative1", + "w": 300, + "h": 250, + "exp": 300, + "mtype": 1, + "ext": { + "origbidcpm": 1.23, + "origbidcur": "USD", + "prebid": { + "type": "banner" + } + } + } + ] + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "adverxo": 0 + }, + "tmaxrequest": 5000, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-auction-adverxo-request.json b/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-auction-adverxo-request.json new file mode 100644 index 00000000000..c89d2013fd5 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-auction-adverxo-request.json @@ -0,0 +1,34 @@ +{ + "id": "test-auction-request", + "imp": [ + { + "id": "imp1", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "adverxo": { + "adUnitId": 1, + "auth": "123456" + } + } + } + ], + "site": { + "page": "http://testpage.com" + }, + "device": { + "ua": "Mozilla/5.0" + }, + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-auction-adverxo-response.json b/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-auction-adverxo-response.json new file mode 100644 index 00000000000..0d282ff107d --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adverxo/test-auction-adverxo-response.json @@ -0,0 +1,40 @@ +{ + "id": "test-auction-request", + "seatbid": [ + { + "seat": "adverxo", + "group": 0, + "bid": [ + { + "id": "bid1", + "impid": "imp1", + "price": 1.23, + "adm": "", + "nurl": "https://example.com/win?price=1.23", + "crid": "creative1", + "w": 300, + "h": 250, + "exp": 300, + "mtype": 1, + "ext": { + "origbidcpm": 1.23, + "origbidcur": "USD", + "prebid": { + "type": "banner" + } + } + } + ] + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "adverxo": 0 + }, + "tmaxrequest": 5000, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-auction-bidsmind-request.json b/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-auction-bidsmind-request.json new file mode 100644 index 00000000000..ce24d044803 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-auction-bidsmind-request.json @@ -0,0 +1,34 @@ +{ + "id": "test-auction-request", + "imp": [ + { + "id": "imp1", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "bidsmind": { + "adUnitId": 1, + "auth": "123456" + } + } + } + ], + "site": { + "page": "http://testpage.com" + }, + "device": { + "ua": "Mozilla/5.0" + }, + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-auction-bidsmind-response.json b/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-auction-bidsmind-response.json new file mode 100644 index 00000000000..86ea73d0bba --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-auction-bidsmind-response.json @@ -0,0 +1,40 @@ +{ + "id": "test-auction-request", + "seatbid": [ + { + "seat": "bidsmind", + "group": 0, + "bid": [ + { + "id": "bid1", + "impid": "imp1", + "price": 1.23, + "adm": "", + "nurl": "https://example.com/win?price=1.23", + "crid": "creative1", + "w": 300, + "h": 250, + "exp": 300, + "mtype": 1, + "ext": { + "origbidcpm": 1.23, + "origbidcur": "USD", + "prebid": { + "type": "banner" + } + } + } + ] + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "bidsmind": 0 + }, + "tmaxrequest": 5000, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-bidsmind-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-bidsmind-bid-request.json new file mode 100644 index 00000000000..b1a0a5c0c8b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-bidsmind-bid-request.json @@ -0,0 +1,51 @@ +{ + "id": "test-auction-request", + "imp": [ + { + "id": "imp1", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": { + "adUnitId": 1, + "auth": "123456" + } + } + } + ], + "site": { + "domain": "testpage.com", + "page": "http://testpage.com", + "publisher": { + "domain": "testpage.com" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "Mozilla/5.0", + "ip": "193.168.244.1" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "source": { + "tid": "${json-unit.any-string}" + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-bidsmind-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-bidsmind-bid-response.json new file mode 100644 index 00000000000..86ea73d0bba --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/bidsmind/test-bidsmind-bid-response.json @@ -0,0 +1,40 @@ +{ + "id": "test-auction-request", + "seatbid": [ + { + "seat": "bidsmind", + "group": 0, + "bid": [ + { + "id": "bid1", + "impid": "imp1", + "price": 1.23, + "adm": "", + "nurl": "https://example.com/win?price=1.23", + "crid": "creative1", + "w": 300, + "h": 250, + "exp": 300, + "mtype": 1, + "ext": { + "origbidcpm": 1.23, + "origbidcur": "USD", + "prebid": { + "type": "banner" + } + } + } + ] + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "bidsmind": 0 + }, + "tmaxrequest": 5000, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-auction-mobupps-request.json b/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-auction-mobupps-request.json new file mode 100644 index 00000000000..13f73b2a640 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-auction-mobupps-request.json @@ -0,0 +1,34 @@ +{ + "id": "test-auction-request", + "imp": [ + { + "id": "imp1", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "mobupps": { + "adUnitId": 1, + "auth": "123456" + } + } + } + ], + "site": { + "page": "http://testpage.com" + }, + "device": { + "ua": "Mozilla/5.0" + }, + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-auction-mobupps-response.json b/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-auction-mobupps-response.json new file mode 100644 index 00000000000..735fcd2ee33 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-auction-mobupps-response.json @@ -0,0 +1,40 @@ +{ + "id": "test-auction-request", + "seatbid": [ + { + "seat": "mobupps", + "group": 0, + "bid": [ + { + "id": "bid1", + "impid": "imp1", + "price": 1.23, + "adm": "", + "nurl": "https://example.com/win?price=1.23", + "crid": "creative1", + "w": 300, + "h": 250, + "exp": 300, + "mtype": 1, + "ext": { + "origbidcpm": 1.23, + "origbidcur": "USD", + "prebid": { + "type": "banner" + } + } + } + ] + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "mobupps": 0 + }, + "tmaxrequest": 5000, + "prebid": { + "auctiontimestamp": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-mobupps-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-mobupps-bid-request.json new file mode 100644 index 00000000000..b1a0a5c0c8b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-mobupps-bid-request.json @@ -0,0 +1,51 @@ +{ + "id": "test-auction-request", + "imp": [ + { + "id": "imp1", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "secure": 1, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": { + "adUnitId": 1, + "auth": "123456" + } + } + } + ], + "site": { + "domain": "testpage.com", + "page": "http://testpage.com", + "publisher": { + "domain": "testpage.com" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "Mozilla/5.0", + "ip": "193.168.244.1" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "source": { + "tid": "${json-unit.any-string}" + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-mobupps-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-mobupps-bid-response.json new file mode 100644 index 00000000000..735fcd2ee33 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/mobupps/test-mobupps-bid-response.json @@ -0,0 +1,40 @@ +{ + "id": "test-auction-request", + "seatbid": [ + { + "seat": "mobupps", + "group": 0, + "bid": [ + { + "id": "bid1", + "impid": "imp1", + "price": 1.23, + "adm": "", + "nurl": "https://example.com/win?price=1.23", + "crid": "creative1", + "w": 300, + "h": 250, + "exp": 300, + "mtype": 1, + "ext": { + "origbidcpm": 1.23, + "origbidcur": "USD", + "prebid": { + "type": "banner" + } + } + } + ] + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "mobupps": 0 + }, + "tmaxrequest": 5000, + "prebid": { + "auctiontimestamp": 0 + } + } +} 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 2e115d00348..68e3602a6dc 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -45,6 +45,14 @@ adapters.adpone.enabled=true adapters.adpone.endpoint=http://localhost:8090/adpone-exchange adapters.adot.enabled=true adapters.adot.endpoint=http://localhost:8090/adot-exchange +adapters.adverxo.enabled=true +adapters.adverxo.endpoint=http://localhost:8090/adverxo-exchange?adUnitId={{adUnitId}}&auth={{auth}} +adapters.adverxo.aliases.adport.enabled=true +adapters.adverxo.aliases.adport.endpoint=http://localhost:8090/adport-exchange +adapters.adverxo.aliases.bidsmind.enabled=true +adapters.adverxo.aliases.bidsmind.endpoint=http://localhost:8090/bidsmind-exchange +adapters.adverxo.aliases.mobupps.enabled=true +adapters.adverxo.aliases.mobupps.endpoint=http://localhost:8090/mobupps-exchange adapters.adview.enabled=true adapters.adview.endpoint=http://localhost:8090/adview-exchange?accountId={{AccountId}} adapters.adprime.enabled=true