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 extends Annotation, ? extends GenericContainer>>
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
*/
From a243c82bd7f06ee97e2f54cd85dd5c3b822ef1b0 Mon Sep 17 00:00:00 2001
From: Hai Phuc Nguyen <“3423575+haiphucnguyen@users.noreply.github.com”>
Date: Sat, 14 Jun 2025 00:02:23 -0700
Subject: [PATCH 4/4] Update
---
.../src/main/resources/application.properties | 15 ++++++++++
.../src/main/resources/application.yml | 28 -------------------
.../src/test/resources/application-test.yml | 26 -----------------
3 files changed, 15 insertions(+), 54 deletions(-)
create mode 100644 examples/spring-postgresql/src/main/resources/application.properties
delete mode 100644 examples/spring-postgresql/src/main/resources/application.yml
delete mode 100644 examples/spring-postgresql/src/test/resources/application-test.yml
diff --git a/examples/spring-postgresql/src/main/resources/application.properties b/examples/spring-postgresql/src/main/resources/application.properties
new file mode 100644
index 0000000..c2e81fe
--- /dev/null
+++ b/examples/spring-postgresql/src/main/resources/application.properties
@@ -0,0 +1,15 @@
+# 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/spring-postgresql/src/main/resources/application.yml b/examples/spring-postgresql/src/main/resources/application.yml
deleted file mode 100644
index f08c9e3..0000000
--- a/examples/spring-postgresql/src/main/resources/application.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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/examples/spring-postgresql/src/test/resources/application-test.yml b/examples/spring-postgresql/src/test/resources/application-test.yml
deleted file mode 100644
index 7760a19..0000000
--- a/examples/spring-postgresql/src/test/resources/application-test.yml
+++ /dev/null
@@ -1,26 +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
- jpa:
- hibernate:
- ddl-auto: create-drop
- show-sql: true
- properties:
- hibernate:
- format_sql: true
- dialect: org.hibernate.dialect.PostgreSQLDialect
-
-# Logging for tests
-logging:
- level:
- org:
- hibernate:
- SQL: DEBUG
- type:
- descriptor:
- sql:
- BasicBinder: TRACE
\ No newline at end of file