Skip to content

Commit

Permalink
Delete tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
CTMBNara committed Mar 1, 2024
1 parent 2b495a1 commit 9cb0db7
Show file tree
Hide file tree
Showing 236 changed files with 305 additions and 27,202 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,7 @@ private Events createEvents(String bidder,
bidId,
bidder,
account.getId(),
true,
eventsContext)
: null;
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/prebid/server/bidder/ccx/CcxBidder.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public CcxBidder(String endpointUrl, JacksonMapper mapper) {

@Override
public Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest request) {

return Result.withValue(BidderUtil.defaultRequest(request, endpointUrl, mapper));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.iab.openrtb.request.BidRequest;
import com.iab.openrtb.response.BidResponse;
import com.iab.openrtb.response.SeatBid;
import io.vertx.core.http.HttpMethod;
import org.apache.commons.collections4.CollectionUtils;
import org.prebid.server.bidder.Bidder;
import org.prebid.server.bidder.model.BidderBid;
Expand Down Expand Up @@ -37,15 +36,11 @@ public FreewheelSSPBidder(String endpointUrl, JacksonMapper mapper) {

@Override
public final Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest bidRequest) {
return Result.withValue(
HttpRequest.<BidRequest>builder()
.method(HttpMethod.POST)
.uri(endpointUrl)
.headers(HttpUtil.headers().add(COMPONENT_ID_HEADER_NAME, COMPONENT_ID_HEADER_VALUE))
.body(mapper.encodeToBytes(bidRequest))
.impIds(BidderUtil.impIds(bidRequest))
.payload(bidRequest)
.build());
return Result.withValue(BidderUtil.defaultRequest(
bidRequest,
HttpUtil.headers().add(COMPONENT_ID_HEADER_NAME, COMPONENT_ID_HEADER_VALUE),
endpointUrl,
mapper));
}

@Override
Expand Down
15 changes: 6 additions & 9 deletions src/main/java/org/prebid/server/bidder/jixie/JixieBidder.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.iab.openrtb.response.BidResponse;
import com.iab.openrtb.response.SeatBid;
import io.vertx.core.MultiMap;
import io.vertx.core.http.HttpMethod;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.prebid.server.bidder.Bidder;
Expand All @@ -19,6 +18,7 @@
import org.prebid.server.json.DecodeException;
import org.prebid.server.json.JacksonMapper;
import org.prebid.server.proto.openrtb.ext.response.BidType;
import org.prebid.server.util.BidderUtil;
import org.prebid.server.util.HttpUtil;

import java.util.Collection;
Expand All @@ -38,14 +38,11 @@ public JixieBidder(String endpointUrl, JacksonMapper mapper) {

@Override
public Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest request) {

return Result.withValue(HttpRequest.<BidRequest>builder()
.method(HttpMethod.POST)
.uri(endpointUrl)
.headers(resolveHeaders(request.getDevice(), request.getSite()))
.payload(request)
.body(mapper.encodeToBytes(request))
.build());
return Result.withValue(BidderUtil.defaultRequest(
request,
resolveHeaders(request.getDevice(), request.getSite()),
endpointUrl,
mapper));
}

private static MultiMap resolveHeaders(Device device, Site site) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public LoopmeBidder(String endpointUrl, JacksonMapper mapper) {

@Override
public Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest request) {

return Result.withValue(BidderUtil.defaultRequest(request, endpointUrl, mapper));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public VrtcalBidder(String endpointUrl, JacksonMapper mapper) {

@Override
public Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest request) {

return Result.withValue(BidderUtil.defaultRequest(request, endpointUrl, mapper));
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/prebid/server/cache/CacheService.java
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ private String generateWinUrl(String bidId,
bidId,
bidder,
accountId,
true,
eventsContext)
: null;
}
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/org/prebid/server/events/EventsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,24 @@ public EventsService(String externalUrl) {
public Events createEvent(String bidId,
String bidder,
String accountId,
boolean analyticsEnabled,
EventsContext eventsContext) {

return Events.of(
eventUrl(
EventRequest.Type.win,
bidId,
bidder,
accountId,
analytics(analyticsEnabled),
EventRequest.Format.image,
eventsContext),
eventUrl(
EventRequest.Type.imp,
bidId,
bidder,
accountId,
analytics(analyticsEnabled),
EventRequest.Format.image,
eventsContext));
}
Expand All @@ -43,13 +47,15 @@ public Events createEvent(String bidId,
public String winUrl(String bidId,
String bidder,
String accountId,
boolean analyticsEnabled,
EventsContext eventsContext) {

return eventUrl(
EventRequest.Type.win,
bidId,
bidder,
accountId,
analytics(analyticsEnabled),
EventRequest.Format.image,
eventsContext);
}
Expand All @@ -66,6 +72,7 @@ public String vastUrlTracking(String bidId,
bidId,
bidder,
accountId,
null,
EventRequest.Format.blank,
eventsContext);
}
Expand All @@ -74,6 +81,7 @@ private String eventUrl(EventRequest.Type type,
String bidId,
String bidder,
String accountId,
EventRequest.Analytics analytics,
EventRequest.Format format,
EventsContext eventsContext) {

Expand All @@ -86,8 +94,13 @@ private String eventUrl(EventRequest.Type type,
.timestamp(eventsContext.getAuctionTimestamp())
.format(format)
.integration(eventsContext.getIntegration())
.analytics(analytics)
.build();

return EventUtil.toUrl(externalUrl, eventRequest);
}

private static EventRequest.Analytics analytics(boolean analyticsEnabled) {
return analyticsEnabled ? null : EventRequest.Analytics.disabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ private Integer durationAsInt(MultiMap parameters) {
try {
return value != null ? Integer.parseInt(value) : null;
} catch (NumberFormatException e) {
throw new InvalidRequestException("Invalid '%s' parameter value".formatted(LoggerControlKnobHandler.DURATION_PARAMETER));
throw new InvalidRequestException("Invalid '%s' parameter value"
.formatted(LoggerControlKnobHandler.DURATION_PARAMETER));
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9cb0db7

Please sign in to comment.