-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test Extended Architecture (XA) connection
Provides coverage for https://issues.redhat.com/browse/QUARKUS-2742
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 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
26 changes: 26 additions & 0 deletions
26
sql-db/sql-app/src/test/java/io/quarkus/ts/sqldb/sqlapp/XAPostgresIT.java
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,26 @@ | ||
package io.quarkus.ts.sqldb.sqlapp; | ||
|
||
import io.quarkus.test.bootstrap.PostgresqlService; | ||
import io.quarkus.test.bootstrap.RestService; | ||
import io.quarkus.test.scenarios.QuarkusScenario; | ||
import io.quarkus.test.services.Container; | ||
import io.quarkus.test.services.QuarkusApplication; | ||
|
||
@QuarkusScenario | ||
public class XAPostgresIT extends AbstractSqlDatabaseIT { | ||
|
||
static final int POSTGRESQL_PORT = 5432; | ||
|
||
@Container(image = "${postgresql.also.latest.image}", port = POSTGRESQL_PORT, expectedLog = "listening on IPv4 address") | ||
static PostgresqlService database = 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.jdbc.transactions", "xa") | ||
.withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl); | ||
} |