Skip to content

Commit

Permalink
Indicue: Add adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiNahornyi committed Dec 27, 2023
1 parent 6a8129a commit 56a0ae3
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/resources/bidder-config/adtelligent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ adapters:
meta-info:
maintainer-email: info@copper6.com
vendor-id: 0
indicue:
enabled: false
endpoint: http://ghb.console.indicue.com/pbs/ortb
meta-info:
maintainer-email: ops@indicue.com
vendor-id: 0
meta-info:
maintainer-email: hb@adtelligent.com
app-media-types:
Expand Down
37 changes: 37 additions & 0 deletions src/test/java/org/prebid/server/it/IndicueTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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 IndicueTest extends IntegrationTest {

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

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

// then
assertJsonEquals("openrtb2/indicue/test-auction-indicue-response.json", response,
singletonList("indicue"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 300,
"h": 250
},
"ext": {
"indicue": {
"aid": 1000,
"siteId": 1234,
"bidFloor": 20,
"placementId": 10
}
}
}
],
"tmax": 5000,
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"price": 8.43,
"adm": "adm14",
"crid": "crid14",
"w": 300,
"h": 250,
"ext": {
"prebid": {
"type": "banner"
},
"origbidcpm": 8.43
}
}
],
"seat": "indicue",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"indicue": "{{ indicue.response_time_ms }}"
},
"prebid": {
"auctiontimestamp": 0
},
"tmaxrequest": 5000
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"secure": 1,
"banner": {
"w": 300,
"h": 250
},
"bidfloor": 20,
"ext": {
"adtelligent": {
"aid": 1000,
"placementId": 10,
"siteId": 1234,
"bidFloor": 20
}
}
}
],
"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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"price": 8.43,
"adm": "adm14",
"crid": "crid14",
"w": 300,
"h": 250
}
],
"seat": "adtelligent",
"group": 0
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ adapters.adtelligent.aliases.pgam.enabled=true
adapters.adtelligent.aliases.pgam.endpoint=http://localhost:8090/pgam-exchange
adapters.adtelligent.aliases.copper6.enabled=true
adapters.adtelligent.aliases.copper6.endpoint=http://localhost:8090/copper6-exchange
adapters.adtelligent.aliases.indicue.enabled=true
adapters.adtelligent.aliases.indicue.endpoint=http://localhost:8090/indicue-exchange
adapters.adtrgtme.enabled=true
adapters.adtrgtme.endpoint=http://localhost:8090/adtrgtme-exchange
adapters.advangelists.enabled=true
Expand Down

0 comments on commit 56a0ae3

Please sign in to comment.