-
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.
- Loading branch information
mtuchkova
committed
Nov 9, 2021
1 parent
78b12ff
commit 5494da3
Showing
18 changed files
with
303 additions
and
24 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
34 changes: 34 additions & 0 deletions
34
src/test/groovy/org/prebid/server/functional/CookieSyncSpec.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,34 @@ | ||
package org.prebid.server.functional | ||
|
||
import org.prebid.server.functional.model.UidsCookie | ||
import org.prebid.server.functional.model.db.Account | ||
import org.prebid.server.functional.model.request.cookiesync.CookieSyncRequest | ||
import org.prebid.server.functional.service.PrebidServerException | ||
import org.prebid.server.functional.util.PBSUtils | ||
import spock.lang.PendingFeature | ||
|
||
class CookieSyncSpec extends BaseSpec { | ||
|
||
@PendingFeature | ||
def "PBS should return an error for cookie_sync request when the timeout time is exceeded"() { | ||
given: "PBS with timeout configuration" | ||
def pbsService = pbsServiceFactory.getService(["cookie-sync.default-timeout-ms": "1"]) | ||
|
||
and: "Default CookieSyncRequest with account" | ||
def cookieSyncRequest = CookieSyncRequest.defaultCookieSyncRequest | ||
cookieSyncRequest.account = PBSUtils.randomNumber.toString() | ||
def uidsCookie = UidsCookie.defaultUidsCookie | ||
|
||
and: "Account in the DB" | ||
def account = new Account(uuid: cookieSyncRequest.account, eventsEnabled: true) | ||
accountDao.save(account) | ||
|
||
when: "PBS processes cookie sync request" | ||
pbsService.sendCookieSyncRequest(cookieSyncRequest, uidsCookie) | ||
|
||
then: "Request should fail with error" | ||
def exception = thrown(PrebidServerException) | ||
assert exception.statusCode == 500 | ||
assert exception.responseBody.contains("Timed out while executing SQL query") | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
src/test/groovy/org/prebid/server/functional/EventSpec.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,28 @@ | ||
package org.prebid.server.functional | ||
|
||
import org.prebid.server.functional.model.db.Account | ||
import org.prebid.server.functional.model.request.event.EventRequest | ||
import org.prebid.server.functional.service.PrebidServerException | ||
|
||
class EventSpec extends BaseSpec { | ||
|
||
def "PBS should return an error for event request when the timeout time is exceeded"() { | ||
given: "PBS with timeout configuration" | ||
def pbsService = pbsServiceFactory.getService(["event.default-timeout-ms": "1"]) | ||
|
||
and: "Default EventRequest" | ||
def eventRequest = EventRequest.defaultEventRequest | ||
|
||
and: "Account in the DB" | ||
def account = new Account(uuid: eventRequest.accountId, eventsEnabled: true) | ||
accountDao.save(account) | ||
|
||
when: "PBS processes event request" | ||
pbsService.sendEventRequest(eventRequest) | ||
|
||
then: "Request should fail with error" | ||
def exception = thrown(PrebidServerException) | ||
assert exception.statusCode == 500 | ||
assert exception.responseBody.contains("Timed out while executing SQL query") | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
src/test/groovy/org/prebid/server/functional/SetuidSpec.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,35 @@ | ||
package org.prebid.server.functional | ||
|
||
import org.prebid.server.functional.model.UidsCookie | ||
import org.prebid.server.functional.model.db.Account | ||
import org.prebid.server.functional.model.request.setuid.SetuidRequest | ||
import org.prebid.server.functional.service.PrebidServerException | ||
import org.prebid.server.functional.util.PBSUtils | ||
import spock.lang.PendingFeature | ||
|
||
class SetuidSpec extends BaseSpec { | ||
|
||
@PendingFeature | ||
def "PBS should return an error for setuid request when the timeout time is exceeded"() { | ||
given: "PBS with timeout configuration" | ||
def pbsService = pbsServiceFactory.getService(["setuid.default-timeout-ms": "1"]) | ||
|
||
and: "Default setuid request with account" | ||
def request = SetuidRequest.defaultSetuidRequest | ||
def uidsCookie = UidsCookie.defaultUidsCookie | ||
request.account = PBSUtils.randomNumber.toString() | ||
|
||
and: "Account in the DB" | ||
def account = new Account(uuid: request.account, eventsEnabled: true) | ||
accountDao.save(account) | ||
|
||
when: "PBS processes setuid request" | ||
pbsService.sendSetUidRequest(request, uidsCookie) | ||
|
||
then: "Request should fail with error" | ||
def exception = thrown(PrebidServerException) | ||
assert exception.statusCode == 500 | ||
assert exception.responseBody.contains("Timed out while executing SQL query") | ||
|
||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
src/test/groovy/org/prebid/server/functional/VtrackSpec.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,27 @@ | ||
package org.prebid.server.functional | ||
|
||
import org.prebid.server.functional.model.request.vtrack.VtrackRequest | ||
import org.prebid.server.functional.model.request.vtrack.xml.Vast | ||
import org.prebid.server.functional.service.PrebidServerException | ||
import org.prebid.server.functional.util.PBSUtils | ||
|
||
class VtrackSpec extends BaseSpec { | ||
|
||
def "PBS should return an error for vtrack request when the timeout time is exceeded"() { | ||
given: "PBS with timeout configuration" | ||
def pbsService = pbsServiceFactory.getService(["vtrack.default-timeout-ms": "1"]) | ||
|
||
and: "Default VtrackRequest" | ||
def payload = PBSUtils.randomNumber.toString() | ||
def request = VtrackRequest.getDefaultVtrackRequest(mapper.encodeXml(Vast.getDefaultVastModel(payload))) | ||
def accountId = PBSUtils.randomNumber.toString() | ||
|
||
when: "PBS processes vtrack request" | ||
pbsService.sendVtrackRequest(request, accountId) | ||
|
||
then: "Request should fail with error" | ||
def exception = thrown(PrebidServerException) | ||
assert exception.statusCode == 500 | ||
assert exception.responseBody.contains("Timed out while executing SQL query") | ||
} | ||
} |
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.