Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/resources/static/bidder-params/nativo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Nativo Adapter Params",
"description": "A schema which validates params accepted by the Nativo adapter",
"type": "object",
"properties": {
"placementId": {
"type": ["integer", "string"],
"description": "Placement ID"
}
}
}
35 changes: 35 additions & 0 deletions src/test/java/org/prebid/server/it/NativoTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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 NativoTest extends IntegrationTest {

@Test
public void openrtb2AuctionShouldRespondWithBidsFromNativo() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/nativo-exchange"))
.withRequestBody(equalToJson(
jsonFrom("openrtb2/nativo/test-nativo-bid-request.json")))
.willReturn(aResponse().withBody(
jsonFrom("openrtb2/nativo/test-nativo-bid-response.json"))));

// when
final Response response = responseFor("openrtb2/nativo/test-auction-nativo-request.json",
Endpoint.openrtb2_auction);

// then
assertJsonEquals("openrtb2/nativo/test-auction-nativo-response.json", response,
singletonList("nativo"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": "tid",
"imp": [
{
"id": "impId001",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"ext": {
"nativo": {
"placementId": 12345678
}
}
}
],
"device": {
"pxratio": 4.2,
"dnt": 2,
"language": "en",
"ifa": "ifaId"
},
"site": {
"publisher": {
"id": "publisherId"
}
},
"at": 1,
"tmax": 5000,
"cur": [
"USD"
],
"source": {
"fd": 1,
"tid": "tid"
},
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"id": "tid",
"seatbid": [
{
"bid": [
{
"id": "bid001",
"impid": "impId001",
"exp": 300,
"price": 3.33,
"adm": "adm001",
"adid": "adid001",
"cid": "cid001",
"crid": "crid001",
"w": 300,
"h": 250,
"ext": {
"prebid": {
"type": "banner",
"meta": {
"adaptercode": "nativo"
}
},
"origbidcpm": 3.33
}
}
],
"seat": "nativo",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"nativo": "{{ nativo.response_time_ms }}"
},
"prebid": {
"auctiontimestamp": 1000
},
"tmaxrequest": 5000
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"id": "tid",
"imp": [
{
"id": "impId001",
"banner": {
"format": [
{
"w": 300,
"h": 250
}
]
},
"secure": 1,
"ext": {
"tid": "${json-unit.any-string}",
"bidder": {
"placementId": 12345678
}
}
}
],
"site": {
"domain": "www.example.com",
"page": "http://www.example.com",
"publisher": {
"id": "publisherId",
"domain": "example.com"
},
"ext": {
"amp": 0
}
},
"device": {
"dnt": 2,
"ua": "userAgent",
"ip": "193.168.244.1",
"pxratio": 4.2,
"language": "en",
"ifa": "ifaId"
},
"at": 1,
"tmax": "${json-unit.any-number}",
"cur": [
"USD"
],
"source": {
"fd": 1,
"tid": "tid"
},
"regs": {
"ext": {
"gdpr": 0
}
},
"ext": {
"prebid": {
"channel": {
"name": "web"
},
"server": {
"externalurl": "http://localhost:8080",
"gvlid": 1,
"datacenter": "local",
"endpoint": "/openrtb2/auction"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"id": "tid",
"seatbid": [
{
"bid": [
{
"id": "bid001",
"impid": "impId001",
"price": 3.33,
"adid": "adid001",
"crid": "crid001",
"cid": "cid001",
"adm": "adm001",
"h": 250,
"w": 300
}
]
}
]
}