Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 6 additions & 0 deletions src/main/resources/bidder-config/xeworks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
adapters:
xeworks:
endpoint: http://prebid-srv.xe.works/?pid={{SourceId}}&host={{Host}}
aliases:
connektai:
enabled: false
endpoint: http://rtb.connektai.live/?pid={{SourceId}}&host={{Host}}&s=pbs
meta-info:
maintainer-email: adops@connekt.ai
meta-info:
maintainer-email: team@xe.works
app-media-types:
Expand Down
38 changes: 38 additions & 0 deletions src/test/java/org/prebid/server/it/ConnektaiTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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 ConnektaiTest extends IntegrationTest {

@Test
public void openrtb2AuctionShouldRespondWithBidsFromConnektai() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/connektai-exchange"))
.withQueryParam("host", equalTo("envValue"))
.withQueryParam("sourceId", equalTo("pidValue"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to test this. It is already tested in the unit tests for the base bidder. We write integration tests only to check that the configurations are correct and that the simplest request will pass from request to response.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because @AntoxaAntoxic said to do it.
Okey, I understand. So where should I check if, for example, in a YAML file, we have two fields, but only one is required, such as placementId? Should I write the tests here?

.withRequestBody(equalToJson(
jsonFrom("openrtb2/connektai/test-connektai-bid-request.json")))
.willReturn(aResponse().withBody(
jsonFrom("openrtb2/connektai/test-connektai-bid-response.json"))));

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

// then
assertJsonEquals("openrtb2/connektai/test-auction-connektai-response.json", response,
singletonList("connektai"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 300,
"h": 250
},
"ext": {
"connektai": {
"env": "envValue",
"pid": "pidValue"
}
}
}
],
"tmax": 5000,
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"exp": 300,
"price": 11.393,
"adm": "some adm value",
"adomain": [
],
"crid": "test-creative-id-1",
"ext": {
"prebid": {
"type": "banner"
},
"origbidcpm": 10,
"origbidcur": "EUR"
}
}
],
"seat": "connektai",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"connektai": "{{ connektai.response_time_ms }}"
},
"tmaxrequest": 5000,
"prebid": {
"auctiontimestamp": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"secure": 1,
"banner": {
"w": 300,
"h": 250
},
"ext": {
"tid": "${json-unit.any-string}",
"bidder": {
"env": "envValue",
"pid": "pidValue"
}
}
}
],
"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}",
"regs": {
"ext": {
"gdpr": 0
}
},
"cur": [
"USD"
],
"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",
"adm": "some adm value",
"price": 10,
"adomain": [],
"crid": "test-creative-id-1",
"ext": {
"prebid": {
"type": "banner"
}
}
}
]
}
],
"cur": "EUR"
}
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ adapters.vrtcal.enabled=true
adapters.vrtcal.endpoint=http://localhost:8090/vrtcal-exchange
adapters.xeworks.enabled=true
adapters.xeworks.endpoint=http://localhost:8090/xeworks-exchange
adapters.xeworks.aliases.connektai.enabled=true
adapters.xeworks.aliases.connektai.endpoint=http://localhost:8090/connektai-exchange?host={{Host}}&sourceId={{SourceId}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove params here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added params because:
image

adapters.vidazoo.enabled=true
adapters.vidazoo.endpoint=http://localhost:8090/vidazoo-exchange/
adapters.videobyte.enabled=true
Expand Down
Loading