Created
June 7, 2019 09:44
-
-
Save FRosner/1e9699c2880937c5bae2c7df66ff0e36 to your computer and use it in GitHub Desktop.
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
@Testcontainers | |
class DatabaseMigrationsTest { | |
@Container | |
val postgresContainer = PostgresContainer("postgres:10.6") | |
.withDatabaseName("db") | |
.withUsername("user") | |
.withPassword("password") | |
@Test | |
fun testSomethingOnYourCustomerTable() { | |
testAfterMigration(postgresContainer) { pgClient -> | |
val one = pgClient.preparedQueryAwait("select 1 from customers") | |
.first() | |
.getInt(0) | |
assertThat(one).isEqualTo(1) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment