Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,13 @@ private static Video updatedVideo(Video video, String productId) {

return video.toBuilder()
.startdelay(resolveStartDelay(video.getStartdelay(), productId))
.placement(resolvePlacement(video.getPlacement(), productId))
.build();
}

private static Integer resolveStartDelay(Integer startDelay, String productId) {
return Objects.equals(productId, "instream") ? Integer.valueOf(0) : startDelay;
}

private static Integer resolvePlacement(Integer videoPlacement, String productId) {
if (Objects.equals(productId, "instream")) {
return 1;
}
if (BidderUtil.isNullOrZero(videoPlacement)) {
return 2;
}
return videoPlacement;
}

private static String getImpGroupName(ThirtyThreeAcrossImpExt impExt) {
final ThirtyThreeAcrossImpExtTtx impExtTtx = impExt.getTtx();
return impExtTtx.getProd() + impExtTtx.getZoneid();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/bidder-config/thirtythreeacross.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ adapters:
usersync:
cookie-family-name: 33across
iframe:
url: https://ssc-cms.33across.com/ps/?m=xch&rt=html&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&id=zzz000000000002zzz&ru={{redirect_url}}
url: https://ssc-cms.33across.com/ps/?m=xch&rt=html&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&id=zzz000000000002zzz&ru={{redirect_url}}
support-cors: false
uid-macro: '33XUSERID33X'
18 changes: 14 additions & 4 deletions src/main/resources/static/bidder-params/thirtythreeacross.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@
},
"siteId": {
"type": "string",
"description": "Site Id"
"description": "[Deprecated use zoneId instead] Site Id"
},
"zoneId": {
"type": "string",
"description": "Zone Id"
}
},
"required": [
"productId",
"siteId"
"anyOf": [
{
"required": [
"productId",
"zoneId"
]
},
{
"required": [
"productId",
"siteId"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import static java.util.function.UnaryOperator.identity;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.tuple;
import static org.prebid.server.proto.openrtb.ext.response.BidType.banner;
import static org.prebid.server.proto.openrtb.ext.response.BidType.video;

Expand Down Expand Up @@ -196,30 +195,6 @@ public void makeHttpRequestsShouldReturnErrorIfVideoParamsNotPresent() {
+ "protocols, mimes, playbackmethod"));
}

@Test
public void makeHttpRequestsShouldUpdateNotPresentPlacement() {
// given
final ExtPrebid<?, ExtImpThirtyThreeAcross> ext = ExtPrebid.of(null,
ExtImpThirtyThreeAcross.of("11", null, "3"));
final BidRequest bidRequest = BidRequest.builder()
.imp(singletonList(givenImp(impBuilder -> impBuilder
.video(validVideo())
.ext(mapper.valueToTree(ext)))))
.build();

// when
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);

// then
assertThat(result.getErrors()).isEmpty();
assertThat(result.getValue())
.extracting(HttpRequest::getPayload)
.flatExtracting(BidRequest::getImp)
.extracting(Imp::getVideo)
.extracting(Video::getPlacement)
.containsExactly(2);
}

@Test
public void makeHttpRequestsShouldNotUpdatePlacementWhenProductIdIsNotInstreamAndPlacementIsNotZero() {
// given
Expand All @@ -245,7 +220,7 @@ public void makeHttpRequestsShouldNotUpdatePlacementWhenProductIdIsNotInstreamAn
}

@Test
public void makeHttpRequestsShouldUpdatePlacementAndStartDelayIfProdIsInstream() {
public void makeHttpRequestsShouldUpdateStartDelayIfProdIsInstream() {
// given
final ExtPrebid<?, ExtImpThirtyThreeAcross> ext = ExtPrebid.of(null,
ExtImpThirtyThreeAcross.of("11", null, "instream"));
Expand All @@ -264,8 +239,8 @@ public void makeHttpRequestsShouldUpdatePlacementAndStartDelayIfProdIsInstream()
.extracting(HttpRequest::getPayload)
.flatExtracting(BidRequest::getImp)
.extracting(Imp::getVideo)
.extracting(Video::getPlacement, Video::getStartdelay)
.containsExactly(tuple(1, 0));
.extracting(Video::getStartdelay)
.containsExactly(0);
}

@Test
Expand Down
Loading