diff --git a/README.md b/README.md index 1fe375c..2a596a6 100644 --- a/README.md +++ b/README.md @@ -257,9 +257,8 @@ Contributions are welcome! If you'd like to add support for additional databases 1. Fork the repository 2. Create a feature branch -3. Install the Git hooks to ensure code formatting (see below) -4. Add your changes -5. Submit a pull request +3. Add your changes +4. Submit a pull request ## License diff --git a/examples/spring-postgresql/src/test/resources/application-test.properties b/examples/spring-postgresql/src/test/resources/application-test.properties deleted file mode 100644 index a3f778e..0000000 --- a/examples/spring-postgresql/src/test/resources/application-test.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Test-specific database configuration -# These will be overridden by the testcontainers configuration -spring.datasource.driver-class-name=org.postgresql.Driver - -# JPA/Hibernate properties for tests -spring.jpa.hibernate.ddl-auto=create-drop -spring.jpa.show-sql=true -spring.jpa.properties.hibernate.format_sql=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect - -# Logging for tests -logging.level.org.hibernate.SQL=DEBUG -logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE \ No newline at end of file diff --git a/examples/spring-postgresql/src/test/resources/logback.xml b/examples/spring-postgresql/src/test/resources/logback.xml deleted file mode 100644 index caf3d28..0000000 --- a/examples/spring-postgresql/src/test/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/springboot-mysql/src/main/resources/application.properties b/examples/springboot-mysql/src/main/resources/application.properties deleted file mode 100644 index 446403f..0000000 --- a/examples/springboot-mysql/src/main/resources/application.properties +++ /dev/null @@ -1,15 +0,0 @@ -# Database configuration -spring.datasource.url=jdbc:mysql://localhost:3306/testdb -spring.datasource.username=root -spring.datasource.password=root -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver - -# JPA/Hibernate properties -spring.jpa.hibernate.ddl-auto=create -spring.jpa.show-sql=true -spring.jpa.properties.hibernate.format_sql=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect - -# Logging -logging.level.org.hibernate.SQL=DEBUG -logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE \ No newline at end of file diff --git a/examples/springboot-mysql/src/main/resources/application.yml b/examples/springboot-mysql/src/main/resources/application.yml new file mode 100644 index 0000000..aa2a5f0 --- /dev/null +++ b/examples/springboot-mysql/src/main/resources/application.yml @@ -0,0 +1,28 @@ +# Database configuration +spring: + datasource: + url: jdbc:mysql://localhost:3306/testdb + username: root + password: root + driver-class-name: com.mysql.cj.jdbc.Driver + + # JPA/Hibernate properties + jpa: + hibernate: + ddl-auto: create + show-sql: true + properties: + hibernate: + format_sql: true + dialect: org.hibernate.dialect.MySQLDialect + +# Logging +logging: + level: + org: + hibernate: + SQL: DEBUG + type: + descriptor: + sql: + BasicBinder: TRACE \ No newline at end of file diff --git a/examples/springboot-mysql/src/test/resources/logback.xml b/examples/springboot-mysql/src/test/resources/logback.xml deleted file mode 100644 index 02c0336..0000000 --- a/examples/springboot-mysql/src/test/resources/logback.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/springboot-ollama/src/test/resources/logback.xml b/examples/springboot-ollama/src/test/resources/logback.xml deleted file mode 100644 index 06012ac..0000000 --- a/examples/springboot-ollama/src/test/resources/logback.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/springboot-postgresql/src/main/resources/application.properties b/examples/springboot-postgresql/src/main/resources/application.properties deleted file mode 100644 index c2e81fe..0000000 --- a/examples/springboot-postgresql/src/main/resources/application.properties +++ /dev/null @@ -1,15 +0,0 @@ -# Database configuration -spring.datasource.url=jdbc:postgresql://localhost:5432/testdb -spring.datasource.username=postgres -spring.datasource.password=postgres -spring.datasource.driver-class-name=org.postgresql.Driver - -# JPA/Hibernate properties -spring.jpa.hibernate.ddl-auto=create -spring.jpa.show-sql=true -spring.jpa.properties.hibernate.format_sql=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect - -# Logging -logging.level.org.hibernate.SQL=DEBUG -logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE \ No newline at end of file diff --git a/examples/springboot-postgresql/src/main/resources/application.yml b/examples/springboot-postgresql/src/main/resources/application.yml new file mode 100644 index 0000000..2653746 --- /dev/null +++ b/examples/springboot-postgresql/src/main/resources/application.yml @@ -0,0 +1,27 @@ +# Database configuration +spring: + datasource: + url: jdbc:postgresql://localhost:5432/testdb + username: postgres + password: postgres + driver-class-name: org.postgresql.Driver + # JPA/Hibernate properties + jpa: + hibernate: + ddl-auto: create + show-sql: true + properties: + hibernate: + format_sql: true + dialect: org.hibernate.dialect.PostgreSQLDialect + +# Logging +logging: + level: + org: + hibernate: + SQL: DEBUG + type: + descriptor: + sql: + BasicBinder: TRACE \ No newline at end of file diff --git a/spring-testcontainers/src/main/java/io/flowinquiry/testcontainers/ContainerLifecycleExtension.java b/spring-testcontainers/src/main/java/io/flowinquiry/testcontainers/ContainerLifecycleExtension.java index 16d610b..854bdbd 100644 --- a/spring-testcontainers/src/main/java/io/flowinquiry/testcontainers/ContainerLifecycleExtension.java +++ b/spring-testcontainers/src/main/java/io/flowinquiry/testcontainers/ContainerLifecycleExtension.java @@ -16,10 +16,8 @@ public abstract class ContainerLifecycleExtension implements BeforeAllCallback, AfterAllCallback { - /** Logger for this class. */ private static final Logger log = LoggerFactory.getLogger(ContainerLifecycleExtension.class); - /** The container provider that manages the actual container instance. */ private SpringAwareContainerProvider> provider; @@ -56,7 +54,7 @@ public void beforeAll(ExtensionContext context) { this.provider = ContainerRegistry.get(testClass); } else { this.provider = initProvider(enableContainerAnnotation); - log.debug("Starting JDBC container {} for test class: {}", provider, testClass.getName()); + log.debug("Starting container {} for test class: {}", provider, testClass.getName()); provider.start(); ContainerRegistry.set(testClass, provider); } diff --git a/spring-testcontainers/src/main/java/io/flowinquiry/testcontainers/SpringAwareContainerProvider.java b/spring-testcontainers/src/main/java/io/flowinquiry/testcontainers/SpringAwareContainerProvider.java index aa368be..ed49c61 100644 --- a/spring-testcontainers/src/main/java/io/flowinquiry/testcontainers/SpringAwareContainerProvider.java +++ b/spring-testcontainers/src/main/java/io/flowinquiry/testcontainers/SpringAwareContainerProvider.java @@ -15,7 +15,7 @@ * well as applying container configuration to Spring environment. * *

Implementations of this class should provide specific container creation logic and environment - * configuration for different container types (e.g., PostgreSQL, MySQL, Ollama). + * configuration for different container types (e.g., PostgreSQL, MySQL, Ollama, etc). * * @param The specific type of GenericContainer being managed */