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: 6 additions & 6 deletions adapters/sspBC/sspbc.go → adapters/gopl/gopl.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sspBC
package gopl

import (
"encoding/json"
Expand All @@ -16,7 +16,7 @@ import (
)

const (
adapterVersion = "6.0"
adapterVersion = "7.0"
)

type (
Expand All @@ -33,11 +33,11 @@ type (
)

// ---------------ADAPTER INTERFACE------------------
// Builder builds a new instance of the sspBC adapter
// Builder builds a new instance of the Gopl adapter
func Builder(_ openrtb_ext.BidderName, config config.Adapter, _ config.Server) (adapters.Bidder, error) {
endpoint, err := buildAdapterEndpoint(config.Endpoint, adapterVersion)
if err != nil {
return nil, fmt.Errorf("unable to build sspbc adapter endpoint: %w", err)
return nil, fmt.Errorf("unable to build gopl adapter endpoint: %w", err)
}

bidder := &adapter{
Expand All @@ -48,14 +48,14 @@ func Builder(_ openrtb_ext.BidderName, config config.Adapter, _ config.Server) (
}

func (a *adapter) MakeRequests(request *openrtb2.BidRequest, extraRequestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
sspBcRequest := &requestData{
goplRequest := &requestData{
Request: request,
RequestInfo: &requestInfo{
PbsEntryPoint: extraRequestInfo.PbsEntryPoint,
},
}

requestJSON, err := json.Marshal(sspBcRequest)
requestJSON, err := json.Marshal(goplRequest)
if err != nil {
return nil, []error{err}
}
Expand Down
10 changes: 5 additions & 5 deletions adapters/sspBC/sspbc_test.go → adapters/gopl/gopl_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sspBC
package gopl

import (
"encoding/json"
Expand All @@ -13,20 +13,20 @@ import (
)

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderSspBC, config.Adapter{
bidder, buildErr := Builder(openrtb_ext.BidderGopl, config.Adapter{
Endpoint: "http://ssp.wp.test/bidder/"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

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

adapterstest.RunJSONBidderTest(t, "sspbctest", bidder)
adapterstest.RunJSONBidderTest(t, "gopltest", bidder)
}

func TestInvalidEndpointURL(t *testing.T) {
invalidEndpointURL := "http://ssp.wp.test /bidder/"

_, buildErr := Builder(openrtb_ext.BidderSspBC, config.Adapter{
_, buildErr := Builder(openrtb_ext.BidderGopl, config.Adapter{
Endpoint: invalidEndpointURL}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr == nil {
Expand All @@ -35,7 +35,7 @@ func TestInvalidEndpointURL(t *testing.T) {
}

func TestMakeRequests(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderSspBC, config.Adapter{
bidder, buildErr := Builder(openrtb_ext.BidderGopl, config.Adapter{
Endpoint: "http://ssp.wp.test/bidder/"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down Expand Up @@ -93,7 +93,7 @@
"id": "test-request",
"seatbid": [
{
"seat": "sspbc-test",
"seat": "gopl-test",
"bid": [{
"adm": "test-audio-ad",
"id": "response-005",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down Expand Up @@ -140,7 +140,7 @@
"adm": "<!--preformatted-->test_ad_1",
"nurl": "www.test.com",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"ext": {
Expand All @@ -160,15 +160,15 @@
"mtype": 1
}
],
"seat": "sspbc-test"
"seat": "gopl-test"
},
{
"bid": [
{
"adm": "<!--preformatted-->test_ad_2",
"nurl": "www.test.com",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "5678",
"ext": {
Expand All @@ -188,7 +188,7 @@
"mtype": 1
}
],
"seat": "sspbc-test"
"seat": "gopl-test"
}
]
}
Expand All @@ -207,7 +207,7 @@
"adm": "<!--preformatted-->test_ad_1",
"nurl": "www.test.com",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"w": 300,
Expand All @@ -233,7 +233,7 @@
"adm": "<!--preformatted-->test_ad_2",
"nurl": "www.test.com",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "5678",
"w": 300,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down Expand Up @@ -91,7 +91,7 @@
{
"adm": "<!--preformatted-->test_ad",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"ext": {
Expand All @@ -111,10 +111,10 @@
"mtype": 1
}
],
"seat": "sspbc-test"
"seat": "gopl-test"
}
],
"sn": "sspbc-test"
"sn": "gopl-test"
}
}
}
Expand All @@ -130,7 +130,7 @@
"price": 20,
"adm": "<!--preformatted-->test_ad",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"w": 300,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down Expand Up @@ -101,7 +101,7 @@
{
"adm": "<!--preformatted-->test_ad",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"ext": {
Expand All @@ -121,10 +121,10 @@
"mtype": 1
}
],
"seat": "sspbc-test"
"seat": "gopl-test"
}
],
"sn": "sspbc-test"
"sn": "gopl-test"
}
}
}
Expand All @@ -140,7 +140,7 @@
"price": 20,
"adm": "<!--preformatted-->test_ad",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"w": 300,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down Expand Up @@ -89,7 +89,7 @@
"id": "test-request",
"seatbid": [
{
"seat": "sspbc-test",
"seat": "gopl-test",
"bid": [{
"adm": "test-native-ad",
"id": "response-005",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down Expand Up @@ -93,7 +93,7 @@
"id": "test-request",
"seatbid": [
{
"seat": "sspbc-test",
"seat": "gopl-test",
"bid": [
{
"adm": "test-video-ad",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down Expand Up @@ -101,7 +101,7 @@
{
"adm": "",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"ext": {
Expand All @@ -121,10 +121,10 @@
"mtype": 0
}
],
"seat": "sspbc-test"
"seat": "gopl-test"
}
],
"sn": "sspbc-test"
"sn": "gopl-test"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://ssp.wp.test/bidder/?bdver=6.0",
"uri": "http://ssp.wp.test/bidder/?bdver=7.0",
"body": {
"bidRequest": {
"id": "test-request",
Expand Down Expand Up @@ -129,7 +129,7 @@
{
"adm": "<!--preformatted-->test_ad_1",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"ext": {
Expand All @@ -149,14 +149,14 @@
"mtype": 1
}
],
"seat": "sspbc-test"
"seat": "gopl-test"
},
{
"bid": [
{
"adm": "<!--preformatted-->test_ad_2",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "5678",
"ext": {
Expand All @@ -176,10 +176,10 @@
"mtype": 1
}
],
"seat": "sspbc-test"
"seat": "gopl-test"
}
],
"sn": "sspbc-test"
"sn": "gopl-test"
}
}
}
Expand All @@ -195,7 +195,7 @@
"price": 20,
"adm": "<!--preformatted-->test_ad_1",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "1234",
"w": 300,
Expand All @@ -220,7 +220,7 @@
"price": 10,
"adm": "<!--preformatted-->test_ad_2",
"adomain": [
"sspbc-test"
"gopl-test"
],
"crid": "5678",
"w": 300,
Expand Down
Loading
Loading