Skip to content

Commit

Permalink
fix review: fmt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgeniiMunin committed Jan 29, 2025
1 parent e6a10a8 commit 010e003
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Future<InvocationResult<AuctionRequestPayload>> call(
final AuctionContext auctionContext = invocationContext.auctionContext();
final BidRequest bidRequest = auctionContext.getBidRequest();
final GreenbidsConfig greenbidsConfig = Optional.ofNullable(parseBidRequestExt(auctionContext))
.orElse(parseAccountConfig(invocationContext.accountConfig()));
.orElseGet(() -> toGreenbidsConfig(invocationContext.accountConfig()));

if (greenbidsConfig == null) {
return Future.failedFuture(
Expand Down Expand Up @@ -113,17 +113,9 @@ private boolean isNotEmptyObjectNode(JsonNode analytics) {
return analytics != null && analytics.isObject() && !analytics.isEmpty();
}

private GreenbidsConfig parseAccountConfig(ObjectNode accountConfig) {
private GreenbidsConfig toGreenbidsConfig(ObjectNode greenbidsConfigNode) {
try {
return mapper.treeToValue(accountConfig, GreenbidsConfig.class);
} catch (JsonProcessingException e) {
throw new PreBidException(e.getMessage());
}
}

private GreenbidsConfig toGreenbidsConfig(ObjectNode adapterNode) {
try {
return mapper.treeToValue(adapterNode, GreenbidsConfig.class);
return mapper.treeToValue(greenbidsConfigNode, GreenbidsConfig.class);
} catch (JsonProcessingException e) {
return null;
}
Expand Down Expand Up @@ -219,8 +211,4 @@ private ObjectNode toObjectNode(Map<String, Ortb2ImpExtResult> values) {
public String code() {
return CODE;
}

public String name() {
return "greenbids";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public <T> Future<Void> processEvent(T event) {
}

final GreenbidsConfig greenbidsConfig = Optional.ofNullable(parseBidRequestExt(auctionContext))
.orElse(parseAccountConfig(auctionContext.getAccount()));
.orElseGet(() -> parseAccountConfig(auctionContext.getAccount()));

if (greenbidsConfig == null) {
return Future.succeededFuture();
Expand Down

0 comments on commit 010e003

Please sign in to comment.