Skip to content

Commit

Permalink
Smarthub: New aliasses (VimayX, FelixAds) (#3403)
Browse files Browse the repository at this point in the history
  • Loading branch information
Compile-Ninja authored Aug 23, 2024
1 parent 39e1cbf commit 4deacab
Show file tree
Hide file tree
Showing 12 changed files with 373 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/resources/bidder-config/smarthub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ adapters:
tredio:
enabled: false
endpoint: http://tredio-prebid.smart-hub.io/pbserver/?seat={{AccountID}}&token={{SourceId}}
vimayx:
enabled: false
endpoint: http://vimayx-prebid.smart-hub.io/pbserver/?seat={{AccountID}}&token={{SourceId}}
felixads:
enabled: false
endpoint: http://felixads-prebid.smart-hub.io/pbserver/?seat={{AccountID}}&token={{SourceId}}
meta-info:
maintainer-email: support@smart-hub.io
app-media-types:
Expand Down
36 changes: 36 additions & 0 deletions src/test/java/org/prebid/server/it/FelixadsTest.java
Original file line number Diff line number Diff line change
@@ -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 FelixadsTest extends IntegrationTest {

@Test
public void openrtb2AuctionShouldRespondWithBidsFromFelixads() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/felixads-exchange"))
.withQueryParam("host", equalTo("someUniquePartnerName"))
.withQueryParam("accountId", equalTo("someSeat"))
.withQueryParam("sourceId", equalTo("someToken"))
.withRequestBody(equalToJson(jsonFrom("openrtb2/felixads/test-felixads-bid-request.json")))
.willReturn(aResponse().withBody(jsonFrom("openrtb2/felixads/test-felixads-bid-response.json"))));

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

// then
assertJsonEquals("openrtb2/felixads/test-auction-felixads-response.json", response, singletonList("felixads"));
}
}
37 changes: 37 additions & 0 deletions src/test/java/org/prebid/server/it/VimayxTest.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.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 VimayxTest extends IntegrationTest {

@Test
public void openrtb2AuctionShouldRespondWithBidsFromVimayx() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/vimayx-exchange"))
.withQueryParam("host", equalTo("someUniquePartnerName"))
.withQueryParam("accountId", equalTo("someSeat"))
.withQueryParam("sourceId", equalTo("someToken"))
.withRequestBody(equalToJson(jsonFrom("openrtb2/vimayx/test-vimayx-bid-request.json")))
.willReturn(aResponse().withBody(jsonFrom("openrtb2/vimayx/test-vimayx-bid-response.json"))));

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

// then
assertJsonEquals("openrtb2/vimayx/test-auction-vimayx-response.json", response, singletonList("vimayx"));
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 300,
"h": 250
},
"ext": {
"felixads": {
"partnerName": "someUniquePartnerName",
"seat": "someSeat",
"token": "someToken"
}
}
}
],
"tmax": 5000,
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"price": 3.33,
"adm": "adm001",
"adid": "adid001",
"cid": "cid001",
"crid": "crid001",
"w": 300,
"h": 250,
"ext": {
"mediaType": "video",
"origbidcpm": 3.33,
"prebid": {
"type": "video"
}
}
}
],
"seat": "felixads",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"felixads": "{{ felixads.response_time_ms }}"
},
"prebid": {
"auctiontimestamp": 0
},
"tmaxrequest": 5000
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"secure": 1,
"banner": {
"w": 300,
"h": 250
},
"ext": {
"tid": "${json-unit.any-string}",
"bidder": {
"partnerName": "someUniquePartnerName",
"seat": "someSeat",
"token": "someToken"
}
}
}
],
"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,23 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"price": 3.33,
"adid": "adid001",
"crid": "crid001",
"cid": "cid001",
"adm": "adm001",
"h": 250,
"w": 300,
"ext": {
"mediaType": "video"
}
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 300,
"h": 250
},
"ext": {
"vimayx": {
"partnerName": "someUniquePartnerName",
"seat": "someSeat",
"token": "someToken"
}
}
}
],
"tmax": 5000,
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"price": 3.33,
"adm": "adm001",
"adid": "adid001",
"cid": "cid001",
"crid": "crid001",
"w": 300,
"h": 250,
"ext": {
"mediaType": "video",
"origbidcpm": 3.33,
"prebid": {
"type": "video"
}
}
}
],
"seat": "vimayx",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"vimayx": "{{ vimayx.response_time_ms }}"
},
"prebid": {
"auctiontimestamp": 0
},
"tmaxrequest": 5000
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"secure": 1,
"banner": {
"w": 300,
"h": 250
},
"ext": {
"tid": "${json-unit.any-string}",
"bidder": {
"partnerName": "someUniquePartnerName",
"seat": "someSeat",
"token": "someToken"
}
}
}
],
"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,23 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"price": 3.33,
"adid": "adid001",
"crid": "crid001",
"cid": "cid001",
"adm": "adm001",
"h": 250,
"w": 300,
"ext": {
"mediaType": "video"
}
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ adapters.smarthub.aliases.jdpmedia.enabled=true
adapters.smarthub.aliases.jdpmedia.endpoint=http://localhost:8090/jdpmedia-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
adapters.smarthub.aliases.tredio.enabled=true
adapters.smarthub.aliases.tredio.endpoint=http://localhost:8090/tredio-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
adapters.smarthub.aliases.vimayx.enabled=true
adapters.smarthub.aliases.vimayx.endpoint=http://localhost:8090/vimayx-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
adapters.smarthub.aliases.felixads.enabled=true
adapters.smarthub.aliases.felixads.endpoint=http://localhost:8090/felixads-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
adapters.smartyads.enabled=true
adapters.smartyads.endpoint=http://localhost:8090/smartyads-exchange
adapters.smilewanted.enabled=true
Expand Down

0 comments on commit 4deacab

Please sign in to comment.