Skip to content

Commit

Permalink
adding tests for advertiser insted of pubrender.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikael-lundin committed Sep 16, 2024
1 parent 4d7e45d commit 38120a5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 156 deletions.
8 changes: 3 additions & 5 deletions adapters/adnuntius/adnuntius.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type Ad struct {
LineItemId string
Html string
DestinationUrls map[string]string
Advertiser adnAdvertiser
Advertiser adnAdvertiser `json:"advertiser,omitempty"`
}

type AdUnit struct {
Expand Down Expand Up @@ -387,7 +387,7 @@ func generateReturnExt(ad Ad, request *openrtb2.BidRequest) (json.RawMessage, er
}
}

if requestRegsExt != nil && requestRegsExt.DSA != nil {
if ad.Advertiser.Name != "" && requestRegsExt != nil && requestRegsExt.DSA != nil {
legalName := ad.Advertiser.Name
if ad.Advertiser.LegalName != "" {
legalName = ad.Advertiser.LegalName
Expand All @@ -405,10 +405,8 @@ func generateReturnExt(ad Ad, request *openrtb2.BidRequest) (json.RawMessage, er
}

return returnExt, nil
} else {
return nil, nil
}

return nil, nil
}

func generateAdResponse(ad Ad, imp openrtb2.Imp, html string, request *openrtb2.BidRequest) (*openrtb2.Bid, []error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"creativeId": "jn9hpzvlsf8cpdmm",
"lineItemId": "q7y9qm5b0xt9htrv",
"advertiser": {
"legalName": "LegalName",
"name": "Name"
"name": "Name",
"legalName": "LegalName"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"ext": {
"dsa": {
"dsarequired": 3,
"pubrender": 1,
"datatopub": 1
}
}
Expand Down Expand Up @@ -87,11 +86,7 @@
"creativeWidth": "980",
"creativeHeight": "240",
"creativeId": "jn9hpzvlsf8cpdmm",
"lineItemId": "q7y9qm5b0xt9htrv",
"advertiser": {
"legalName": "LegalName",
"name": "Name"
}
"lineItemId": "q7y9qm5b0xt9htrv"
}
]
}
Expand All @@ -116,14 +111,7 @@
"cid": "q7y9qm5b0xt9htrv",
"crid": "jn9hpzvlsf8cpdmm",
"w": 980,
"h": 240,
"ext": {
"dsa": {
"paid": "LegalName",
"behalf": "LegalName",
"adrender": 0
}
}
"h": 240
},
"type": "banner"

Expand Down

This file was deleted.

0 comments on commit 38120a5

Please sign in to comment.