-
Notifications
You must be signed in to change notification settings - Fork 181
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
Default auction type was defined as 1 #2
Conversation
result = bidRequest.toBuilder() | ||
.device(populatedDevice != null ? populatedDevice : bidRequest.getDevice()) | ||
.site(populatedSite != null ? populatedSite : bidRequest.getSite()) | ||
.user(populatedUser != null ? populatedUser : bidRequest.getUser()) | ||
// set the auction type to 1 if it wasn't on the request, | ||
// since header bidding is generally a first-price auction. | ||
.at(at == null || at == 0 ? 1 : at) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This construct will bite you as it bit me, refer to https://github.com/rubicon-project/prebid-server-java/blob/b984362a449c7d0b882deccf6d47fe92d7842f70/src/main/java/org/prebid/server/auction/AmpRequestFactory.java#L117 for solution
|
||
if (populatedDevice != null || populatedSite != null || populatedUser != null) { | ||
if (populatedDevice != null || populatedSite != null || populatedUser != null || at == null || at == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at == null || at == 0
condition appears twice in this method and could be extracted to a variable
@Test | ||
public void shouldNotSetAtIfItIsNotEqualsToNull(){ | ||
// given | ||
givenBidRequest(BidRequest.builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a one-liner
No description provided.