forked from keycloak/keycloak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supply databases with Testcontainers.
Signed-off-by: Miquel Simon <[email protected]>
- Loading branch information
Showing
13 changed files
with
170 additions
and
15 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
1 change: 1 addition & 0 deletions
1
test-poc/base/src/test/resources/container-license-acceptance.txt
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 @@ | ||
mcr.microsoft.com/mssql/server:latest |
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
5 changes: 5 additions & 0 deletions
5
test-poc/framework/src/main/java/org/junit/rules/TestRule.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,5 @@ | ||
package org.junit.rules; | ||
|
||
@SuppressWarnings("unused") | ||
public interface TestRule { | ||
} |
5 changes: 5 additions & 0 deletions
5
test-poc/framework/src/main/java/org/junit/runners/model/Statement.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,5 @@ | ||
package org.junit.runners.model; | ||
|
||
@SuppressWarnings("unused") | ||
public class Statement { | ||
} |
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
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
18 changes: 18 additions & 0 deletions
18
...ework/src/main/java/org/keycloak/test/framework/database/MSSQLServerDatabaseSupplier.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,18 @@ | ||
package org.keycloak.test.framework.database; | ||
|
||
public class MSSQLServerDatabaseSupplier extends AbstractDatabaseSupplier { | ||
public static final String VENDOR = "mssql"; | ||
|
||
@Override | ||
TestDatabase getTestDatabase() { | ||
DatabaseConfig databaseConfig = new DatabaseConfig() | ||
.vendor(VENDOR) | ||
.containerImage("mcr.microsoft.com/mssql/server:latest"); | ||
return new TestDatabase(databaseConfig); | ||
} | ||
|
||
@Override | ||
public String getAlias() { | ||
return VENDOR; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...framework/src/main/java/org/keycloak/test/framework/database/MariaDBDatabaseSupplier.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,20 @@ | ||
package org.keycloak.test.framework.database; | ||
|
||
public class MariaDBDatabaseSupplier extends AbstractDatabaseSupplier { | ||
public static final String VENDOR = "mariadb"; | ||
|
||
@Override | ||
TestDatabase getTestDatabase() { | ||
DatabaseConfig databaseConfig = new DatabaseConfig() | ||
.vendor(VENDOR) | ||
.username(DEFAULT_DB_USERNAME) | ||
.password(DEFAULT_DB_PASSWORD) | ||
.containerImage("mariadb:latest"); | ||
return new TestDatabase(databaseConfig); | ||
} | ||
|
||
@Override | ||
public String getAlias() { | ||
return VENDOR; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...c/framework/src/main/java/org/keycloak/test/framework/database/MySQLDatabaseSupplier.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,21 @@ | ||
package org.keycloak.test.framework.database; | ||
|
||
public class MySQLDatabaseSupplier extends AbstractDatabaseSupplier { | ||
|
||
public static final String VENDOR = "mysql"; | ||
|
||
@Override | ||
TestDatabase getTestDatabase() { | ||
DatabaseConfig databaseConfig = new DatabaseConfig() | ||
.vendor(VENDOR) | ||
.username(DEFAULT_DB_USERNAME) | ||
.password(DEFAULT_DB_PASSWORD) | ||
.containerImage("mysql:latest"); | ||
return new TestDatabase(databaseConfig); | ||
} | ||
|
||
@Override | ||
public String getAlias() { | ||
return VENDOR; | ||
} | ||
} |
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
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
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