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

Implemented bid price adjustment #6

Merged
merged 5 commits into from
Apr 10, 2018
Merged

Implemented bid price adjustment #6

merged 5 commits into from
Apr 10, 2018

Conversation

anestere
Copy link
Contributor

@anestere anestere commented Apr 5, 2018

No description provided.

@anestere anestere requested a review from rpanchyk April 5, 2018 16:17
Copy link
Contributor

@rpanchyk rpanchyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

return bidderCatalog.bidderRequesterByName(resolveBidder(bidder, aliases))
.requestBids(bidderRequest.getBidRequest(), timeout)
.map(this::validateAndUpdateResponse)
.map(seat -> ExchangeService.applyBidPriceAdjustment(seat, bidPriceAdjustmentFactor))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for full qualifier

.map(seat -> applyBidPriceAdjustment(seat, bidPriceAdjustmentFactor))


validateAliases(aliases);
final boolean isPrebidExtPresent = extRequestPrebid != null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need separate var for one time using?


for (Map.Entry<String, BigDecimal> bidderAdjustment : adjustmentFactors.entrySet()) {
final String bidder = bidderAdjustment.getKey();
final BigDecimal adjustmentFactor = bidderAdjustment.getValue();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor. We can move down adjustmentFactor before if(...) statement.

}

@Test
public void shouldRequestBidsWithBidAdjustmentFactor() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicates shouldReturnBidsWithAdjustedPricesWhenAdjustmentFactorPresent test.

final ValidationResult result = requestValidator.validate(bidRequest);

// then
assertThat(result.getErrors()).hasSize(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasSize(0) can be replaced with isEmpty(). Check another places pls.

@bretg
Copy link
Collaborator

bretg commented Apr 6, 2018

@jordillachmrf also took a look at these changes and is ok with them.

@rpanchyk rpanchyk merged commit 256902d into master Apr 10, 2018
@rpanchyk rpanchyk deleted the bid-cpm-adjustment branch April 10, 2018 08:24
jordillachmrf referenced this pull request in Marfeel/prebid-server-java Apr 15, 2018
schernysh pushed a commit that referenced this pull request Nov 25, 2019
ishihanvcs pushed a commit to ishihanvcs/prebid-server-java that referenced this pull request Apr 10, 2023
Docker support & version logging
VeryExtraordinaryUsername added a commit that referenced this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants