diff --git a/src/main/java/org/prebid/server/bidder/nobid/NobidBidder.java b/src/main/java/org/prebid/server/bidder/nobid/NobidBidder.java new file mode 100644 index 00000000000..e373d77c5e1 --- /dev/null +++ b/src/main/java/org/prebid/server/bidder/nobid/NobidBidder.java @@ -0,0 +1,106 @@ +package org.prebid.server.bidder.nobid; + +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 io.vertx.core.http.HttpMethod; +import org.apache.commons.collections4.CollectionUtils; +import org.prebid.server.bidder.Bidder; +import org.prebid.server.bidder.model.BidderBid; +import org.prebid.server.bidder.model.BidderError; +import org.prebid.server.bidder.model.HttpCall; +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.response.BidType; +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; +import java.util.stream.Collectors; + +/** + * Nobid {@link Bidder} implementation. + */ +public class NobidBidder implements Bidder { + + private final String endpointUrl; + private final JacksonMapper mapper; + + public NobidBidder(String endpointUrl, JacksonMapper mapper) { + this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl)); + this.mapper = Objects.requireNonNull(mapper); + } + + @Override + public Result>> makeHttpRequests(BidRequest request) { + + return Result.of(Collections.singletonList( + HttpRequest.builder() + .method(HttpMethod.POST) + .uri(endpointUrl) + .headers(HttpUtil.headers()) + .payload(request) + .body(mapper.encode(request)) + .build()), + Collections.emptyList()); + } + + @Override + public final Result> makeBids(HttpCall httpCall, BidRequest bidRequest) { + final List errors = new ArrayList<>(); + try { + final BidResponse bidResponse = mapper.decodeValue(httpCall.getResponse().getBody(), BidResponse.class); + return Result.of(extractBids(httpCall.getRequest().getPayload(), bidResponse, errors), errors); + } catch (DecodeException | PreBidException e) { + return Result.withError(BidderError.badServerResponse(e.getMessage())); + } + } + + private List extractBids(BidRequest bidRequest, BidResponse bidResponse, List errors) { + if (bidResponse == null || CollectionUtils.isEmpty(bidResponse.getSeatbid())) { + return Collections.emptyList(); + } + return bidsFromResponse(bidRequest, bidResponse, errors); + } + + private List bidsFromResponse(BidRequest bidRequest, BidResponse bidResponse, List errors) { + + return bidResponse.getSeatbid().stream() + .map(SeatBid::getBid) + .flatMap(Collection::stream) + .map(bid -> mapToBidderBid(bid, bidRequest.getImp(), bidResponse.getCur(), errors)) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + } + + private static BidderBid mapToBidderBid(Bid bid, List imps, String currency, List errors) { + final BidType bidType; + try { + bidType = getBidType(bid.getImpid(), imps); + } catch (PreBidException e) { + errors.add(BidderError.badInput(e.getMessage())); + return null; + } + return BidderBid.of(bid, bidType, currency); + } + + private static BidType getBidType(String impId, List imps) { + for (Imp imp : imps) { + if (imp.getId().equals(impId)) { + if (imp.getBanner() == null && imp.getVideo() != null) { + return BidType.video; + } + return BidType.banner; + } + } + throw new PreBidException(String.format("Failed to find impression %s", impId)); + } +} diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/nobid/ExtImpNobid.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/nobid/ExtImpNobid.java new file mode 100644 index 00000000000..e2a25fc93b3 --- /dev/null +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/nobid/ExtImpNobid.java @@ -0,0 +1,16 @@ +package org.prebid.server.proto.openrtb.ext.request.nobid; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Value; + +@AllArgsConstructor(staticName = "of") +@Value +public class ExtImpNobid { + + @JsonProperty("siteId") + Integer siteId; + + @JsonProperty("placementId") + Integer placementId; +} diff --git a/src/main/java/org/prebid/server/spring/config/bidder/NobidConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/NobidConfiguration.java new file mode 100644 index 00000000000..8f5b0067458 --- /dev/null +++ b/src/main/java/org/prebid/server/spring/config/bidder/NobidConfiguration.java @@ -0,0 +1,56 @@ +package org.prebid.server.spring.config.bidder; + +import org.prebid.server.bidder.BidderDeps; +import org.prebid.server.bidder.nobid.NobidBidder; +import org.prebid.server.json.JacksonMapper; +import org.prebid.server.spring.config.bidder.model.BidderConfigurationProperties; +import org.prebid.server.spring.config.bidder.model.UsersyncConfigurationProperties; +import org.prebid.server.spring.config.bidder.util.BidderDepsAssembler; +import org.prebid.server.spring.config.bidder.util.BidderInfoCreator; +import org.prebid.server.spring.config.bidder.util.UsersyncerCreator; +import org.prebid.server.spring.env.YamlPropertySourceFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +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/nobid.yaml", factory = YamlPropertySourceFactory.class) +public class NobidConfiguration { + + private static final String BIDDER_NAME = "nobid"; + + @Value("${external-url}") + @NotBlank + private String externalUrl; + + @Autowired + private JacksonMapper mapper; + + @Autowired + @Qualifier("nobidConfigurationProperties") + private BidderConfigurationProperties configProperties; + + @Bean("nobidConfigurationProperties") + @ConfigurationProperties("adapters.nobid") + BidderConfigurationProperties configurationProperties() { + return new BidderConfigurationProperties(); + } + + @Bean + BidderDeps nobidBidderDeps() { + final UsersyncConfigurationProperties usersync = configProperties.getUsersync(); + + return BidderDepsAssembler.forBidder(BIDDER_NAME) + .withConfig(configProperties) + .bidderInfo(BidderInfoCreator.create(configProperties)) + .usersyncerCreator(UsersyncerCreator.create(usersync, externalUrl)) + .bidderCreator(() -> new NobidBidder(configProperties.getEndpoint(), mapper)) + .assemble(); + } +} diff --git a/src/main/resources/bidder-config/nobid.yaml b/src/main/resources/bidder-config/nobid.yaml new file mode 100644 index 00000000000..2312d7f3469 --- /dev/null +++ b/src/main/resources/bidder-config/nobid.yaml @@ -0,0 +1,25 @@ +adapters: + nobid: + enabled: false + endpoint: https://ads.servenobid.com/ortb_adreq?tek=pbs&ver=1 + pbs-enforces-gdpr: true + pbs-enforces-ccpa: true + modifying-vast-xml-allowed: true + deprecated-names: + aliases: + meta-info: + maintainer-email: developers@nobid.io + app-media-types: + - banner + - video + site-media-types: + - banner + - video + supported-vendors: + vendor-id: 816 + usersync: + url: https://ads.servenobid.com/getsync?tek=pbs&ver=1&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect= + redirect-url: /setuid?bidder=nobid&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&uid=$UID + cookie-family-name: nobid + type: redirect + support-cors: false diff --git a/src/main/resources/static/bidder-params/nobid.json b/src/main/resources/static/bidder-params/nobid.json new file mode 100644 index 00000000000..10c2f248d38 --- /dev/null +++ b/src/main/resources/static/bidder-params/nobid.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "NoBid Adapter Params", + "description": "A schema which validates params accepted by the NoBid adapter", + + "type": "object", + "properties": { + "siteId": { + "type": "integer", + "description": "A Required ID which identifies the NoBid site. The siteId paramerter is provided by your NoBid account manager." + }, "placementId": { + "type": "integer", + "description": "An oprional ID which identifies an adunit in a site. The placementId paramerter is provided by your NoBid account manager." + } + }, + "required": ["siteId"] +} diff --git a/src/test/java/org/prebid/server/bidder/nobid/NobidBidderTest.java b/src/test/java/org/prebid/server/bidder/nobid/NobidBidderTest.java new file mode 100644 index 00000000000..f24d9357f7d --- /dev/null +++ b/src/test/java/org/prebid/server/bidder/nobid/NobidBidderTest.java @@ -0,0 +1,196 @@ +package org.prebid.server.bidder.nobid; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.iab.openrtb.request.Banner; +import com.iab.openrtb.request.BidRequest; +import com.iab.openrtb.request.Imp; +import com.iab.openrtb.request.Native; +import com.iab.openrtb.request.Video; +import com.iab.openrtb.response.Bid; +import com.iab.openrtb.response.BidResponse; +import com.iab.openrtb.response.SeatBid; +import org.junit.Before; +import org.junit.Test; +import org.prebid.server.VertxTest; +import org.prebid.server.bidder.model.BidderBid; +import org.prebid.server.bidder.model.BidderError; +import org.prebid.server.bidder.model.HttpCall; +import org.prebid.server.bidder.model.HttpRequest; +import org.prebid.server.bidder.model.HttpResponse; +import org.prebid.server.bidder.model.Result; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; + +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.proto.openrtb.ext.response.BidType.banner; +import static org.prebid.server.proto.openrtb.ext.response.BidType.video; + +public class NobidBidderTest extends VertxTest { + + private static final String ENDPOINT_URL = "https://test.com/prebid/bid&key={{AccountID}}"; + + private NobidBidder nobidBidder; + + @Before + public void setUp() { + nobidBidder = new NobidBidder(ENDPOINT_URL, jacksonMapper); + } + + @Test + public void creationShouldFailOnInvalidEndpointUrl() { + assertThatIllegalArgumentException().isThrownBy(() -> new NobidBidder("invalid_url", jacksonMapper)); + } + + @Test + public void makeBidsShouldReturnErrorIfResponseBodyCouldNotBeParsed() { + // given + final HttpCall httpCall = givenHttpCall(null, "invalid"); + + // when + final Result> result = nobidBidder.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).hasSize(1); + assertThat(result.getErrors()) + .allMatch(error -> error.getType() == BidderError.Type.bad_server_response + && error.getMessage().startsWith("Failed to decode: Unrecognized token")); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnEmptyListIfBidResponseIsNull() throws JsonProcessingException { + // given + final HttpCall httpCall = givenHttpCall(null, + mapper.writeValueAsString(null)); + + // when + final Result> result = nobidBidder.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnEmptyListIfBidResponseSeatBidIsNull() throws JsonProcessingException { + // given + final HttpCall httpCall = givenHttpCall(null, + mapper.writeValueAsString(BidResponse.builder().build())); + + // when + final Result> result = nobidBidder.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()).isEmpty(); + } + + @Test + public void makeBidsShouldReturnBannerBidIfBannerIsPresentInRequestImp() throws JsonProcessingException { + // given + final HttpCall httpCall = givenHttpCall( + BidRequest.builder() + .imp(singletonList(Imp.builder().id("123").banner(Banner.builder().build()).build())) + .build(), + mapper.writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("123")))); + + // when + final Result> result = nobidBidder.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()) + .containsOnly(BidderBid.of(Bid.builder().impid("123").build(), banner, "USD")); + } + + @Test + public void makeBidsShouldReturnBidFromEverySeatBid() throws JsonProcessingException { + // given + final SeatBid firstSeatBId = SeatBid.builder() + .bid(singletonList(Bid.builder() + .impid("123") + .build())) + .build(); + + final SeatBid secondSeatBid = SeatBid.builder() + .bid(singletonList(Bid.builder() + .impid("456") + .build())) + .build(); + + final HttpCall httpCall = givenHttpCall( + BidRequest.builder() + .imp(Arrays.asList(Imp.builder().id("123").banner(Banner.builder().build()).build(), + Imp.builder().id("456").video(Video.builder().build()).build())) + .build(), + mapper.writeValueAsString(BidResponse.builder() + .cur("USD") + .seatbid(Arrays.asList(firstSeatBId, secondSeatBid)) + .build())); + + // when + final Result> result = nobidBidder.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()) + .containsOnly(BidderBid.of(Bid.builder().impid("123").build(), banner, "USD"), + BidderBid.of(Bid.builder().impid("456").build(), video, "USD")); + } + + @Test + public void makeBidsShouldReturnVideoBidIfVideoIsPresentInRequestImp() throws JsonProcessingException { + // given + final HttpCall httpCall = givenHttpCall(BidRequest.builder() + .imp(singletonList(Imp.builder().id("123").video(Video.builder().build()).build())) + .build(), + mapper.writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("123")))); + + // when + final Result> result = nobidBidder.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()) + .containsOnly(BidderBid.of(Bid.builder().impid("123").build(), video, "USD")); + } + + @Test + public void makeBidsShouldReturnErrorIfImpWasNotFound() throws JsonProcessingException { + // given + final HttpCall httpCall = givenHttpCall( + BidRequest.builder() + .imp(singletonList(Imp.builder().id("123").xNative(Native.builder().build()).build())) + .build(), + mapper.writeValueAsString( + givenBidResponse(bidBuilder -> bidBuilder.impid("125")))); + + // when + final Result> result = nobidBidder.makeBids(httpCall, null); + + // then + assertThat(result.getErrors()) + .containsExactly(BidderError.badInput("Failed to find impression 125")); + } + + private static BidResponse givenBidResponse(Function bidCustomizer) { + return BidResponse.builder() + .cur("USD") + .seatbid(singletonList(SeatBid.builder().bid(singletonList(bidCustomizer.apply(Bid.builder()).build())) + .build())) + .build(); + } + + private static HttpCall givenHttpCall(BidRequest bidRequest, String body) { + return HttpCall.success( + HttpRequest.builder().payload(bidRequest).build(), + HttpResponse.of(200, null, body), + null); + } +} diff --git a/src/test/java/org/prebid/server/it/NobidTest.java b/src/test/java/org/prebid/server/it/NobidTest.java new file mode 100644 index 00000000000..a9b31f52623 --- /dev/null +++ b/src/test/java/org/prebid/server/it/NobidTest.java @@ -0,0 +1,60 @@ +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.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; +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.equalTo; +import static com.github.tomakehurst.wiremock.client.WireMock.equalToIgnoreCase; +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 io.restassured.RestAssured.given; +import static java.util.Collections.singletonList; + +@RunWith(SpringRunner.class) +public class NobidTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromNobid() throws IOException, JSONException { + // given + // Nobid bid response for imp + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/nobid-exchange")) + .withHeader("Accept", equalTo("application/json")) + .withHeader("Content-Type", equalToIgnoreCase("application/json;charset=UTF-8")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/nobid/test-nobid-bid-request.json"))) + .willReturn(aResponse().withBody( + jsonFrom("openrtb2/nobid/test-nobid-bid-response.json")))); + + // pre-bid cache + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/cache")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/nobid/test-cache-nobid-request.json"))) + .willReturn(aResponse().withBody( + jsonFrom("openrtb2/nobid/test-cache-nobid-response.json")))); + + // when + final Response response = given(SPEC) + .header("Referer", "http://www.example.com") + .header("X-Forwarded-For", "193.168.244.1") + .header("User-Agent", "userAgent") + .header("Origin", "http://www.example.com") + // this uids cookie value stands for {"uids":{"nobid":"NB-UID"}} + .cookie("uids", "eyJ1aWRzIjp7Im5vYmlkIjoiTkItVUlEIn19") + .body(jsonFrom("openrtb2/nobid/test-auction-nobid-request.json")) + .post("/openrtb2/auction"); + + // then + final String expectedAuctionResponse = openrtbAuctionResponseFrom( + "openrtb2/nobid/test-auction-nobid-response.json", + response, singletonList("nobid")); + + JSONAssert.assertEquals(expectedAuctionResponse, response.asString(), JSONCompareMode.NON_EXTENSIBLE); + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-request.json new file mode 100644 index 00000000000..69a50977e20 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-request.json @@ -0,0 +1,63 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "ext": { + "nobid": { + "siteId": 23, + "placementId": 25 + } + }, + "tagid": "impId021" + } + ], + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "site": { + "publisher": { + "id": "publisherId" + } + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + } + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000 + } + }, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-response.json new file mode 100644 index 00000000000..4e20fc3207b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-auction-nobid-response.json @@ -0,0 +1,53 @@ +{ + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "testid", + "impid": "testimpid", + "price": 0.01, + "adid": "2068416", + "cid": "8048", + "crid": "24080", + "ext": { + "prebid": { + "type": "banner", + "targeting": { + "hb_pb": "0.00", + "hb_cache_id_nobid": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_bidder_nobid": "nobid", + "hb_bidder": "nobid", + "hb_cache_id": "3c0769d8-0dd9-465c-8bf3-f570605ba698", + "hb_pb_nobid": "0.00", + "hb_cache_host": "{{ cache.host }}", + "hb_cache_host_nobid": "{{ cache.host }}", + "hb_cache_path": "{{ cache.path }}", + "hb_cache_path_nobid": "{{ cache.path }}" + }, + "cache": { + "bids": { + "url": "{{ cache.resource_url }}3c0769d8-0dd9-465c-8bf3-f570605ba698", + "cacheId": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + } + } + } + } + ], + "seat": "nobid", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "nobid": "{{ nobid.response_time_ms }}", + "cache": "{{ cache.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 1000 + }, + "tmaxrequest": 1000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-request.json new file mode 100644 index 00000000000..ca8e3ab2f6a --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-request.json @@ -0,0 +1,15 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-response.json new file mode 100644 index 00000000000..c0100536be1 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-cache-nobid-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "3c0769d8-0dd9-465c-8bf3-f570605ba698" + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-request.json new file mode 100644 index 00000000000..e0868c03cee --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-request.json @@ -0,0 +1,76 @@ +{ + "id": "some-request-id", + "imp": [ + { + "id": "testimpid", + "banner": { + "w": 320, + "h": 250 + }, + "tagid": "impId021", + "ext": { + "bidder": { + "siteId" : 23, + "placementId" : 25 + } + } + } + ], + "site": { + "domain": "example.com", + "page": "http://www.example.com", + "publisher": { + "id": "publisherId" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "user": { + "buyeruid": "NB-UID" + }, + "at": 1, + "tmax": 1000, + "cur": [ + "USD" + ], + "source": { + "fd": 1, + "tid": "tid" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "targeting": { + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.1 + } + ] + }, + "includewinners": true, + "includebidderkeys": true + }, + "cache": { + "bids": {} + }, + "auctiontimestamp": 1000, + "channel": { + "name": "web" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-response.json new file mode 100644 index 00000000000..ca4e6ee1db4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/nobid/test-nobid-bid-response.json @@ -0,0 +1,18 @@ +{ + "id": "tid", + "seatbid": [ + { + "bid": [ + { + "crid": "24080", + "adid": "2068416", + "price": 0.01, + "id": "testid", + "impid": "testimpid", + "cid": "8048" + } + ], + "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 530ba198696..0a2678ffb69 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -202,6 +202,10 @@ adapters.ninthdecimal.enabled=true adapters.ninthdecimal.endpoint=http://localhost:8090/ninthdecimal-exchange?pubid= adapters.ninthdecimal.pbs-enforces-gdpr=true adapters.ninthdecimal.usersync.url=//ninthdecimal-usersync +adapters.nobid.enabled=true +adapters.nobid.endpoint=http://localhost:8090/nobid-exchange?pubid= +adapters.nobid.pbs-enforces-gdpr=true +adapters.nobid.usersync.url=//nobid-usersync adapters.openx.enabled=true adapters.openx.endpoint=http://localhost:8090/openx-exchange adapters.openx.pbs-enforces-gdpr=true