Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpomykala/spring-jooq-flyway-testcontainers-junit5
🚀 Example project with configured Spring Boot, JooQ, TestContainers, MySQL container and JUnit5
https://github.com/jpomykala/spring-jooq-flyway-testcontainers-junit5
flyway java java-11 jooq junit junit5 mysql spring-boot testcontainers
Last synced: about 1 month ago
JSON representation
🚀 Example project with configured Spring Boot, JooQ, TestContainers, MySQL container and JUnit5
- Host: GitHub
- URL: https://github.com/jpomykala/spring-jooq-flyway-testcontainers-junit5
- Owner: jpomykala
- Created: 2019-01-07T14:06:41.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-21T00:54:43.000Z (over 2 years ago)
- Last Synced: 2024-02-11T16:06:22.596Z (9 months ago)
- Topics: flyway, java, java-11, jooq, junit, junit5, mysql, spring-boot, testcontainers
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 31
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spring-jooq-flyway-testcontainers-junit5
Example project with configured Spring Boot, JooQ, TestContainers, flyway (as maven plugin) MySQL container and JUnit5 🚀### Used versions
```xml
2.1.1
11
5.2.4
3.11.7
8.0.11
1.10.5
```### Running
`mvn clean test`
Test loads first migration `V1__Init.sql` manually.
### Main test configuration
```java
@ContextConfiguration(initializers = AbstractTestConfiguration.Initializer.class)
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@JooqTest
public abstract class AbstractTestConfiguration {@ClassRule
public static MySQLContainer mysql = new MySQLContainer().withDatabaseName("playground");public static class Initializer implements ApplicationContextInitializer {
@Override
public void initialize(@NotNull ConfigurableApplicationContext configurableApplicationContext) {
mysql.start();
configurableApplicationContext.getEnvironment().getSystemProperties().put("spring.datasource.url", mysql.getJdbcUrl() + "?useSSL=false");
configurableApplicationContext.getEnvironment().getSystemProperties().put("spring.datasource.username", mysql.getUsername());
configurableApplicationContext.getEnvironment().getSystemProperties().put("spring.datasource.password", mysql.getPassword());
}
}
}
```