-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introducing testcontainers in dev mode and increment (#76)
* introducing testcontainers in dev mode and increment * fixes issue with localstack
- Loading branch information
1 parent
7c8a8a8
commit 485d4a3
Showing
11 changed files
with
74 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "automatic" | ||
"java.configuration.updateBuildConfiguration": "automatic", | ||
"java.compile.nullAnalysis.mode": "automatic" | ||
} |
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
41 changes: 41 additions & 0 deletions
41
generators/server/templates/app/src/test/java/TestApplication.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,41 @@ | ||
package <%= packageName %>; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection; | ||
import org.springframework.context.annotation.Bean; | ||
<%_ if (databaseType === 'postgresql') { _%> | ||
import org.testcontainers.containers.PostgreSQLContainer; | ||
<%_ } _%> | ||
<%_ if (databaseType === 'mysql') { _%> | ||
import org.testcontainers.containers.MySQLContainer; | ||
<%_ } _%> | ||
<%_ if (databaseType === 'mariadb') { _%> | ||
import org.testcontainers.containers.MariaDBContainer; | ||
<%_ } _%> | ||
|
||
@TestConfiguration(proxyBeanMethods = false) | ||
public class TestApplication { | ||
|
||
@Bean | ||
@ServiceConnection | ||
<%_ if (databaseType === 'postgresql') { _%> | ||
PostgreSQLContainer<?> postgreSQLContainer() { | ||
return new PostgreSQLContainer<>("<%= POSTGRESQL_IMAGE %>"); | ||
} | ||
<%_ } _%> | ||
<%_ if (databaseType === 'mysql') { _%> | ||
MySQLContainer<?> sqlContainer () { | ||
return new MySQLContainer<>("<%= MYSQL_IMAGE %>"); | ||
} | ||
<%_ } _%> | ||
<%_ if (databaseType === 'mariadb') { _%> | ||
MariaDBContainer<?> sqlContainer () { | ||
return new MariaDBContainer<>("<%= MARIADB_IMAGE %>"); | ||
} | ||
<%_ } _%> | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.from(Application::main).with(TestApplication.class).run(args); | ||
} | ||
} |
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
54 changes: 0 additions & 54 deletions
54
generators/server/templates/app/src/test/java/common/DBContainerInitializer.java
This file was deleted.
Oops, something went wrong.
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: 1 addition & 4 deletions
5
generators/server/templates/app/src/test/resources/application-test.properties
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