Skip to content

Commit

Permalink
Update unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
CTMBNara committed Mar 26, 2024
1 parent 7ac9510 commit 1ef1d70
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private static String resolveNetwork(ExtImpAdnuntius extImpAdnuntius) {
}

private static AdnuntiusAdUnit makeAdUnit(Imp imp, ExtImpAdnuntius extImpAdnuntius) {
final String auId = StringUtils.defaultString(extImpAdnuntius.getAuId());
final String auId = extImpAdnuntius.getAuId();
return AdnuntiusAdUnit.builder()
.auId(auId)
.targetId(targetId(auId, imp.getId()))
Expand Down Expand Up @@ -334,14 +334,17 @@ private List<BidderBid> extractBids(BidRequest bidRequest, AdnuntiusResponse adn

final Map<String, AdnuntiusAdsUnit> targetIdToAdsUnit = adnuntiusResponse.getAdsUnits().stream()
.filter(AdnuntiusBidder::validateAdsUnit)
.collect(Collectors.toMap(AdnuntiusAdsUnit::getTargetId, Function.identity()));
.collect(Collectors.toMap(
AdnuntiusAdsUnit::getTargetId,
Function.identity(),
(first, second) -> second));

String currency = null;
final List<Bid> bids = new ArrayList<>();

for (Imp imp : bidRequest.getImp()) {
final ExtImpAdnuntius extImpAdnuntius = parseImpExt(imp);
final String targetId = targetId(StringUtils.defaultString(extImpAdnuntius.getAuId()), imp.getId());
final String targetId = targetId(extImpAdnuntius.getAuId(), imp.getId());

final AdnuntiusAdsUnit adsUnit = targetIdToAdsUnit.get(targetId);
if (adsUnit == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Builder;
import lombok.Getter;
import lombok.Value;

import java.util.List;

@Builder(toBuilder = true)
@Getter
@Value
public class AdnuntiusRequest {

@JsonProperty("adUnits")
Expand Down
Loading

0 comments on commit 1ef1d70

Please sign in to comment.