Skip to content

Commit

Permalink
fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
mtuchkova committed Dec 28, 2021
1 parent e9a1fd9 commit 4595db5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package org.prebid.server.functional.testcontainers

import org.prebid.server.functional.testcontainers.container.NetworkServiceContainer
import org.prebid.server.functional.util.ObjectMapperWrapper
import org.prebid.server.functional.util.PBSUtils
import org.testcontainers.containers.MySQLContainer
import org.testcontainers.containers.Network
import org.testcontainers.lifecycle.Startables

class Dependencies {

private static final Boolean IS_LAUNCH_CONTAINERS = Boolean.valueOf(System.getProperty("launchContainers"))
private static final Boolean IS_LAUNCH_CONTAINERS = Boolean.valueOf(
PBSUtils.getPropertyOrDefaultValue("launchContainers", "false"))

static final ObjectMapperWrapper objectMapperWrapper = new ObjectMapperWrapper()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import org.prebid.server.functional.service.PrebidServerService
import org.prebid.server.functional.testcontainers.container.NetworkServiceContainer
import org.prebid.server.functional.testcontainers.container.PrebidServerContainer
import org.prebid.server.functional.util.ObjectMapperWrapper
import org.prebid.server.functional.util.PBSUtils

class PbsServiceFactory {

private static final Map<Map<String, String>, PrebidServerContainer> containers = [:]
private static final Integer MAX_CONTAINERS_COUNT = Integer.valueOf(System.getProperty("max.containers.count"))
private static final Integer MAX_CONTAINERS_COUNT = Integer.valueOf(
PBSUtils.getPropertyOrDefaultValue("max.containers.count", "2"))

private final ObjectMapperWrapper mapper
private final NetworkServiceContainer networkServiceContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ class PBSUtils {
}
path
}

static String getPropertyOrDefaultValue(String property, String defaultValue) {
System.getProperty(property) ?: defaultValue
}
}

0 comments on commit 4595db5

Please sign in to comment.