Skip to content

Commit

Permalink
Add modifying of VAST for video bids and add validation (#1081)
Browse files Browse the repository at this point in the history
* Add modifying of VAST for video bids and add validation

- Add validation for Video bids. `bid.adm` or `bid.nurl` needs to be present
  - This case now, is not possible `<VASTAdTagURI><![CDATA[null]]></VASTAdTagURI>`
- Bid adm will be updated as cache. (see prebid/prebid-server#1015)
- Bid type is defined by bidder, not our (`imp.video != null`, etc) checks. For example Appnexus use `bid.ext.appnexus.bid_ad_type` to define it. (that's why there are a lot of changed cache jsons. Also add ordering for tests)

Refactored a bit.
- Removed confusing maps
- Removed confusing checks
- Removed several imp to bid matching

Possible improvements (in another ticket bc current PR is too large)
- Extract more event URL to another class
- Use bidInfo in BidResponseCreator for BidResponse

* Merged master and fixed corresponding imp can't be null

* Fix after review. (without changing localhost/event)

* Use placeholders in test resources instead of concrete urls where possible (#1084)

* Fix tests and remove ordering

* Replace usage of Wiremock EqualToJsonPattern with custom implementation to prevent incorrect json comparison

* fix openx

* Use equalToBidCacheRequest for consistency and add openrtbCacheDebugComparator() when debug is used (fix flaky tests)

* Remove redundant code

Co-authored-by: Sergii Chernysh <schernysh@users.noreply.github.com>
Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
  • Loading branch information
3 people authored Feb 23, 2021
1 parent 9a3723f commit c172af7
Show file tree
Hide file tree
Showing 147 changed files with 2,597 additions and 1,885 deletions.
324 changes: 135 additions & 189 deletions src/main/java/org/prebid/server/auction/BidResponseCreator.java

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions src/main/java/org/prebid/server/auction/model/BidInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.prebid.server.auction.model;

import com.iab.openrtb.request.Imp;
import com.iab.openrtb.response.Bid;
import lombok.Builder;
import lombok.Value;
import org.prebid.server.proto.openrtb.ext.response.BidType;

@Builder(toBuilder = true)
@Value
public class BidInfo {

String generatedBidId;

Bid bid;

Imp correspondingImp;

String bidder;

BidType bidType;

public String getBidId() {
return generatedBidId != null ? generatedBidId : bid.getId();
}
}
81 changes: 0 additions & 81 deletions src/main/java/org/prebid/server/auction/model/GeneratedBidIds.java

This file was deleted.

Loading

0 comments on commit c172af7

Please sign in to comment.