From 4a7f0213370d5c51e872d609d134bb8efc0fe059 Mon Sep 17 00:00:00 2001 From: wowo-zZ Date: Sun, 12 Apr 2026 15:10:54 +0800 Subject: [PATCH] fix(test): use ddl-auto=create to prevent cross-context table drops Multiple @SpringBootTest classes with different @MockBean configs cause separate Spring contexts sharing the same H2 in-memory database. With create-drop, one context's shutdown drops tables needed by another, causing "Table not found (this database is empty)" errors. --- server/skillhub-app/src/test/resources/application-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/skillhub-app/src/test/resources/application-test.yml b/server/skillhub-app/src/test/resources/application-test.yml index a3eb93b9..fec71eff 100644 --- a/server/skillhub-app/src/test/resources/application-test.yml +++ b/server/skillhub-app/src/test/resources/application-test.yml @@ -10,7 +10,7 @@ spring: password: jpa: hibernate: - ddl-auto: create-drop + ddl-auto: create database-platform: org.hibernate.dialect.H2Dialect flyway: enabled: false