Skip to content

Commit

Permalink
upgraded to testcontainers-1.19.8, s/embeddedPg/testContainers/g
Browse files Browse the repository at this point in the history
  • Loading branch information
tptignor committed Jul 12, 2024
1 parent bd67378 commit dfdfb5c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import BuildSettings._
import sbtassembly.AssemblyPlugin.autoImport.assemblyMergeStrategy
import com.typesafe.sbt.packager.docker._

lazy val commonDeps = Seq(logback, scalaTest, scalaCheck, akkaHttpSprayJson, embeddedPg, apacheCommonsIO, s3Mock,log4jToSlf4j, kubernetesApi)
lazy val commonDeps = Seq(logback, scalaTest, scalaCheck, akkaHttpSprayJson, testContainers, apacheCommonsIO, s3Mock,log4jToSlf4j, kubernetesApi)

lazy val sparkDeps =
Seq(
Expand Down
14 changes: 7 additions & 7 deletions common/src/test/scala/hmda/utils/EmbeddedPostgres.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import scala.concurrent.ExecutionContext.Implicits.global
* after each test and finally deletes all tables before the suite is complete and tears down the database
*/
trait EmbeddedPostgres extends BeforeAndAfterAll with BeforeAndAfterEach { self: Suite =>
private val embeddedPg = new FixedHostPortGenericContainer("postgres:12")
private val testContainer = new FixedHostPortGenericContainer("postgres:12")
val dbHoconpath = "embedded-pg"
val dbConfig = DatabaseConfig.forConfig[JdbcProfile](dbHoconpath)

Expand Down Expand Up @@ -48,19 +48,19 @@ trait EmbeddedPostgres extends BeforeAndAfterAll with BeforeAndAfterEach { self:
}

override protected def beforeAll(): Unit = {
embeddedPg.withEnv("POSTGRES_USER", "postgres")
embeddedPg.withEnv("POSTGRES_PASSWORD", "postgres")
embeddedPg.withEnv("POSTGRES_DB", "postgres")
embeddedPg.withFixedExposedPort(5432, 5432)
embeddedPg.start()
testContainer.withEnv("POSTGRES_USER", "postgres")
testContainer.withEnv("POSTGRES_PASSWORD", "postgres")
testContainer.withEnv("POSTGRES_DB", "postgres")
testContainer.withFixedExposedPort(5432, 5432)
testContainer.start()
executeSQL(removeAllTables)
loadSqlFileFromResources(bootstrapSqlFile)
super.beforeAll()
}

override protected def afterAll(): Unit = {
executeSQL(removeAllTables)
embeddedPg.stop()
testContainer.stop()
super.afterAll()
}

Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object Dependencies {
lazy val alpakkaSlick = "com.lightbend.akka" %% "akka-stream-alpakka-slick" % Version.alpakka
lazy val postgres = "org.postgresql" % "postgresql" % Version.postgres
lazy val h2 = "com.h2database" % "h2" % Version.h2 % Test
lazy val embeddedPg = "org.testcontainers" % "postgresql" % "1.18.0" % "test"
lazy val testContainers = "org.testcontainers" % "testcontainers" % Version.testContainers % "test"
lazy val s3Mock = "com.adobe.testing" % "s3mock" % "2.1.19" % Test
lazy val apacheCommonsIO = "commons-io" % "commons-io" % "2.6" % Test
lazy val keycloakAdapter = "org.keycloak" % "keycloak-adapter-core" % Version.keycloak
Expand Down
2 changes: 1 addition & 1 deletion project/Version.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ object Version {
val slickPostgres = "0.21.1"
val postgres = "42.6.0"
val h2 = "2.1.214"
val embeddedPg = "2.10"
val keycloak = "22.0.1"
val resteasy = "6.2.4.Final"
val jbossLogging = "3.5.1.Final"
Expand All @@ -39,4 +38,5 @@ object Version {
val diffx = "0.4.0"
val log4j = "2.15.0"
val kubernetesApi = "15.0.1"
val testContainers = "1.19.8"
}

0 comments on commit dfdfb5c

Please sign in to comment.