Skip to content

Commit

Permalink
Due to a test framework issue we are going to reuse postgres docker c…
Browse files Browse the repository at this point in the history
…ontainer image
  • Loading branch information
pablo gonzalez granados committed Mar 1, 2023
1 parent e01fc39 commit 73c91b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ public class PostgresqlDatabaseIT extends AbstractSqlDatabaseIT {

static final int POSTGRESQL_PORT = 5432;

// TODO rename "postgresql" database to "database" once this issue is fixed
// quarkus-qe/quarkus-test-framework#641
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static PostgresqlService database = new PostgresqlService()
static PostgresqlService postgresql = new PostgresqlService()
//fixme https://github.com/quarkus-qe/quarkus-test-framework/issues/455
.withProperty("POSTGRES_USER", "user")
.withProperty("POSTGRES_PASSWORD", "user")
.withProperty("POSTGRES_DB", "mydb");

@QuarkusApplication
static RestService app = new RestService().withProperties("postgresql.properties")
.withProperty("quarkus.datasource.username", database.getUser())
.withProperty("quarkus.datasource.password", database.getPassword())
.withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl);
.withProperty("quarkus.datasource.username", postgresql.getUser())
.withProperty("quarkus.datasource.password", postgresql.getPassword())
.withProperty("quarkus.datasource.jdbc.url", postgresql::getJdbcUrl);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ public class XAPostgresIT extends AbstractSqlDatabaseIT {

static final int POSTGRESQL_PORT = 5432;

// TODO rename "postgresql" database to "database" once this issue is fixed
// quarkus-qe/quarkus-test-framework#641
@Container(image = "${postgresql.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address")
static PostgresqlService database = new PostgresqlService()
static PostgresqlService postgresql = new PostgresqlService()
.withUser("user")
.withPassword("user")
.withDatabase("mydb");

@QuarkusApplication
static RestService app = new RestService().withProperties("postgresql.properties")
.withProperty("quarkus.datasource.username", database.getUser())
.withProperty("quarkus.datasource.password", database.getPassword())
.withProperty("quarkus.datasource.username", postgresql.getUser())
.withProperty("quarkus.datasource.password", postgresql.getPassword())
.withProperty("quarkus.datasource.jdbc.transactions", "xa")
.withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl);
.withProperty("quarkus.datasource.jdbc.url", postgresql::getJdbcUrl);
}

0 comments on commit 73c91b2

Please sign in to comment.