-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Native stored response with missing asset id (#1781)
- Loading branch information
Showing
28 changed files
with
237 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
.../server/functional/model/db/typeconverter/StoredAuctionResponseConfigTypeConverter.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.prebid.server.functional.model.db.typeconverter | ||
|
||
import javax.persistence.AttributeConverter | ||
import org.prebid.server.functional.model.response.auction.SeatBid | ||
import org.prebid.server.functional.testcontainers.Dependencies | ||
|
||
class StoredAuctionResponseConfigTypeConverter implements AttributeConverter<SeatBid, String> { | ||
|
||
@Override | ||
String convertToDatabaseColumn(SeatBid seatBid) { | ||
seatBid ? Dependencies.objectMapperWrapper.encode(seatBid) : null | ||
} | ||
|
||
@Override | ||
SeatBid convertToEntityAttribute(String value) { | ||
value ? Dependencies.objectMapperWrapper.decode(value, SeatBid) : null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/test/groovy/org/prebid/server/functional/model/request/auction/AssetImage.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import groovy.transform.ToString | ||
import org.prebid.server.functional.util.PBSUtils | ||
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
class AssetImage { | ||
|
||
Integer type | ||
String url | ||
Integer w | ||
Integer wmin | ||
Integer h | ||
Integer hmin | ||
List<String> mimes | ||
|
||
static AssetImage getDefaultAssetImage() { | ||
new AssetImage(type: 1, url: PBSUtils.randomString) | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
...test/groovy/org/prebid/server/functional/model/request/auction/DistributionChannel.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
src/test/groovy/org/prebid/server/functional/model/request/auction/Native.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import com.fasterxml.jackson.annotation.JsonGetter | ||
import com.fasterxml.jackson.annotation.JsonSetter | ||
import groovy.transform.ToString | ||
import org.prebid.server.functional.testcontainers.Dependencies | ||
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
class Native { | ||
|
||
String request | ||
Request request | ||
String ver | ||
List<Integer> api | ||
List<Integer> battr | ||
|
||
@JsonGetter("request") | ||
String getRequest() { | ||
Dependencies.objectMapperWrapper.encode(request) | ||
} | ||
|
||
@JsonSetter("request") | ||
void getRequest(String request) { | ||
this.request = Dependencies.objectMapperWrapper.decode(request, Request) | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/test/groovy/org/prebid/server/functional/model/request/auction/Request.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.prebid.server.functional.model.request.auction | ||
|
||
import com.fasterxml.jackson.databind.PropertyNamingStrategies | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming | ||
import com.iab.openrtb.request.EventTracker | ||
import groovy.transform.ToString | ||
|
||
@JsonNaming(PropertyNamingStrategies.LowerCaseStrategy) | ||
@ToString(includeNames = true, ignoreNulls = true) | ||
class Request { | ||
|
||
String ver | ||
Integer context | ||
Integer contextSubtype | ||
Integer plcmtType | ||
Integer plcmtcnt | ||
Integer seq | ||
List<Asset> assets | ||
Integer aurlSupport | ||
Integer durlSupport | ||
List<EventTracker> eventTrackers | ||
Integer privacy | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/groovy/org/prebid/server/functional/model/response/auction/Adm.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.prebid.server.functional.model.response.auction | ||
|
||
import org.prebid.server.functional.model.request.auction.Asset | ||
|
||
class Adm { | ||
|
||
List<Asset> assets | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ class BidExt { | |
|
||
Prebid prebid | ||
BigDecimal origbidcpm | ||
String origbidcur | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
src/test/groovy/org/prebid/server/functional/model/response/auction/SeatBid.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
package org.prebid.server.functional.model.response.auction | ||
|
||
import groovy.transform.ToString | ||
import org.prebid.server.functional.model.bidder.BidderName | ||
import org.prebid.server.functional.model.request.auction.BidRequest | ||
|
||
import static org.prebid.server.functional.model.bidder.BidderName.* | ||
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
class SeatBid { | ||
|
||
List<Bid> bid | ||
String seat | ||
BidderName seat | ||
Integer group | ||
|
||
static SeatBid getStoredResponse(BidRequest bidRequest) { | ||
def bids = Bid.getDefaultBids(bidRequest.imp) | ||
new SeatBid(bid: bids, seat: GENERIC) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.