Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Adapter: Insticator #3806

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
526 changes: 526 additions & 0 deletions adapters/insticator/insticator.go

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions adapters/insticator/insticator_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package insticator

import (
"testing"

"github.com/prebid/prebid-server/v2/adapters/adapterstest"
"github.com/prebid/prebid-server/v2/config"
"github.com/prebid/prebid-server/v2/openrtb_ext"
)

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderInsticator, config.Adapter{
Endpoint: "https://ex.ingage.tech/v1/prebidserver"},
config.Server{ExternalUrl: "https://ex.ingage.tech/v1/prebidserver", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
}

adapterstest.RunJSONBidderTest(t, "insticatortest", bidder)
}
119 changes: 119 additions & 0 deletions adapters/insticator/insticatortest/exemplary/app-banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [{"w": 728, "h": 90}]
},
"ext": {
"bidder": {
"adUnitId": "fake-site-id",
"publisherId": "test-publisher-id"
}
}
}
],
"app": {
"publisher": {
"id": "test-publisher-id"
}
}
},

"httpCalls": [
{
"expectedRequest": {
"uri": "https://ex.ingage.tech/v1/prebidserver",
"body": {
"ext": {
"insticator": {
"caller": [
{
"name": "Prebid-Server",
"version": "n/a"
}
]
}
},
"id": "test-request-id",
"imp": [
{
"id":"test-imp-id",
"banner": {
"format": [{"w": 728, "h": 90}]
},
"ext": {
"insticator": {
"adUnitId": "fake-site-id",
"publisherId": "test-publisher-id"
}
}
}
],
"app": {
"publisher": {
"id": "test-publisher-id"
}
}
},
"impIDs":["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [
{
"seat": "insticator",
"bid": [{
"id": "8ee514f1-b2b8-4abb-89fd-084437d1e800",
"impid": "test-imp-id",
"price": 0.500000,
"adm": "some-test-ad",
"crid": "crid_10",
"h": 90,
"w": 728,
"mtype": 1,
"ext": {
"insticator": {
"mediaType": "banner"
}
}
}]
}
],
"cur": "USD"
}
}
}
],

"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "8ee514f1-b2b8-4abb-89fd-084437d1e800",
"impid": "test-imp-id",
"price": 0.5,
"adm": "some-test-ad",
"crid": "crid_10",
"w": 728,
"h": 90,
"mtype": 1,
"ext": {
"insticator": {
"mediaType": "banner"
}
}
},
"type": "banner"
}
]
}
]
}

131 changes: 131 additions & 0 deletions adapters/insticator/insticatortest/exemplary/app-video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"video": {
"w": 728,
"h": 90,
"protocols": [2],
"placement": 1,
"startdelay": -2,
"playbackmethod": [2],
"mimes": ["foo", "bar"]
},
"ext": {
"bidder": {
"adUnitId": "fake-site-id",
"publisherId": "test-publisher-id"
}
}
}
],
"app": {
"publisher": {
"id": "test-publisher-id"
}
}
},

"httpCalls": [
{
"expectedRequest": {
"uri": "https://ex.ingage.tech/v1/prebidserver",
"body": {
"ext": {
"insticator": {
"caller": [
{
"name": "Prebid-Server",
"version": "n/a"
}
]
}
},
"id": "test-request-id",
"imp": [
{
"id":"test-imp-id",
"video": {
"w": 728,
"h": 90,
"protocols": [2],
"placement": 1,
"startdelay": -2,
"playbackmethod": [2],
"mimes": ["foo", "bar"]
},
"ext": {
"insticator": {
"adUnitId": "fake-site-id",
"publisherId": "test-publisher-id"
}
}
}
],
"app": {
"publisher": {
"id": "test-publisher-id"
}
}
},
"impIDs":["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [
{
"seat": "insticator",
"bid": [{
"id": "8ee514f1-b2b8-4abb-89fd-084437d1e800",
"impid": "test-imp-id",
"price": 0.500000,
"adm": "some-test-vast-ad",
"mtype": 2,
"crid": "crid_10",
"h": 90,
"w": 728,
"ext": {
"insticator": {
"mediaType": "video"
}
}
}]
}
],
"cur": "USD"
}
}
}
],

"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "8ee514f1-b2b8-4abb-89fd-084437d1e800",
"impid": "test-imp-id",
"price": 0.5,
"adm": "some-test-vast-ad",
"crid": "crid_10",
"w": 728,
"mtype": 2,
"h": 90,
"ext": {
"insticator": {
"mediaType": "video"
}
}
},
"type": "video"
}
]
}
]
}

121 changes: 121 additions & 0 deletions adapters/insticator/insticatortest/exemplary/multi-format.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [{"w": 728, "h": 90}]
},
"video": {
"w": 728,
"h": 90,
"protocols": [2],
"playbackmethod": [2],
"mimes": ["foo", "bar"]
},
"ext": {
"bidder": {
"adUnitId": "inview",
"publisherId": "test-publisher-id"
}
}
}
],
"site": {
"publisher": {
"id": "test-publisher-id"
}
}
},

"httpCalls": [
{
"expectedRequest": {
"uri": "https://ex.ingage.tech/v1/prebidserver",
"body": {
"ext": {
"insticator": {
"caller": [
{
"name": "Prebid-Server",
"version": "n/a"
}
]
}
},
"id": "test-request-id",
"imp": [
{
"id":"test-imp-id",
"banner": {
"format": [{"w": 728, "h": 90}]
},
"video": {
"w": 728,
"h": 90,
"protocols": [2],
"playbackmethod": [2],
"mimes": ["foo", "bar"]
},
"ext": {
"insticator": {
"adUnitId": "inview",
"publisherId": "test-publisher-id"
}
}
}
],
"site": {
"publisher": {
"id": "test-publisher-id"
}
}
},
"impIDs":["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [
{
"seat": "insticator",
"bid": [{
"id": "8ee514f1-b2b8-4abb-89fd-084437d1e800",
"impid": "test-imp-id",
"price": 0.500000,
"adm": "some-test-ad",
"crid": "crid_10",
"h": 90,
"w": 728
}]
}
],
"cur": "USD"
}
}
}
],

"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "8ee514f1-b2b8-4abb-89fd-084437d1e800",
"impid": "test-imp-id",
"price": 0.5,
"adm": "some-test-ad",
"crid": "crid_10",
"w": 728,
"h": 90
},
"type": "banner"
}
]
}
]
}

Loading
Loading